Amazon Linux(centos) : MySQL 5.7.23 컴파일, 설치

Database 2021. 5. 7. 09:39 Posted by 파란크리스마스

출처

리눅스 정보 조회

출처 : 리눅스 종류 확인, 리눅스 버전 확인 - 제타위키

$ cat /etc/*-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
Amazon Linux release 2 (Karoo)

관련패키지 설치

$ sudo yum update
$ sudo yum install gcc gcc-c++ openssl curl autoconf ncurses-devel bison zlib curl libtermcap-devel bzip2-devel

MySQL 계정 만들기

$ sudo groupadd mysql 
$ sudo useradd -g mysql -s /bin/bash -m mysql

cmake 설치

$ sudo yum install cmake

MySQL 소스 다운로드, 압축해제, 컴파일, 설치

$ wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.23.tar.gz 
$ tar xvf mysql-boost-5.7.23.tar.gz 
$ cd mysql-5.7.23 
$ cmake \ 
  -DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \ 
  -DMYSQL_DATADIR=/usr/local/mysql57/data \ 
  -DMYSQL_UNIX_ADDR=/usr/local/mysql57/mysql.sock \ 
  -DSYSCONFDIR=/usr/local/mysql57 \ 
  -DMYSQL_TCP_PORT=5723 \ 
  -DMYSQL_USER=mysql \ 
  -DDEFAULT_CHARSET=utf8 \ 
  -DDEFAULT_COLLATION=utf8_general_ci \ 
  -DWITH_EXTRA_CHARSETS=all \ 
  -DENABLED_LOCAL_INFILE=1 \ 
  -DWITH_INNOBASE_STORAGE_ENGINE=1 \ 
  -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ 
  -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ 
  -DDOWNLOAD_BOOST=0 \
  -DWITH_BOOST=./boost 
$ make 
$ sudo make install

환경설정

$ sudo vi /usr/local/mysql57/my.cnf

[mysqld]
# port=3306
# basedir=/usr/local/mysql57
# datadir=/usr/local/mysql57/data
# pid-file=/usr/local/mysql57/mysqld.pid
# log_error=/usr/local/mysql57/mysql_error.log
# lc-messages-dir=/usr/local/mysql57/share

init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
character-set-server=utf8
collation-server=utf8_general_ci
# table_cache=1024
max_connections=2048
max_user_connections=500
max_connect_errors=10000
wait_timeout=300
query_cache_type = 1
query_cache_size = 128M
query_cache_limit = 5M
slow_query_log
long_query_time=3
max_allowed_packet=16M
sort_buffer_size = 2M
# skip-innodb
skip-name-resolve
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

MySQL 설치 디렉토리 mysql 계정으로 권한 수정

$ sudo chown -R mysql:mysql /usr/local/mysql57

MySQL 데이터베이스 초기화 (mysql 계정으로 실행)

$ cd /usr/local/mysql57
$ bin/mysql_install_db --no-defaults --user=mysql --datadir=/usr/local/mysql57/data --basedir=/usr/local/mysql57 -v
2021-05-08 08:15:24 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2021-05-08 08:15:24 [NOTE]    Creating data directory /usr/local/mysql57/data
2021-05-08 08:15:24 [NOTE]    Generating random password to /root/.mysql_secret...done.
2021-05-08 08:15:24 [NOTE]    Setting file ownership to mysql
2021-05-08 08:15:24 [NOTE]    Executing /usr/local/mysql57/bin/mysqld --no-defaults --bootstrap --datadir=/usr/local/mysql57/data --lc-messages-dir=/usr/local/mysql57/share --lc-messages=en_US --basedir=/usr/local/mysql57
2021-05-08 08:15:24 [NOTE]    Creating system tables...done.
2021-05-08 08:15:24 [NOTE]    Filling system tables with data...done.
2021-05-08 08:15:25 [NOTE]    Filling help table with data...done.
2021-05-08 08:15:25 [NOTE]    Creating user for internal session service...done.
2021-05-08 08:15:25 [NOTE]    Creating default user root@localhost
2021-05-08 08:15:25 [NOTE]    Creating default proxy root@localhost
2021-05-08 08:15:25 [NOTE]    Creating sys schema
2021-05-08 08:15:25 [NOTE]    done.
2021-05-08 08:15:26 [WARNING] The bootstrap log isn't empty:
2021-05-08 08:15:26 [WARNING] 2021-05-08T08:15:24.294574Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead
2021-05-08T08:15:24.299965Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2021-05-08T08:15:24.299974Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
 
2021-05-08 08:15:26 [NOTE]    Generating SSL Certificates

MySQL 서비스 등록

서비스 mysqld 파일 복사

$ sudo cp /usr/local/mysql57/support-files/mysql.server /etc/init.d/mysqld57

mysqld 수정

$ sudo vi /etc/init.d/mysqld57

mysqld파일을 열어서 basedir에 mysql이 설치된 디렉토리와 데이터 디렉토리(datadir)를 설정한다.

basedir=/usr/local/mysql57
datadir=/usr/local/mysql57/data

mysqld 서비스 등록

$ sudo chkconfig --add mysqld57
$ sudo chmod +x /etc/init.d/mysqld57
$ chkconfig --list
 
Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.
 
mysqld57        0:off   1:off   2:on    3:on    4:on    5:on    6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
tomcat          0:off   1:off   2:off   3:on    4:on    5:on    6:off
$ sudo chkconfig --level 345 mysqld57 on

mysqld 서비스 실행

$ sudo service mysqld57 start
Starting MySQL. SUCCESS!

root 암호 초기화

mysqld 실행

$ sudo bin/mysqld_safe --skip-grant-tables &
[1] 11505
2021-05-08T08:56:04.765371Z mysqld_safe Logging to '/var/log/mysqld.log'.
2021-05-08T08:56:04.792894Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

root 암호 설정

$ bin/mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.23-log Source distribution
 
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql> update user set authentication_string = password('manager') where user = 'root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit
Bye

ERROR 1820 (HY000) 오류 해결

mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> SET PASSWORD = PASSWORD('soY&Be9p/4ed!!!'); 
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql> 

사용자 추가

mysql> create user 'user1'@'%' identified by 'userpw';
Query OK, 0 rows affected (0.00 sec)
 
mysql> grant all privileges on *.* to 'user1'@'%' with grant option; 
Query OK, 0 rows affected (0.00 sec)
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

사용자 추가 - 특정 DB에 권한 부여

mysql> create user 'terecal'@'%' identified by '****'; 
Query OK, 0 rows affected (0.00 sec)
 
mysql> grant all privileges ON terecal_db.* TO 'terecal'@'%'; 
Query OK, 0 rows affected (0.00 sec)
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

댓글을 달아 주세요

Ender 5 : SKR mini e3 v2.0 bltouch

3D 프린터 2021. 5. 3. 22:54 Posted by 파란크리스마스

출처

 

SKR mini E3 v2.0에 권장되는 BLTouch 배선

BLTouch 설치

Configuration.h

BLTouch 활성화

/**
 * The BLTouch probe uses a Hall effect sensor and emulates a servo.
 */
#define BLTOUCH

노즐과 BLTouch 사이 간격 설정

/**
 * Z Probe to nozzle (X,Y) offset, relative to (0, 0).
 *
 * In the following example the X and Y offsets are both positive:
 *
 *   #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
 *
 *     +-- BACK ---+
 *     |           |
 *   L |    (+) P  | R <-- probe (20,20)
 *   E |           | I
 *   F | (-) N (+) | G <-- nozzle (10,10)
 *   T |           | H
 *     |    (-)    | T
 *     |           |
 *     O-- FRONT --+
 *   (0,0)
 *
 * Specify a Probe position as { X, Y, Z }
 */
#define NOZZLE_TO_PROBE_OFFSET { 0, -38, 0 }

Z_SAFE_HOMING 활성화

Home 이동시 베드 외부로 이동 하는 것을 방지하기 위해서 Z_SAFE_HOMING을 활성화 시켜 주므로 베드의 가운데로 이동하도록 하기 위함(NOZZLE_TO_PROBE_OFFSET 값이 올바르지 않는 경우 베드의 외부로 이동 할수 있음)

// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
// With this feature enabled:
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
// - Prevent Z homing when the Z probe is outside bed area.
//
#define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
  #define Z_SAFE_HOMING_X_POINT X_CENTER  // X point for Z homing
  #define Z_SAFE_HOMING_Y_POINT Y_CENTER  // Y point for Z homing
#endif

AUTO_BED_LEVELING_BILINEAR 활성화

Z축 엔드스탑 스위치에 의해서 멈추던 것을 BLTouch의 신호에 의해서 멈추도록 설정

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
//#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the probe.

Z_MIN_PROBE_ENDSTOP_INVERTING 활성화, MESH_BED_LEVELING 비활성화

MESH_BED_LEVELING : 수동으로 레벨링 측정하는 옵션은 비활성화 시키고,
AUTO_BED_LEVELING_BILINEAR : 그리드 형태로 여러지점을 샘플지점으로 베드 레벨링을 측정하도록 설정 (높이가 고르지 않은 배드에 가장 적합)

/**
 * Choose one of the options below to enable G29 Bed Leveling. The parameters
 * and behavior of G29 will change depending on your selection.
 *
 *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!
 *
 * - AUTO_BED_LEVELING_BILINEAR
 *   Probe several points in a grid.
 *   You specify the rectangle and the density of sample points.
 *   The result is a mesh, best for large or uneven beds.
 *
 * - MESH_BED_LEVELING
 *   Probe a grid manually
 *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)
 *   For machines without a probe, Mesh Bed Leveling provides a method to perform
 *   leveling in steps so you can manually adjust the Z height at each grid-point.
 *   With an LCD controller the process is guided step-by-step.
 */
//#define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR // <-- 주석 제거
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING // <- 주석 추가

GRID_MAX_POINTS_X 값 변경

그리드 형태로 샘플지점을 5x5에서 3x3으로 변경 (너무 촘촘하게 측정은 불필요 하다고 판단)

  // Set the number of grid points per dimension.
  #define GRID_MAX_POINTS_X 3 // 5 -> 3
  #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

MIN_SOFTWARE_ENDSTOP_Z 주석 추가

Z move 마이너스값 허용

// Min software endstops constrain movement within minimum coordinate bounds
#define MIN_SOFTWARE_ENDSTOPS
#if ENABLED(MIN_SOFTWARE_ENDSTOPS)
  #define MIN_SOFTWARE_ENDSTOP_X
  #define MIN_SOFTWARE_ENDSTOP_Y
  // #define MIN_SOFTWARE_ENDSTOP_Z  // 주석시 - Z move 마이너스값 허용
#endif

Configuration_adv.h

BLTOUCH_DELAY 주석 제거

BLTouch가 측정한 값을 인식하는 데 필요한 지연 시간 설정(시간 단위(ms). 필요한 경우 활성화하고 지연 시간을 늘려서 설정도 가능)

  // Safety: The probe needs time to recognize the command.
  //         Minimum command delay (ms). Enable and increase if needed.
  #define BLTOUCH_DELAY 500  // <- 주석제거

BLTOUCH_FORCE_SW_MODE 주석 제거

  // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful
  //          in special cases, like noisy or filtered input configurations.
  #define BLTOUCH_FORCE_SW_MODE  // <- 주석제거

컴파일

CURA GCode 추가

;When using Default mode, you do not need to declare logic mode. 
M280 P0 S160 ; BLTouch alarm release 
G4 P100 ; delay for BLTouch 
G28 ; home 
G29 ; auto bed leveling

 

댓글을 달아 주세요

RabbitMQ : Ubuntu에 설치

Programming/Java 2021. 4. 18. 21:54 Posted by 파란크리스마스

출처

저장소 추가

bluesanta@bluesanta-desktop:~$ sudo apt list --installed rabbitmq-server
나열 중... 완료

RabbitMQ 설치

bluesanta@bluesanta-desktop:~$ sudo apt install rabbitmq-server
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음의 추가 패키지가 설치될 것입니다 :
  erlang-asn1 erlang-base erlang-crypto erlang-eldap erlang-ftp erlang-inets erlang-mnesia erlang-os-mon erlang-parsetools
  erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl libsctp1
  locales-all
제안하는 패키지:
  erlang erlang-manpages erlang-doc lksctp-tools
다음 새 패키지를 설치할 것입니다:
  erlang-asn1 erlang-base erlang-crypto erlang-eldap erlang-ftp erlang-inets erlang-mnesia erlang-os-mon erlang-parsetools
  erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl libsctp1
  locales-all rabbitmq-server
0개 업그레이드, 20개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
38.1 M바이트 아카이브를 받아야 합니다.
이 작업 후 276 M바이트의 디스크 공간을 더 사용하게 됩니다.

RabbitMQ 실행 상태 확인

bluesanta@bluesanta-desktop:~$ systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ Messaging Server
     Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-04-18 14:23:53 KST; 4min 59s ago
   Main PID: 2625 (beam.smp)
     Status: "Initialized"
      Tasks: 163 (limit: 18897)
     Memory: 85.5M
     CGroup: /system.slice/rabbitmq-server.service
             ├─2608 /bin/sh /usr/sbin/rabbitmq-server
             ├─2625 /usr/lib/erlang/erts-10.6.4/bin/beam.smp -W w -A 128 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -K true -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbit>
             ├─2970 erl_child_setup 65536
             ├─3007 inet_gethost 4
             └─3008 inet_gethost 4
 
 4월 18 14:23:50 bluesanta-desktop systemd[1]: Starting RabbitMQ Messaging Server...
 4월 18 14:23:53 bluesanta-desktop systemd[1]: rabbitmq-server.service: Supervising process 2625 which is not our child. We'll most likely not notice when it exits.
 4월 18 14:23:53 bluesanta-desktop systemd[1]: Started RabbitMQ Messaging Server.
 4월 18 14:23:53 bluesanta-desktop systemd[1]: rabbitmq-server.service: Supervising process 2625 which is not our child. We'll most likely not notice when it exits.

Management UI 플러그인 활성화

bluesanta@bluesanta-desktop:~$ sudo rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@bluesanta-desktop:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@bluesanta-desktop...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
 
started 3 plugins.

사용자 추가

사용자 목록 조회

bluesanta@bluesanta-desktop:~$ sudo rabbitmqctl list_users
Listing users ...
user    tags
guest   [administrator]

사용자 추가

bluesanta@bluesanta-desktop:~$ sudo rabbitmqctl add_user admin 'passwd'
Adding user "admin" ...

사용자 권한 부여

bluesanta@bluesanta-desktop:~$ sudo rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...

암호 변경

bluesanta@bluesanta-desktop:~$ sudo rabbitmqctl change_password admin 'passwd'
Changing password for user "admin" ...

RabbitMQ 포트

  • 4369 : epmd, 여러 rabbitmq 서버끼리 서로를 찾을 수 있는 네임 서버 역할을 하는 데몬에서 사용
  • 5672, 5671 : AMQP 를 사용한 메시지 전달
  • 25672 : inter-node 와 CLI Tool 연결
  • 15672 : HTTP API, Management UI

RabbitMQ 관리페이지

웹브라우저로 http://serverip:15672/에 접속

MQTT 플러그인 활성화

bluesanta@bluesanta-desktop:~$ sudo rabbitmq-plugins enable rabbitmq_mqtt
Enabling plugins on node rabbit@bluesanta-desktop:
rabbitmq_mqtt
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_mqtt
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@bluesanta-desktop...
The following plugins have been enabled:
  rabbitmq_mqtt
 
started 1 plugins.
bluesanta@bluesanta-desktop:~$ netstat -nao | grep 1883
tcp6       0      0 :::1883                 :::*                    LISTEN      off (0.00/0/0)

댓글을 달아 주세요

Apache로 Tomcat 로드밸런싱 설정

Programming/Apache, PHP 2021. 4. 10. 13:04 Posted by 파란크리스마스

출처

필수 라이브러리 설치

bluesanta@bluesanta-desktop:~$ sudo apt install libexpat1-dev libssl-dev

PCRE 설치

bluesanta@bluesanta-desktop:~$ wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
bluesanta@bluesanta-desktop:~$ tar xvf pcre-8.44.tar.gz 
bluesanta@bluesanta-desktop:~$ cd pcre-8.44/
bluesanta@bluesanta-desktop:~/pcre-8.44$ ./configure --prefix=/usr/local/pcre-8.44
bluesanta@bluesanta-desktop:~/pcre-8.44$ make
bluesanta@bluesanta-desktop:~/pcre-8.44$ sudo make install

Apache 웹서버 설치

bluesanta@bluesanta-desktop:~$ wget https://archive.apache.org/dist/httpd/httpd-2.4.39.tar.gz
bluesanta@bluesanta-desktop:~$ tar xvf httpd-2.4.39.tar.gz 
bluesanta@bluesanta-desktop:~$ cd httpd-2.4.39/
bluesanta@bluesanta-desktop:~/httpd-2.4.39$ cd srclib
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ wget https://archive.apache.org/dist/apr/apr-1.7.0.tar.gz
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ tar xvfz apr-1.7.0.tar.gz
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ mv apr-1.7.0 apr
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ wget https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ tar xvfz apr-util-1.6.1.tar.gz
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ mv apr-util-1.6.1 apr-util
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ tar xvfz pcre-8.44.tar.gz
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ mv pcre-8.44 pcre
bluesanta@bluesanta-desktop:~/httpd-2.4.39/srclib$ cd ..
bluesanta@bluesanta-desktop:~/httpd-2.4.39$ ./configure --prefix=/opt/apache24 --with-pcre=/usr/local/pcre-8.44 --enable-cgi --enable-info --enable-deflate --enable-ssl --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp --enable-expires --enable-headers --enable-rewrite --enable-so --with-included-apr --with-included-apr-util --with-included-pcre
bluesanta@bluesanta-desktop:~/httpd-2.4.39$ make
bluesanta@bluesanta-desktop:~/httpd-2.4.39$ make install

mod_jk 설치

bluesanta@bluesanta-desktop:~$ wget https://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.46-src.tar.gz
bluesanta@bluesanta-desktop:~$ tar xvf tomcat-connectors-1.2.46-src.tar.gz
bluesanta@bluesanta-desktop:~$ cd tomcat-connectors-1.2.46-src/native/
bluesanta@bluesanta-desktop:~$ ./configure --with-apxs=/opt/apache24//bin/apxs
bluesanta@bluesanta-desktop:~/tomcat-connectors-1.2.46-src/native$ make
bluesanta@bluesanta-desktop:~/tomcat-connectors-1.2.46-src/native$ make install

로드밸런싱 설정

bluesanta@bluesanta-desktop:~$ cd /opt/apache24/conf/
bluesanta@bluesanta-desktop:/opt/apache24/conf$ vi workers.properties

workers.properties

worker.list=load_balancer

worker.load_balancer.type=lb
worker.load_balancer.balance_workers=tomcat1,tomcat2
#worker.load_balancer.balance_workers=tomcat2

# tomcat/conf/server.xml - ajp 포트
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1

# tomcat/conf/server.xml - ajp 포트
worker.tomcat2.port=7009
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1

httpd.conf

bluesanta@bluesanta-desktop:/opt/apache24/conf$ vi httpd.conf

LoadModule jk_module modules/mod_jk.so

... 생략 ...

<IfModule jk_module>
    JkWorkersFile    conf/workers.properties
    JkLogFile        logs/mod_jk.log
    JkLogLevel       info
    JkMount /* 	load_balancer
</IfModule>

Apache 웹서버 환경 설정

bluesanta@bluesanta-desktop:~$ cd /opt/apache24/conf/
bluesanta@bluesanta-desktop:/opt/apache24/conf$ vi httpd.conf

ServerName 주석을 풀고 localhost로 설정

#ServerName www.example.com:80
ServerName localhost

서비스 등록 파일 apache2.service 생성

bluesanta@bluesanta-desktop:/opt/apache24/conf$ cd /opt/apache24/bin/
bluesanta@bluesanta-desktop:/opt/apache24/bin$ vi apache2.service

apache2.service 내용

[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=https://httpd.apache.org/docs/2.4/

[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/opt/apache24/bin/apachectl start
ExecStop=/opt/apache24/bin/apachectl stop
ExecReload=/opt/apache24/bin/apachectl graceful
PrivateTmp=true
Restart=on-abort

[Install]
WantedBy=multi-user.target

apache2.service 파일 /etc/systemd/system 디렉토리에 복사

bluesanta@bluesanta-desktop:/opt/apache24/bin$ sudo chmod +x apache2.service
bluesanta@bluesanta-desktop:/opt/apache24/bin$ sudo cp apache2.service /etc/systemd/system

Apache 서비스 등록

bluesanta@bluesanta-desktop:/opt/apache24/bin$ sudo systemctl enable apache2
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /etc/systemd/system/apache2.service.

Apache 서비스 실행

bluesanta@bluesanta-desktop:/opt/apache24/bin$ sudo systemctl start apache2

Apache 서비스 상태 확인

bluesanta@bluesanta-desktop:/opt/apache24/bin$ sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/etc/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-04-10 14:22:21 KST; 57s ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 284736 (httpd)
      Tasks: 82 (limit: 18898)
     Memory: 7.2M
     CGroup: /system.slice/apache2.service
             ├─284736 /opt/apache24/bin/httpd -k start
             ├─284737 /opt/apache24/bin/httpd -k start
             ├─284738 /opt/apache24/bin/httpd -k start
             └─284739 /opt/apache24/bin/httpd -k start
 
 4월 10 14:22:21 bluesanta-desktop systemd[1]: Starting The Apache HTTP Server...
 4월 10 14:22:21 bluesanta-desktop systemd[1]: Started The Apache HTTP Server.

댓글을 달아 주세요

git 파일 추가

Programming 2021. 4. 3. 12:10 Posted by 파란크리스마스

출처

추가할 파일이 있는지 확인

$ git status
On branch master
Your branch is up to date with 'origin/master'.
 
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        dist_admin.sh
 
nothing added to commit but untracked files present (use "git add" to track)

git 파일 추가

$ git add dist_admin.sh

추가한 파일 Repository에 commit

$ git commit -m "add dist_admin.sh"
[master de5e9a98] add dist_admin.sh
 Committer: EC2 Default User <ec2-user@-------------------------->
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
 
    git config --global --edit
 
After doing this, you may fix the identity used for this commit with:
 
    git commit --amend --reset-author
 
 1 file changed, 7 insertions(+)
 create mode 100755 dist_admin.sh

원격 저장소에 push

$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
 
nothing to commit, working tree clean
$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 441 bytes | 441.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/-----/--------
   b9b9e27d..de5e9a98  master -> master

댓글을 달아 주세요

출처

Python 설치

bluesanta@Kubuntu:~$ sudo apt install python

Android NDK(C/C++) 다운로드, 압축 해제

bluesanta@Kubuntu:~$ wget https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip
bluesanta@Kubuntu:~$ sudo mv android-ndk-r20b-linux-x86_64.zip /opt/
bluesanta@Kubuntu:~$ cd /opt/
bluesanta@Kubuntu:/opt$ sudo unzip android-ndk-r20b-linux-x86_64.zip

NDK 경로 path에 추가

bluesanta@Kubuntu:/opt$ echo 'export ANDROID_NDK_ROOT=/opt/android-ndk-r20b' | tee -a ~/.bashrc
bluesanta@Kubuntu:/opt$ echo 'export PATH=$PATH:$ANDROID_NDK_ROOT' | tee -a ~/.bashrc

.profile-ndk 파일 작성

bluesanta@Kubuntu:/opt$ vi ~/.profile_ndk

.profile-ndk 내용

export ANDROID_NDK_ROOT=/opt/android-ndk-r20b
export NDK_TOOLCHAIN_VERSION=4.8
export TOOLCHAIN=/opt/android-21-toolchain
 
export PATH=$TOOLCHAIN/bin:$PATH

.profile-ndk 실행 (NDK 빌드시 사용)

bluesanta@Kubuntu:/opt$ chmod a+x ~/.profile_ndk
bluesanta@Kubuntu:/opt$ source ~/.profile_ndk

toolchain 설치

bluesanta@Kubuntu:/opt$ sudo $ANDROID_NDK_ROOT/build/tools/make-standalone-toolchain.sh \
  --verbose \
  --install-dir=$TOOLCHAIN \
  --platform=android-21
HOST_OS=linux
HOST_EXE=
HOST_ARCH=x86_64
HOST_TAG=linux-x86_64
HOST_NUM_CPUS=4
BUILD_NUM_CPUS=8
Auto-config: --arch=arm
## COMMAND: python /opt/android-ndk-r20b/build/tools/make_standalone_toolchain.py --arch arm --api 21 --stl gnustl --install-dir=/opt/android-21-toolchain
WARNING:__main__:make_standalone_toolchain.py is no longer necessary. The
$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin directory contains target-specific scripts that perform
the same task. For example, instead of:
 
    $ python $NDK/build/tools/make_standalone_toolchain.py \
        --arch arm --api 21 --install-dir toolchain
    $ toolchain/bin/clang++ src.cpp
 
Instead use:
 
    $ $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ src.cpp
 
Toolchain installed to /opt/android-21-toolchain.

toolchain 환경설정

bluesanta@Kubuntu:/opt$ echo 'export TOOLCHAIN=/opt/android-21-toolchain' | tee -a ~/.bashrc
bluesanta@Kubuntu:/opt$ echo 'export PATH=$TOOLCHAIN/bin:$PATH' | tee -a ~/.bashrc

예제

Android.mk

LOCAL_PATH := $(call my-dir)
 
include $(CLEAR_VARS)
 
LOCAL_MODULE    := hello-jni
LOCAL_SRC_FILES := hello-jni.c
 
include $(BUILD_SHARED_LIBRARY)

hello-jni.c

#include <string.h>
#include <jni.h>

JNIEXPORT jstring JNICALL
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
                                                  jobject thiz )
{
#if defined(__arm__)
    #if defined(__ARM_ARCH_7A__)
    #if defined(__ARM_NEON__)
      #if defined(__ARM_PCS_VFP)
        #define ABI "armeabi-v7a/NEON (hard-float)"
      #else
        #define ABI "armeabi-v7a/NEON"
      #endif
    #else
      #if defined(__ARM_PCS_VFP)
        #define ABI "armeabi-v7a (hard-float)"
      #else
        #define ABI "armeabi-v7a"
      #endif
    #endif
  #else
   #define ABI "armeabi"
  #endif
#elif defined(__i386__)
#define ABI "x86"
#elif defined(__x86_64__)
#define ABI "x86_64"
#elif defined(__mips64)  /* mips64el-* toolchain defines __mips__ too */
#define ABI "mips64"
#elif defined(__mips__)
#define ABI "mips"
#elif defined(__aarch64__)
#define ABI "arm64-v8a"
#else
#define ABI "unknown"
#endif

    return (*env)->NewStringUTF(env, "Hello from JNI !  Compiled with ABI " ABI ".");
}

컴파일

bluesanta@Kubuntu:/bluesanta/workspace.cmx/hello_ndk$ ndk-build NDK_PROJECT_PATH=`pwd` APP_BUILD_SCRIPT=Android.mk
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.    
[arm64-v8a] Compile        : hello-jni <= hello-jni.c
[arm64-v8a] SharedLibrary  : libhello-jni.so
[arm64-v8a] Install        : libhello-jni.so => libs/arm64-v8a/libhello-jni.so
[armeabi-v7a] Compile thumb  : hello-jni <= hello-jni.c
[armeabi-v7a] SharedLibrary  : libhello-jni.so
[armeabi-v7a] Install        : libhello-jni.so => libs/armeabi-v7a/libhello-jni.so
[x86] Compile        : hello-jni <= hello-jni.c
[x86] SharedLibrary  : libhello-jni.so
[x86] Install        : libhello-jni.so => libs/x86/libhello-jni.so
[x86_64] Compile        : hello-jni <= hello-jni.c
[x86_64] SharedLibrary  : libhello-jni.so
[x86_64] Install        : libhello-jni.so => libs/x86_64/libhello-jni.so

Java 사용 예제

package com.example.hellojni;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloJni extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_hello_jni);
        TextView tv = (TextView)findViewById(R.id.hello_textview);
        tv.setText( stringFromJNI() );
    }
 
    public native String  stringFromJNI();

    public native String  unimplementedStringFromJNI();

    static {
        System.loadLibrary("hello-jni");
    }
}

댓글을 달아 주세요

Raspberry Pi : 원격 데스크톱(xrdp) 설치

OS/Raspberry Pi 2021. 3. 7. 01:37 Posted by 파란크리스마스

원격 데스크톱(xrdp) 설치

pi@raspberrypi:~$ sudo apt install xrdp

KDE 설치

KDE 데스크탑 설치

pi@raspberrypi:~$ sudo apt -y install task-kde-desktop

KDE로 원격 데스크탑 실행시 설정

pi@raspberrypi:~$ cat  ~/.xsession

댓글을 달아 주세요

Tinker Board 2 : FFmpeg 컴파일, 설치

OS/Tinker Board 2021. 3. 6. 01:36 Posted by 파란크리스마스

출처

기존에 설치되어 있는 ffmpeg 삭제, ffmpeg 컴파일 관련 패키지 설치

linaro@linaro-alip:~$ sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
linaro@linaro-alip:~$ sudo apt-get update
linaro@linaro-alip:~$ sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev \
   libgpac-dev libopencore-amrnb-dev libopencore-amrwb-dev libspeex-dev \
   libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev

yasm 소스 다운로드, 컴파일

linaro@linaro-alip:~$ mkdir ~/workspace.ffmpeg 
linaro@linaro-alip:~$ cd ~/workspace.ffmpeg 
linaro@linaro-alip:~/workspace.ffmpeg$ wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
linaro@linaro-alip:~/workspace.ffmpeg$ tar xvfz yasm-1.3.0.tar.gz
linaro@linaro-alip:~/workspace.ffmpeg$ cd yasm-1.3.0/
linaro@linaro-alip:~/workspace.ffmpeg/yasm-1.3.0$ ./configure
linaro@linaro-alip:~/workspace.ffmpeg/yasm-1.3.0$ grep -c processor /proc/cpuinfo
6
linaro@linaro-alip:~/workspace.ffmpeg/yasm-1.3.0$ make -j6
linaro@linaro-alip:~/workspace.ffmpeg/yasm-1.3.0$ sudo make install

lame 소스 다운로드, 컴파일

linaro@linaro-alip:~/workspace.ffmpeg/yasm-1.3.0$ cd ~/workspace.ffmpeg
linaro@linaro-alip:~/workspace.ffmpeg$ wget http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
linaro@linaro-alip:~/workspace.ffmpeg$ tar xzvf lame-3.100.tar.gz && cd lame-3.100
linaro@linaro-alip:~/workspace.ffmpeg/lame-3.100$ ./configure && make -j6
linaro@linaro-alip:~/workspace.ffmpeg/lame-3.100$ sudo make install

faac 소스 다운로드, 컴파일 (ffmpeg가 최신버전의 경우 불필요한 라이브러리)

linaro@linaro-alip:~/workspace.ffmpeg/lame-3.100$ cd ~/workspace.ffmpeg
linaro@linaro-alip:~/workspace.ffmpeg$ wget https://sourceforge.net/projects/faac/files/faac-src/faac-1.29/faac-1.29.9.2.tar.gz 
linaro@linaro-alip:~/workspace.ffmpeg$ tar xzvf faac-1.29.9.2.tar.gz && cd faac-1.29.9.2
linaro@linaro-alip:~/workspace.ffmpeg/faac-1.29.9.2$ ./configure && make -j6
linaro@linaro-alip:~/workspace.ffmpeg/faac-1.29.9.2$ sudo make install

fdk-aac 소스 다운로드, 컴파일

linaro@linaro-alip:~/workspace.ffmpeg/faac-1.29.9.2$ cd ~/workspace.ffmpeg
linaro@linaro-alip:~/workspace.ffmpeg$ git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
linaro@linaro-alip:~/workspace.ffmpeg$ cd fdk-aac/
linaro@linaro-alip:~/workspace.ffmpeg/fdk-aac$ autoreconf -fiv
linaro@linaro-alip:~/workspace.ffmpeg/fdk-aac$ ./configure --disable-shared
linaro@linaro-alip:~/workspace.ffmpeg/fdk-aac$ make -j6
linaro@linaro-alip:~/workspace.ffmpeg/fdk-aac$ sudo make install

H264 소스 다운로드, 컴파일

linaro@linaro-alip:~/workspace.ffmpeg/fdk-aac$ cd ~/workspace.ffmpeg
linaro@linaro-alip:~/workspace.ffmpeg$ git clone https://code.videolan.org/videolan/x264.git
linaro@linaro-alip:~/workspace.ffmpeg$ cd x264
linaro@linaro-alip:~/workspace.ffmpeg/x264$ ./configure --enable-static
linaro@linaro-alip:~/workspace.ffmpeg/x264$ make -j6
linaro@linaro-alip:~/workspace.ffmpeg/x264$ sudo make install

ffmpeg 소스 다운로드, 컴파일

linaro@linaro-alip:~/workspace.ffmpeg/x264$ cd ~/workspace.ffmpeg 
linaro@linaro-alip:~/workspace.ffmpeg$ git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
linaro@linaro-alip:~/workspace.ffmpeg$ cd ffmpeg
linaro@linaro-alip:~/workspace.ffmpeg/ffmpeg$ git log
commit 77ce903f7ad2619fb3f420fd3e7f7b778dcb7704
Author: James Almer <jamrial@gmail.com>
Date:   Wed Mar 3 18:05:15 2021 -0300
linaro@linaro-alip:~/workspace.ffmpeg/ffmpeg$ ./configure --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfdk-aac \
  --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora \
  --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags="-latomic" 
linaro@linaro-alip:~/workspace.ffmpeg/ffmpeg$ make -j6
linaro@linaro-alip:~/workspace.ffmpeg/ffmpeg$ sudo make install

ffmpeg 설치 버전 확인

linaro@linaro-alip:~/workspace.ffmpeg/ffmpeg$ ffmpeg -version
ffmpeg version N-101386-g77ce903f7a Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags=-latomic
libavutil      56. 66.100 / 56. 66.100
libavcodec     58.128.100 / 58.128.100
libavformat    58. 70.100 / 58. 70.100
libavdevice    58. 12.100 / 58. 12.100
libavfilter     7.107.100 /  7.107.100
libswscale      5.  8.100 /  5.  8.100
libswresample   3.  8.100 /  3.  8.100
libpostproc    55.  8.100 / 55.  8.100

댓글을 달아 주세요

Tinker Board 2 : RASPBERRY PI CAMERA V2.1

OS/Tinker Board 2021. 3. 6. 01:21 Posted by 파란크리스마스

출처

Tinker Board 2 : Camera

카메라 모듈 확인

linaro@linaro-alip:~$ dmesg | grep video
[    1.147528] Linux video capture interface: v2.00
[    3.711002] usbcore: registered new interface driver uvcvideo

카메라 모듈 확인

linaro@linaro-alip:~$ v4l2-ctl -V
Format Video Capture Multiplanar:
        Width/Height      : 1920/1080
        Pixel Format      : 'YUYV'
        Field             : None
        Number of planes  : 1
        Flags             : 
        Colorspace        : Default
        Transfer Function : Default
        YCbCr Encoding    : Default
        Quantization      : Full Range
        Plane 0           :
           Bytes per Line : 3840
           Size Image     : 4147200

카메라 모듈 확인

linaro@linaro-alip:~$ media-ctl -p
Media controller API version 0.1.0
 
Media device information
------------------------
driver          rkisp1
model           rkisp1
serial          
bus info        
hw revision     0x0
driver version  0.0.0
 
Device topology
- entity 1: rkisp1-isp-subdev (4 pads, 6 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Sink
                [fmt:SRGGB10_1X10/1920x1080 field:none
                 crop.bounds:(0,0)/1920x1080
                 crop:(0,0)/1920x1080]
                <- "rkisp1_dmapath":0 []
                <- "rockchip-mipi-dphy-rx":1 [ENABLED]
        pad1: Sink
                <- "rkisp1-input-params":0 [ENABLED]
        pad2: Source
                [fmt:YUYV8_2X8/1920x1080 field:none
                 crop.bounds:(0,0)/1920x1080
                 crop:(0,0)/1920x1080]
                -> "rkisp1_selfpath":0 [ENABLED]
                -> "rkisp1_mainpath":0 [ENABLED]
        pad3: Source
                -> "rkisp1-statistics":0 [ENABLED]
 
- entity 2: rkisp1_mainpath (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "rkisp1-isp-subdev":2 [ENABLED]
 
- entity 3: rkisp1_selfpath (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
        pad0: Sink
                <- "rkisp1-isp-subdev":2 [ENABLED]
 
- entity 4: rkisp1_dmapath (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video2
        pad0: Source
                -> "rkisp1-isp-subdev":0 []
 
- entity 5: rkisp1-statistics (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video3
        pad0: Sink
                <- "rkisp1-isp-subdev":3 [ENABLED]
 
- entity 6: rkisp1-input-params (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video4
        pad0: Source
                -> "rkisp1-isp-subdev":1 [ENABLED]
 
- entity 7: rockchip-mipi-dphy-rx (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        pad0: Sink
                [fmt:SRGGB10_1X10/1920x1080 field:none]
                <- "m00_b_imx219 1-0010":0 [ENABLED]
        pad1: Source
                [fmt:SRGGB10_1X10/1920x1080 field:none]
                -> "rkisp1-isp-subdev":0 [ENABLED]
 
- entity 8: m00_b_imx219 1-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
        pad0: Source
                [fmt:SRGGB10_1X10/1920x1080 field:none]
                -> "rockchip-mipi-dphy-rx":0 [ENABLED]

Image sensors at the i2c ports 1 & 2

linaro@linaro-alip:~$ ls -l /sys/class/video4linux/
total 0
lrwxrwxrwx 1 root root 0 Nov  3  2016 v4l-subdev0 -> ../../devices/platform/ff910000.rkisp1/video4linux/v4l-subdev0
lrwxrwxrwx 1 root root 0 Nov  3  2016 v4l-subdev1 -> ../../devices/platform/ff910000.rkisp1/video4linux/v4l-subdev1
lrwxrwxrwx 1 root root 0 Nov  3  2016 v4l-subdev2 -> ../../devices/platform/ff910000.rkisp1/video4linux/v4l-subdev2
lrwxrwxrwx 1 root root 0 Nov  3  2016 video0 -> ../../devices/platform/ff910000.rkisp1/video4linux/video0
lrwxrwxrwx 1 root root 0 Nov  3  2016 video1 -> ../../devices/platform/ff910000.rkisp1/video4linux/video1
lrwxrwxrwx 1 root root 0 Nov  3  2016 video2 -> ../../devices/platform/ff910000.rkisp1/video4linux/video2
lrwxrwxrwx 1 root root 0 Nov  3  2016 video3 -> ../../devices/platform/ff910000.rkisp1/video4linux/video3
lrwxrwxrwx 1 root root 0 Nov  3  2016 video4 -> ../../devices/platform/ff910000.rkisp1/video4linux/video4

테스트

linaro@linaro-alip:~$ gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=100 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! videoconvert ! rkximagesink

 

댓글을 달아 주세요

Tinker Board 2

OS/Tinker Board 2021. 3. 4. 00:35 Posted by 파란크리스마스

출처

ASUS Tinker Board 2

ASUS Tinker Board 2 스펙 ( 출처 : ASUS Tinker Board 2 : VIP@youyeetoo.com)

기본 사용자, 암호

linaro / linaro

리눅스 정보 확인

CPU 정보 확인

linaro@linaro-alip:~$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
... 생략 ...
 
processor       : 5
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 2
 
Serial          : 1adae4c508fdff72

instruction set architecture (ISA)

linaro@linaro-alip:~$ uname -m
aarch64

커널에 대한 정보

linaro@linaro-alip:~$ uname -a
Linux linaro-alip 4.4.194 #25 SMP Wed Jan 13 07:02:28 UTC 2021 aarch64 GNU/Linux

OS버전에 대한 정보

linaro@linaro-alip:~$ cat /etc/issue
Debian GNU/Linux 9 \n \l

리눅스 배포판 버전 확인

linaro@linaro-alip:~$ grep . /etc/*-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

논리 코어 수 확인

linaro@linaro-alip:~$ grep -c processor /proc/cpuinfo
6

IP 확인

linaro@linaro-alip:~$ ip addr

Pythone 버전 확인

linaro@linaro-alip:~$ python --version
Python 2.7.13
linaro@linaro-alip:~$ python3 --version
Python 3.5.3

GPIO 확인

linaro@linaro-alip:~$ gpio readall
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |  73 |   8 | GPIO2B1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |  74 |   9 | GPIO2B2 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   8 |   7 | CLKOUT2 |  CLK | 0 |  7 || 8  | 1 | IN   | GPIO2C1 | 15  | 81  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | GPIO2C0 | 16  | 80  |
 |  83 |   0 | GPIO2C3 |   IN | 1 | 11 || 12 | 0 | IN   | GPIO3D0 | 1   | 120 |
 |  85 |   2 | GPIO2C5 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  84 |   3 | GPIO2C4 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO2C6 | 4   | 86  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO2C7 | 5   | 87  |
 |  40 |  12 | GPIO1B0 |   IN | 1 | 19 || 20 |   |      | 0v      |     |     |
 |  39 |  13 | GPIO1A7 |   IN | 1 | 21 || 22 | 0 | IN   | GPIO3D4 | 6   | 124 |
 |  41 |  14 | GPIO1B1 |   IN | 1 | 23 || 24 | 1 | IN   | GPIO1B2 | 10  | 42  |
 |     |     |      0v |      |   | 25 || 26 | 0 | IN   | GPIO0A6 | 11  | 6   |
 |  71 |  30 | GPIO2A7 |   IN | 1 | 27 || 28 | 1 | IN   | GPIO2B0 | 31  | 72  |
 | 126 |  21 | GPIO3D6 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |
 | 125 |  22 | GPIO3D5 |   IN | 0 | 31 || 32 | 0 | IN   | GPIO4C2 | 26  | 146 |
 | 150 |  23 | GPIO4C6 |  OUT | 1 | 33 || 34 |   |      | 0v      |     |     |
 | 121 |  24 | GPIO3D1 |   IN | 0 | 35 || 36 | 1 | IN   | GPIO2C2 | 27  | 82  |
 | 149 |  25 | GPIO4C5 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO3D3 | 28  | 123 |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO3D7 | 29  | 127 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+

댓글을 달아 주세요

NanoPi M4V2 : GStreamer HLS 스트리밍 서버 구축

OS/NanoPi 2021. 3. 1. 15:32 Posted by 파란크리스마스

출처

임시 디렉토리 생성

GStreamer HLS 관련 임시 파일 생성을 위한 디렉토리 생성합니다.

pi@NanoPi-M4v2:~$ mkdir hlstest

GStreamer 실행

playlist-root 옵션은 playlist.m3u8 파일 내 호출 주소를 전달 하기 위해서 외부 플레이어에서 접근 가능한 주소를 설정하고, location 옵션은 hls 관련 파일이 생성될 임시 작업 폴더를 지정합니다.

pi@NanoPi-M4v2:~$ gst-launch-1.0 rkisp device=/dev/video1 io-mode=4 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 \
  ! videoconvert ! clockoverlay ! x264enc tune=zerolatency ! mpegtsmux \
  ! hlssink playlist-root=http://192.168.0.5:8080 location=/home/pi/hlstest/segment_%05d.ts target-duration=5 max-files=5
Setting pipeline to PAUSED ...
media get entity by name: lens is null
XCAM ERROR v4l2_device.cpp:254: VIDIOC_QUERYCAP returned: -1 (Inappropriate ioctl for device)
XCAM ERROR v4l2_device.cpp:254: VIDIOC_QUERYCAP returned: -1 (Inappropriate ioctl for device)
XCAM ERROR rkisp_control_loop_impl.cpp:99: failed to get camera module info
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
XCAM ERROR rkisp_device.cpp:72: atomisp device(/dev/video1) try subdev format failed
Redistribute latency...
 
(gst-launch-1.0:2254): GStreamer-CRITICAL **: 09:06:59.673: gst_object_unref: assertion 'object != NULL' failed

윕서버 실행

HLS는 웹 스트리밍 프로토콜로 웹서버를 통해서 스트리밍 관련 파일을 전달하는데 GStreamer는 웹서버 기능이 없어서 python으로 웹서버를 이용하게 됩니다. 웹서비스 root 디렉토리로 이동하고 간이 웹서버를 실행합니다.

pi@NanoPi-M4v2:~$ cd hlstest/
pi@NanoPi-M4v2:~/hlstest$ python --version
Python 2.7.17
pi@NanoPi-M4v2:~/hlstest$ python -m SimpleHTTPServer 8080
Serving HTTP on 0.0.0.0 port 8080 ...

hls 주소

http://192.168.0.5:8080/playlist.m3u8

hls 재생

임시 디렉토리 목록 조회

pi@NanoPi-M4v2:~/hlstest$ ls 
playlist.m3u8 segment_00180.ts segment_00181.ts segment_00182.ts segment_00183.ts segment_00184.ts

댓글을 달아 주세요

Raspberry Pi : GStreamer RTSP Server 설치

OS/Raspberry Pi 2021. 2. 27. 22:07 Posted by 파란크리스마스

출처

GStreamer 기본 패키지 설치

pi@raspberrypi:~$ sudo apt-get install gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools libgstreamer1.0-dev libgstreamer1.0-0-dbg libgstreamer1.0-0 libgstreamer-plugins-base1.0-dev gtk-doc-tools

GStreamer Camera Source 설치

소스 다운로드

pi@raspberrypi:~$ git clone https://github.com/thaytan/gst-rpicamsrc.git
pi@raspberrypi:~$ cd gst-rpicamsrc

빌드

pi@raspberrypi:~/gst-rpicamsrc$ ./autogen.sh
pi@raspberrypi:~/gst-rpicamsrc$ make

설치

pi@raspberrypi:~/gst-rpicamsrc$ sudo make install
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/arm-linux-gnueabihf/gstreamer-1.0
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

테스트

pi@raspberrypi:~$ gst-inspect-1.0 | grep rpicamsrc
rpicamsrc:  rpicamsrcdeviceprovider (GstDeviceProviderFactory)
rpicamsrc:  rpicamsrc: Raspberry Pi Camera Source

GStreamer RTSP Server 설치

소스 다운로드

pi@raspberrypi:~$ git clone git://anongit.freedesktop.org/gstreamer/gst-rtsp-server
pi@raspberrypi:~$ cd gst-rtsp-server
pi@raspberrypi:~/gst-rtsp-server$ git checkout 1.12.5

빌드

pi@raspberrypi:~/gst-rtsp-server$ sudo apt install meson
pi@raspberrypi:~/gst-rtsp-server$ meson buil
The Meson build system
Version: 0.52.1
Source dir: /home/pi/gst-rtsp-server
Build dir: /home/pi/gst-rtsp-server/buil
Build type: native build
Project name: gst-rtsp-server
Project version: 1.12.5
C compiler for the host machine: cc (gcc 8.3.0 "cc (Raspbian 8.3.0-6+rpi1) 8.3.0")
C linker for the host machine: GNU ld.bfd 2.31.1
Host machine cpu family: arm
Host machine cpu: armv7l
Configuring config.h using configuration
Found pkg-config: /usr/bin/pkg-config (0.29)
Run-time dependency glib-2.0 found: YES 2.58.3
Run-time dependency gstreamer-1.0 found: YES 1.14.4
Run-time dependency gstreamer-rtsp-1.0 found: YES 1.14.4
Run-time dependency gstreamer-rtp-1.0 found: YES 1.14.4
Run-time dependency gstreamer-sdp-1.0 found: YES 1.14.4
Run-time dependency gstreamer-app-1.0 found: YES 1.14.4
Run-time dependency gstreamer-net-1.0 found: YES 1.14.4
Program g-ir-scanner found: NO
Found CMake: /usr/bin/cmake (3.13.4)
Run-time dependency libcgroup found: NO (tried pkgconfig and cmake)
Configuring gstreamer-rtsp-server-1.0.pc using configuration
Configuring gstreamer-rtsp-server-1.0-uninstalled.pc using configuration
pkgconfig/meson.build:22: WARNING: The variable(s) 'srcdir' in the input file 'pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in' are not present in the given configuration data.
Build targets in project: 18
Found ninja-1.8.2 at /usr/bin/ninja

설치

pi@raspberrypi:~/gst-rpicamsrc$ sudo make install
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/arm-linux-gnueabihf/gstreamer-1.0
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'
pi@raspberrypi:~/gst-rtsp-server$ ./autogen.sh
 
Configuration
        Version                    : 1.12.5
        Source code location       : .
        Prefix                     : /usr/local
        Compiler                   : gcc
        CGroups example            : no

gst-rtsp-server configured. Type 'make' to build.

Now type 'make' to compile gst-rtsp-server.
pi@raspberrypi:~/gst-rtsp-server$ make

GStreamer RTSP Server 설치

pi@raspberrypi:~/gst-rtsp-server$ sudo make install
 
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib/gstreamer-1.0
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'
  
-- Installing ./html/GstRTSPAddressPool.html
-- Installing ./html/GstRTSPAuth.html
-- Installing ./html/GstRTSPClient.html
-- Installing ./html/GstRTSPContext.html
-- Installing ./html/GstRTSPMedia.html
-- Installing ./html/GstRTSPMediaFactory.html
-- Installing ./html/GstRTSPMediaFactoryURI.html
-- Installing ./html/GstRTSPMountPoints.html
-- Installing ./html/GstRTSPPermissions.html
-- Installing ./html/GstRTSPServer.html
-- Installing ./html/GstRTSPSession.html
-- Installing ./html/GstRTSPSessionMedia.html
-- Installing ./html/GstRTSPSessionPool.html
-- Installing ./html/GstRTSPStream.html
-- Installing ./html/GstRTSPStreamTransport.html
-- Installing ./html/GstRTSPThreadPool.html
-- Installing ./html/GstRTSPToken.html
-- Installing ./html/annotation-glossary.html
-- Installing ./html/api-index-full.html
-- Installing ./html/ch01.html
-- Installing ./html/gst-rtsp-server-GstRTSPParams.html
-- Installing ./html/gst-rtsp-server-GstRTSPSdp.html
-- Installing ./html/index.html
-- Installing ./html/rtsp-server-hierarchy.html
-- Installing ./html/home.png
-- Installing ./html/left-insensitive.png
-- Installing ./html/left.png
-- Installing ./html/right-insensitive.png
-- Installing ./html/right.png
-- Installing ./html/up-insensitive.png
-- Installing ./html/up.png
-- Installing ./html/style.css
-- Installing ./html/gst-rtsp-server-1.0.devhelp2

RTSP Server 실행

pi@raspberrypi:~/gst-rtsp-server$ cd examples/
pi@raspberrypi:~/gst-rtsp-server/examples$ ./test-launch "( rpicamsrc preview=false bitrate=2000000 keyframe-interval=15 ! video/x-h264, framerate=15/1 ! h264parse ! rtph264pay name=pay0 pt=96 )"
stream ready at rtsp://127.0.0.1:8554/test

재생

Raspberry Pi Camera 정보 조희

pi@raspberrypi:~/gst-rtsp-server$ gst-inspect-1.0 rpicamsrc
Factory Details:
  Rank                     none (0)
  Long-name                Raspberry Pi Camera Source
  Klass                    Source/Video
  Description              Raspberry Pi camera module source
  Author                   Jan Schmidt <jan@centricular.com>
 
Plugin Details:
  Name                     rpicamsrc
  Description              Raspberry Pi Camera Source
  Filename                 /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstrpicamsrc.so
  Version                  1.0.0
  License                  LGPL
  Source module            gstrpicamsrc
  Binary package           GStreamer
  Origin URL               http://gstreamer.net/
 
GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstPushSrc
                               +----GstRpiCamSrc
 
Implemented Interfaces:
  GstColorBalance
  GstVideoDirection
  GstVideoOrientation
 
Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
          stream-format: byte-stream
              alignment: nal
                profile: { (string)constrained-baseline, (string)baseline, (string)main, (string)high }
      image/jpeg
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)RGB, (string)BGR, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
 
Element has no clocking capabilities.
Element has no URI handling capabilities.
 
Pads:
  SRC: 'src'
    Pad Template: 'src'
 
Element Properties:
  video-direction     : Video direction: rotation and flipping
                        flags: readable, writable, controllable
                        Enum "GstVideoOrientationMethod" Default: 0, "identity"
                           (0): identity         - GST_VIDEO_ORIENTATION_IDENTITY
                           (1): 90r              - GST_VIDEO_ORIENTATION_90R
                           (2): 180              - GST_VIDEO_ORIENTATION_180
                           (3): 90l              - GST_VIDEO_ORIENTATION_90L
                           (4): horiz            - GST_VIDEO_ORIENTATION_HORIZ
                           (5): vert             - GST_VIDEO_ORIENTATION_VERT
                           (6): ul-lr            - GST_VIDEO_ORIENTATION_UL_LR
                           (7): ur-ll            - GST_VIDEO_ORIENTATION_UR_LL
                           (8): auto             - GST_VIDEO_ORIENTATION_AUTO
                           (9): custom           - GST_VIDEO_ORIENTATION_CUSTOM
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "rpicamsrc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  blocksize           : Size in bytes to read per buffer (-1 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  num-buffers         : Number of buffers to output before sending EOS (-1 = unlimited)
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  typefind            : Run typefind before negotiating (deprecated, non-functional)
                        flags: readable, writable, deprecated
                        Boolean. Default: false
  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: true
  camera-number       : Which camera to use on a multi-camera system - 0 or 1
                        flags: readable, writable
                        Integer. Range: 0 - 1 Default: 0 
  bitrate             : Bitrate for encoding. 0 for VBR using quantisation-parameter
                        flags: readable, writable
                        Integer. Range: 0 - 25000000 Default: 17000000 
  keyframe-interval   : Interval (in frames) between I frames. -1 = automatic, 0 = single-keyframe
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  preview             : Display preview window overlay
                        flags: readable, writable
                        Boolean. Default: true
  preview-encoded     : Display encoder output in the preview
                        flags: readable, writable
                        Boolean. Default: true
  preview-opacity     : Opacity to use for the preview window
                        flags: readable, writable
                        Integer. Range: 0 - 255 Default: 255 
  preview-x           : Start X coordinate of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 0 
  preview-y           : Start Y coordinate of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 0 
  preview-w           : Width of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 1024 
  preview-h           : Height of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 768 
  fullscreen          : Display preview window full screen
                        flags: readable, writable
                        Boolean. Default: true
  sharpness           : Image capture sharpness
                        flags: readable, writable
                        Integer. Range: -100 - 100 Default: 0 
  contrast            : Image capture contrast
                        flags: readable, writable
                        Integer. Range: -100 - 100 Default: 0 
  brightness          : Image capture brightness
                        flags: readable, writable
                        Integer. Range: 0 - 100 Default: 50 
  saturation          : Image capture saturation
                        flags: readable, writable
                        Integer. Range: -100 - 100 Default: 0 
  iso                 : ISO value to use (0 = Auto)
                        flags: readable, writable
                        Integer. Range: 0 - 3200 Default: 0 
  video-stabilisation : Enable or disable video stabilisation
                        flags: readable, writable
                        Boolean. Default: false
  exposure-compensation: Exposure Value compensation
                        flags: readable, writable
                        Integer. Range: -10 - 10 Default: 0 
  exposure-mode       : Camera exposure mode to use
                        flags: readable, writable
                        Enum "GstRpiCamSrcExposureMode" Default: 1, "auto"
                           (0): off              - GST_RPI_CAM_SRC_EXPOSURE_MODE_OFF
                           (1): auto             - GST_RPI_CAM_SRC_EXPOSURE_MODE_AUTO
                           (2): night            - GST_RPI_CAM_SRC_EXPOSURE_MODE_NIGHT
                           (3): nightpreview     - GST_RPI_CAM_SRC_EXPOSURE_MODE_NIGHTPREVIEW
                           (4): backlight        - GST_RPI_CAM_SRC_EXPOSURE_MODE_BACKLIGHT
                           (5): spotlight        - GST_RPI_CAM_SRC_EXPOSURE_MODE_SPOTLIGHT
                           (6): sports           - GST_RPI_CAM_SRC_EXPOSURE_MODE_SPORTS
                           (7): snow             - GST_RPI_CAM_SRC_EXPOSURE_MODE_SNOW
                           (8): beach            - GST_RPI_CAM_SRC_EXPOSURE_MODE_BEACH
                           (9): verylong         - GST_RPI_CAM_SRC_EXPOSURE_MODE_VERYLONG
                           (10): fixedfps         - GST_RPI_CAM_SRC_EXPOSURE_MODE_FIXEDFPS
                           (11): antishake        - GST_RPI_CAM_SRC_EXPOSURE_MODE_ANTISHAKE
                           (12): fireworks        - GST_RPI_CAM_SRC_EXPOSURE_MODE_FIREWORKS
  metering-mode       : Camera exposure metering mode to use
                        flags: readable, writable
                        Enum "GstRpiCamSrcExposureMeteringMode" Default: 0, "average"
                           (0): average          - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_AVERAGE
                           (1): spot             - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_SPOT
                           (2): backlist         - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_BACKLIST
                           (3): matrix           - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_MATRIX
  awb-mode            : White Balance mode
                        flags: readable, writable
                        Enum "GstRpiCamSrcAWBMode" Default: 1, "auto"
                           (0): off              - GST_RPI_CAM_SRC_AWB_MODE_OFF
                           (1): auto             - GST_RPI_CAM_SRC_AWB_MODE_AUTO
                           (2): sunlight         - GST_RPI_CAM_SRC_AWB_MODE_SUNLIGHT
                           (3): cloudy           - GST_RPI_CAM_SRC_AWB_MODE_CLOUDY
                           (4): shade            - GST_RPI_CAM_SRC_AWB_MODE_SHADE
                           (5): tungsten         - GST_RPI_CAM_SRC_AWB_MODE_TUNGSTEN
                           (6): fluorescent      - GST_RPI_CAM_SRC_AWB_MODE_FLUORESCENT
                           (7): incandescent     - GST_RPI_CAM_SRC_AWB_MODE_INCANDESCENT
                           (8): flash            - GST_RPI_CAM_SRC_AWB_MODE_FLASH
                           (9): horizon          - GST_RPI_CAM_SRC_AWB_MODE_HORIZON
  awb-gain-red        : Manual AWB Gain for red channel when awb-mode=off
                        flags: readable, writable
                        Float. Range:               0 -               8 Default:               0 
  awb-gain-blue       : Manual AWB Gain for blue channel when awb-mode=off
                        flags: readable, writable
                        Float. Range:               0 -               8 Default:               0 
  image-effect        : Visual FX to apply to the image
                        flags: readable, writable
                        Enum "GstRpiCamSrcImageEffect" Default: 0, "none"
                           (0): none             - GST_RPI_CAM_SRC_IMAGEFX_NONE
                           (1): negative         - GST_RPI_CAM_SRC_IMAGEFX_NEGATIVE
                           (2): solarize         - GST_RPI_CAM_SRC_IMAGEFX_SOLARIZE
                           (3): posterize        - GST_RPI_CAM_SRC_IMAGEFX_POSTERIZE
                           (4): whiteboard       - GST_RPI_CAM_SRC_IMAGEFX_WHITEBOARD
                           (5): blackboard       - GST_RPI_CAM_SRC_IMAGEFX_BLACKBOARD
                           (6): sketch           - GST_RPI_CAM_SRC_IMAGEFX_SKETCH
                           (7): denoise          - GST_RPI_CAM_SRC_IMAGEFX_DENOISE
                           (8): emboss           - GST_RPI_CAM_SRC_IMAGEFX_EMBOSS
                           (9): oilpaint         - GST_RPI_CAM_SRC_IMAGEFX_OILPAINT
                           (10): hatch            - GST_RPI_CAM_SRC_IMAGEFX_HATCH
                           (11): gpen             - GST_RPI_CAM_SRC_IMAGEFX_GPEN
                           (12): pastel           - GST_RPI_CAM_SRC_IMAGEFX_PASTEL
                           (13): watercolour      - GST_RPI_CAM_SRC_IMAGEFX_WATERCOLOUR
                           (14): film             - GST_RPI_CAM_SRC_IMAGEFX_FILM
                           (15): blur             - GST_RPI_CAM_SRC_IMAGEFX_BLUR
                           (16): saturation       - GST_RPI_CAM_SRC_IMAGEFX_SATURATION
                           (17): colourswap       - GST_RPI_CAM_SRC_IMAGEFX_COLOURSWAP
                           (18): washedout        - GST_RPI_CAM_SRC_IMAGEFX_WASHEDOUT
                           (19): posterise        - GST_RPI_CAM_SRC_IMAGEFX_POSTERISE
                           (20): colourpoint      - GST_RPI_CAM_SRC_IMAGEFX_COLOURPOINT
                           (21): colourbalance    - GST_RPI_CAM_SRC_IMAGEFX_COLOURBALANCE
                           (22): cartoon          - GST_RPI_CAM_SRC_IMAGEFX_CARTOON
  rotation            : Rotate captured image (0, 90, 180, 270 degrees)
                        flags: readable, writable
                        Integer. Range: 0 - 270 Default: 0 
  hflip               : Flip capture horizontally
                        flags: readable, writable
                        Boolean. Default: false
  vflip               : Flip capture vertically
                        flags: readable, writable
                        Boolean. Default: false
  roi-x               : Normalised region-of-interest X coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               0 
  roi-y               : Normalised region-of-interest Y coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               0 
  roi-w               : Normalised region-of-interest W coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               1 
  roi-h               : Normalised region-of-interest H coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               1 
  quantisation-parameter: Set a Quantisation Parameter approx 10-40 with bitrate=0 for VBR encoding. 0 = off
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  inline-headers      : Set to TRUE to insert SPS/PPS before each IDR packet
                        flags: readable, writable
                        Boolean. Default: false
  shutter-speed       : Set a fixed shutter speed, in microseconds. (0 = Auto)
                        flags: readable, writable
                        Integer. Range: 0 - 6000000 Default: 0 
  sensor-mode         : Manually set the camera sensor mode
                        flags: readable, writable
                        Enum "GstRpiCamSrcSensorMode" Default: 0, "automatic"
                           (0): automatic        - Automatic
                           (1): 1920x1080        - 1920x1080 16:9 1-30fps
                           (2): 2592x1944-fast   - 2592x1944 4:3 1-15fps / 3240x2464 15fps w/ v.2 board
                           (3): 2592x1944-slow   - 2592x1944 4:3 0.1666-1fps / 3240x2464 15fps w/ v.2 board
                           (4): 1296x972         - 1296x972 4:3 1-42fps
                           (5): 1296x730         - 1296x730 16:9 1-49fps
                           (6): 640x480-slow     - 640x480 4:3 42.1-60fps
                           (7): 640x480-fast     - 640x480 4:3 60.1-90fps
  drc                 : Dynamic Range Control level
                        flags: readable, writable
                        Enum "GstRpiCamSrcDRCLevel" Default: 0, "off"
                           (0): off              - GST_RPI_CAM_SRC_DRC_LEVEL_OFF
                           (1): low              - GST_RPI_CAM_SRC_DRC_LEVEL_LOW
                           (2): medium           - GST_RPI_CAM_SRC_DRC_LEVEL_MEDIUM
                           (3): high             - GST_RPI_CAM_SRC_DRC_LEVEL_HIGH
  annotation-mode     : Flags to control annotation of the output video
                        flags: readable, writable
                        Flags "GstRpiCamSrcAnnotationMode" Default: 0x00000000, "(none)"
                           (0x00000001): custom-text      - GST_RPI_CAM_SRC_ANNOTATION_MODE_CUSTOM_TEXT
                           (0x00000002): text             - GST_RPI_CAM_SRC_ANNOTATION_MODE_TEXT
                           (0x00000004): date             - GST_RPI_CAM_SRC_ANNOTATION_MODE_DATE
                           (0x00000008): time             - GST_RPI_CAM_SRC_ANNOTATION_MODE_TIME
                           (0x00000010): shutter-settings - GST_RPI_CAM_SRC_ANNOTATION_MODE_SHUTTER_SETTINGS
                           (0x00000020): caf-settings     - GST_RPI_CAM_SRC_ANNOTATION_MODE_CAF_SETTINGS
                           (0x00000040): gain-settings    - GST_RPI_CAM_SRC_ANNOTATION_MODE_GAIN_SETTINGS
                           (0x00000080): lens-settings    - GST_RPI_CAM_SRC_ANNOTATION_MODE_LENS_SETTINGS
                           (0x00000100): motion-settings  - GST_RPI_CAM_SRC_ANNOTATION_MODE_MOTION_SETTINGS
                           (0x00000200): frame-number     - GST_RPI_CAM_SRC_ANNOTATION_MODE_FRAME_NUMBER
                           (0x00000400): black-background - GST_RPI_CAM_SRC_ANNOTATION_MODE_BLACK_BACKGROUND
  annotation-text     : Text string to annotate onto video when annotation-mode flags include 'custom-text'
                        flags: readable, writable
                        String. Default: ""
  annotation-text-size: Set the size of annotation text (in pixels) (0 = Auto)
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  annotation-text-colour: Set the annotation text colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  annotation-text-bg-colour: Set the annotation text background colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  intra-refresh-type  : Type of Intra Refresh to use, -1 to disable intra refresh
                        flags: readable, writable
                        Enum "GstRpiCamSrcIntraRefreshType" Default: -1, "none"
                           (-1): none             - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_NONE
                           (0): cyclic           - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_CYCLIC
                           (1): adaptive         - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_ADAPTIVE
                           (2): both             - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_BOTH
                           (2130706433): cyclic-rows      - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_CYCLIC_ROWS
  use-stc             : Use the camera STC for timestamping buffers
                        flags: readable, writable
                        Boolean. Default: true

댓글을 달아 주세요