1/22/2016

HDMI - TMDS Coding 과 Channel 구성

1. TMDS(Transition Minimized Differential Signaling)

TMDS(Transition Minimized Differential Signaling) Silicon Image에서 개발되어졌으며,
차분신호의 한 종류이며 영상과 음성 및 부가 데이터를 고속 전송을 위해서
HDMI와 DVI에서 현재 사용하고 있다.
차분신호는 일반적으로 고속신호에 이용이되며, Noise 문제에 있어 강점이 존재한다.

  https://en.wikipedia.org/wiki/Differential_signaling

1.1 TMDS Coding 

기본 Encoding 방식은 8b/10b encoding 기반으로 하지만, 2가지 절차 (2-Stage process)를 추가하여, 이를 보안하였다.

  • 1st Stage process 
  1. 8 bit input을 10 bit code와 함께  변경한다 
  2. 1st bit는 변경이 안되고, 각 다음 bit들은 XOR or XNOR 값을 선택 (이전 bit의 반대로 선택) 
  3. encoder는 XOR 와 XNOR 사이에서 가장 적은 변화를 하는 것을 선택하는 것을 지향
  4. 9st bit는 encode가 되며 이는 운영(operaton)에 사용된다. 

  • 2nd Stage Process
  https://en.wikipedia.org/wiki/8b/10b_encoding


참고사항
  https://en.wikipedia.org/wiki/Transition-minimized_differential_signaling
  https://ko.wikipedia.org/wiki/%EB%B3%80%ED%99%94_%EC%B5%9C%EC%86%8C%ED%99%94_%EC%B0%A8%EB%B6%84_%EC%8B%A0%ED%98%B8


1.2 TMDS Channel

TMDS를 보면, 구성이 Channel 3개와 Clock으로 구성이 되며, 이를 어떻게 사용하는지가 중요하다.

아래를 정확히 이해를 하려면, Transmitter Chip의 구성을 이해해야하며, Parallel Interface to Serial interface 역할을 HDMI가 한다고 생각하면된다.

만약 Video로 RGB로 보낸다고 한다면 이를 간단히 분석해보자

  1. Pixel Component (RGB) : 8 x 3 = 24 Pin
  2. H,VSYNC            : 2 Pin
  3. Pixel Clock         :  1 Pin  

만약 Auxiliary Data(Audio)가 추가된다면 아래의 Audio Pin 구성을 보면되겠다.




이번에는 SiI9022A의 Chip의 구성이며 상위와 비교해서 이를 보자.

  1. RGB D[0-23]  ( 상위가 RGB 구성이지만 RGB가 아닐수도 있다)
  2. HS, VS 
  3. IDCLK 


Audio 는 별도이다.

이제 Video의 SDTV 경우 로 720x480을 보낸다고 가정한다면, (858x525)
Vertical/horizontal Blanking Line에 의해 실제 영상이 보인다.
사실 경우에 따라 704로 변경 될수 도 있다.



위와 같은 Video Lin을 아래와 같이 다시 분석해보면 아래와 같다.
상위 CTL0~3PIN의 보자.


다시 좀더 자세히 Channel 0~3의 Pixel Component를  CTL Pin의 Data Type에 따라 자세히 분석해보자.

CTL Period : 상위 CTL Pin에 의해 Preamble이 결정이 되어 Data Period Type 결정


상위 실제 Pixel Data을 보내기 전에 Header와 Packet을 보낸다.
이 정보에 Audio 정보 및 Mpeg 관련정보 다른 Data가 들어간다. 이부분은 Spec을 보자.


1/17/2016

DM81xx Gstreamer-PlugIns (3rd Party PlugIn)

1. DM81xx 에서 제공하는 Gstream 기본구조  

TI에서 제공하는 3rd Party PlugIns들이며 이를 이해하기위해서는 DM81xx의 기본구조를 알아야한다.
DM81xx의 기본구조는 OMX (Open Max API)에 SysLink Driver에 연결이 되어 아래와 같이
Control 한다.
그리고, Frame buffer와 Video for Linux로 Display와 Video Capture를 Linux에서 진행을 한다.

아래와 같이 중요한 Video Encode와 Display에 관한 중요한 Driver들이다.
만약 Video Display를 LCD or HDMI를 할 경우에 따라 관련 Driver 역시 중요할 것이다.
  1. SYSLINK : HDVPSS와 HDVICP 및 DSP Interface 
  2. HDVPSS : Video Capture 와 Display 담당 
  3. HDVICP2 : HDVICP Version2 로  Video Encode와 Decode를 담당.



1.2 DISPLAY 선택 작업 

미리 VPSS의 DISPLAY를 정한다음에 Gstreamer를 이용하여 하는 것이 좋다.
물론 TI는 Gstreamer에서 DISPLAY 선택이 되는 것 같은데 완벽하지 않은 것 같다.

이 부분은 sys file를 이용하여 변경하며.
/etc/init.d/load-hd-firmware.sh  부분에서 초기에 다 설정을 한다.


  1. HDMI일 경우 dipsplay0을 사용 ( 이 부분 Datasheet 참고 DM814x) 
  2. LCD일 경우 display1을 사용 


$ echo 0 > /sys/devices/platform/vpss/display0/enabled 
$ echo 1080i-60 > /sys/devices/platform/vpss/display0/mode 
$ echo 1 > /sys/devices/platform/vpss/display0/enabled


1.3 DM81xx Gstream MPEG4 Decoding 기본예제



Gstream의 MPEG4 File의 Decoding 의 Pipeline을 보자.

  • 아래는 현재 HDMI로 MPEG4를 재생을 했다. 


$ gst-launch filesrc location= test1.mp4 ! qtdemux name=mux mux.video_00 ! queue  ! \
h264parse output-format=1 ! omx_h264dec ! omx_scaler !\ 
omx_ctrl display-mode=OMX_DC_MODE_1080P_30 ! omx_videosink enable-last-buffer=false



간단히 분석해보면,  (OMX는 SYSLINK를 통하여 HDVICP2 or HDVPSS로 연결된다)

  1. test1.mp4 읽어  qtdemux 에 전달 
  2. qtdemux에서 mov file을 구조를 분석하여 video 추출 하여 h264parse 전달 
  3. h264parse 이를 outformat을 설정 omx_h264dec전달 (HDVICP2) 
  4. omx_h264dec는 decoding을 한후 omx_scaler 전달 
  5. omx_scaler는 이를 화면을 resize하고 omx_ctrl에 전달. 
  6. omx_ctrl은 display모드 설정 ( LCD or HDMI 해상도) 하고 omx_videosink에 전달

아래의 사이트에서 TI에서 제공하는 3rd Party Plug-In의 Elements 자세히 알아보자.
중요하게 볼것이 Input과 output이다. 화면이 변경이 되기도 한다.

  http://wiki.tiprocessors.com/index.php/DM81xx_Gstreamer_Plugin
  http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Plugin

  일반적인 질문사항
  http://wiki.tiprocessors.com/index.php/DM81xx_Gstreamer_FAQ

  추가 확장된 Driver
  http://processors.wiki.ti.com/index.php/DM81xx_AM38xx_Adding_External_Decoders_to_V4L2_Capture_Driver


1.4 Gstreamer 기본 MPEG TS 예제 

DM81xx가 Booting 후 설정되어야 환경변수이지만, 현재 불필요한 것 같다.
gstreamer가 전체 /usr/bin으로 포함되어져 있어 불필요하다.
만약 분리되었을 경우 아래와 같은 주소로 있는지 확인하자

export GST_REGISTRY=/tmp/gst_registry.bin
export LD_LIBRARY_PATH=/opt/gstreamer/lib
export GST_PLUGIN_PATH=/opt/gstreamer/lib/gstreamer-0.10
export PATH=/opt/gstreamer/bin:$PATH
export GST_PLUGIN_SCANNER=/opt/gstreamer/libexec/gstreamer-0.10/gst-plugin-scanner =


  http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Pipelines

1.5 Gstreamer RTSP 적용 예제 

IP Camera 혹은 Settopbox라든지 다른 Device와 연동을 할 경우 많이 필요하다.
처음 VLC로 TEST를 하면 좋다.


  • RTSP Client로 사용할 경우 
  https://developer.ridgerun.com/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x


  • RTSP Server로 사용할 경우 
  https://developer.ridgerun.com/wiki/index.php/DM81xx_GStreamer_Pipelines_-_SDK_Turrialba


RTSP Default TEST

$ gst-launch rtspsrc location=rtsp://172.24.136.242:5544/test \
! rtph264depay ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false 


1.6 Gstreamer Video Crop and Scaling 예제 

조금 복잡한 기능이며, Scaling 즉 Resizing까지 지원이 되며, 이것을 이용하며,
4Channel Video Mux도 가능하다.

  https://developer.ridgerun.com/wiki/index.php/Video_crop_and_scaling_with_DM816x_and_DM814x

1/09/2016

Gstreamer 관련 Programing 및 관련문서

1. Gstreamer 기본 Programming 

Gstreamer는 Python는 물론이고, C로도 Programming 이 가능하다.
Programming 앞서 먼저 test를 해본 후, Programming을 하기 바란다.

  • Plugin 제작
   GStreamer Plugin Writer`s Guide 참고
  http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/pwg.pdf

  • Gstreamer Application programming 
어플리케이션 제작에 관한 Manual이며, 다시한번 언급하지만,5장과 8장 기본개념이므로
반드시 이해해야한다.

  GStreamer Application Development Manual 참고 :
  http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/manual.pdf
  http://blog.daum.net/basetechnology/6998023


  • GStreamer Base Plugins Libraries Reference
  Gstreamer Plugin library 관련 문서
  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/


2 Gstreamer 확장 Programing 

위는 간단히 Gstreamer에서 제공하는 Package를 이용하는 Programming이지만 이와 같이,
GTK or QT와 같이 사용하여 Programming도 가능하다.
물론 C로도 가능하겠지만, 복잡하여 Python을 주로 많이 사용하는 추세인 것 같다.

이곳에서는 GTK 및 QT관련 부분은 다룰수 는 없지만, 관련 Programming 알아둬야할 사항을 정리한다.

  1. 각 개별 Plugins들의 Elements 와 Plugin 들의 설명문서 (아래 설명) 
  2. Gstreamer와 Qt  or GTK 사용법 
  3. Gstreamer와 RTSP 사용법 

3 Gstreamer 관련문서 

  • 관련 Gstreamer 문서정보 (점점 확장되어가는 추세)
  https://gstreamer.freedesktop.org/documentation/

  •  Plugin 정보와 Element 정보 
  https://gstreamer.freedesktop.org/documentation/plugins.html
     

1/04/2016

Gstreamer 기본정보 (추후수정 및 정리필요)

1.   GSTREAMER 기본개념

Gstreamer 은 Pipeline기반의 Multimedia framework로 쉽게 Mulimedia를 PlugIn을 사용하여 쉽게 Control 하고 연결할수 있는 Framework이다.
각 SoC의 Chip Vender마다 요즘 거의 지원을 해주고 있으며, OpenMax도 지원을 해주고 있다.
더불어 PC에서도 지원을 해주고 있어 많이 사용되는 Multimedia Framework이다.



  • 기본구조 
기본구조는 각 PlugIn의 ElementPad(Source/Sink)로 연결되어있는 구조이며, 이를 전체 Pipeline 구조구성 혹은 Bin(작은 Pipeline) 구조로 분할구성이가능하다.



  1. Pipeline : Element 구조체를 가지고 있으며, Gstreamer 전체를 Control을 할때 사용 
  2. Bin : Element 구조체를 가지고 있으며, 작은단위로 Pipeline을 구성하고 동적으로 연결할때 사용하는 것 같음
  3. Element :  Pad를 가지고 있으며, 각 Element의 동작을 수행을 한다. 
  4. Pad:   Source or Sink 가 될 수 있으며, Element는 두개의 Sink도 가질수 있다.  
  5. Bus:  상위 그림에는 없지만, BUS라는 개념이 있어 이를 통신에 관련된다. 


  https://en.wikipedia.org/wiki/Filter_graph
https://gstreamer.freedesktop.org/documentation/application-development/introduction/basics.html?gi-language=c

  • Plug-Ins :  대부분의 Plug-in들은 shared library로 구현이 된다고 하며,
  • Modules:  Package 혹은 Plug-in Set이라고 하며 Plug-in의 상태에 따라 Good, bad, Ugly  구분이되며  설치 되어지는 Module에따라  지원되는 기능이 다르다.
  • Elements: 개별 Plug-In의 속성기능이며, 실제 동작되는 구조기능이다.

  https://en.wikipedia.org/wiki/GStreamer
  https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c

기본개념
  https://gstreamer.freedesktop.org/documentation/application-development/basics/index.html?gi-language=c

  • Gstreamer Modules (Package or Plug-in Set )
  1. gstreamer: the core package
  2. gst-plugins-base: an essential exemplary set of elements
  3. gst-plugins-good: a set of good-quality plug-ins under LGPL
  4. gst-plugins-ugly: a set of good-quality plug-ins that might pose distribution problems
  5. gst-plugins-bad: a set of plug-ins that need more quality
  6. gst-libav: a set of plug-ins that wrap libav for decoding and encoding

  https://gstreamer.freedesktop.org/modules/


좀더 자세한 plug-in은 Modules 살펴보au plugins-good, ugly,bad version으로 나누어지며,good을 제외한 version 개발 version   

  https://gstreamer.freedesktop.org/documentation

Gstreamer Example
  1. gst_pipeline_new : piple line 생성 (Element)
  2. gst_element_factory_make: Gstreamer Element
  3. g_object_set : Element 의 Properties 
  4. gst_bin_add or gst_bin_add_many :  Pipeline에 Element 등록 
  5. gst_element_link or gst_element_link_many : Element 사이의 연결 
  6. gst_pipeline_get_bus  or  gst_element_get_bus :  Pipe line의 bus 정보 
  7. gst_bus_add_watch : Pipeline의 Bus Callback 함수등록하여 이를 감시 
  8. gst_element_get_request_pad or gst_element_get_static_pad :  Pad information 
  9. gst_pad_link : 얻은 Pad로 링크도 가능 
  https://gstreamer.freedesktop.org/documentation/tutorials/basic/multithreading-and-pad-availability.html?gi-language=c

동적 파이프라인 구성
gst_element_link 대신 pad_link를 사용하여 직접연결
  https://yujuwon.tistory.com/entry/%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8-%EC%83%81%ED%83%9C-%ED%99%95%EC%9D%B8
  https://gstreamer.freedesktop.org/documentation/application-development/basics/pads.html?gi-language=c#dynamic-or-sometimes-pads

고스트 패트
  https://yujuwon.tistory.com/entry/Ghost-pads-1
  https://gstreamer.freedesktop.org/documentation/application-development/basics/pads.html?gi-language=c#ghost-pads


API Reference
  https://gstreamer.freedesktop.org/documentation/libs.html?gi-language=c

Core Library

GstPlugin
  https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html?gi-language=c

GstElement
  https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c

GstPipeline
  https://gstreamer.freedesktop.org/documentation/gstreamer/gstpipeline.html?gi-language=c

GstBin
  https://gstreamer.freedesktop.org/documentation/gstreamer/gstbin.html?gi-language=c#GstBin

GstBus
  https://gstreamer.freedesktop.org/documentation/gstreamer/gstbus.html?gi-language=c

GstPad
  https://gstreamer.freedesktop.org/documentation/gstreamer/gstpad.html?gi-language=c

GstMeta
  https://gstreamer.freedesktop.org/documentation/gstreamer/gstmeta.html?gi-language=c


1.1 GSTREAMER 전체구성

Gstreamer는  기존에 독립적으로 존재하던 존재였던 Device Driver및 Interface를 연결해주는 매개체 일뿐이다.

이는 Plug-In인 Video와 Audio, Display , Protocol, Parser 등을 제공하여 연결을 손쉽게 해주어 사용이 손쉽게 동작이 되게하고,
유저들에게 간편한 Interace를 제공하여, Programming 손쉽게 하도록 도와준다.

Plug-In들은 본인이 설치한 Package에 따라 지원이 되는것이 달라질 것이다.



  • 기본구성 Plug-Ins
기본적으로 존재하는 Plug-In들이 존재하며, 위의 demux부분 이부분은 별도로 다시 공부를 해봐야 겠다.


중요 아래에서 Plug-In을 쉽게 검색가능
  https://gstreamer.freedesktop.org/documentation/plugins.html

  • 3rd Party Plugins 
임베디드로 오게될 경우 성능이 좋은 SOC에서 Software Codec를 사용하면 별문제 없겠지만, (FFMPEG)
보통 Chip Vender에서 제공하는 Chip 의존적인 API를 사용하게 되어지는데, 거의 Video/Audio/Codec 부분은 OpenMax 통일이 되어가는 추세이며,
Display 역시 개별 Soc에 맞게 추가되어 있으므로 관련부분은 Chip Vendor의  Gstreamer의 Manual을 반드시 읽어야 한다.

  아래 사이트에서 확인하자
  https://www.freedesktop.org/wiki/GstOpenMAX/

참고로 OpenMax를 사용한다고하여, 꼭 Hardware Codec를 사용하라는 법은 없으며, FFMPEG을 이용하여 SoftCodec도 사용가능하다.

1.2 GSTREAM 기본 동작 구조
기본구성은 Pipeline으로 구성이 되며, 이는 plug-in의 elements의  Source 와 Sink 로 연결이 되어 함께 데이타를 주고 받으며 동작한다.

  1. Bin/Pipeline : 둘다 GstElement 이며,  Element(Plug-in) 관리를 쉽게하기위해서 시작 포인트
  2. Element : Plug-in에 구성인자이며, Pad (source or sink)를 이용하여 Data를 통신한다. 
  3. Pad (Source): Element에서 Ouput 이며, 이를 다른 Element와 연결  Data out
  4. Pad (Sink): Element의 Input으로 시작 or 다른 Element와 연결되어 Data 입력


  https://gstreamer.freedesktop.org/documentation/application-development/introduction/basics.html?gi-language=c

  https://gstreamer.freedesktop.org/documentation/application-development/basics/elements.html?gi-language=c

  https://gstreamer.freedesktop.org/documentation/gstreamer/gstmeta.html?gi-language=c#GstMeta

  • Callback Function 
  1. Pad에  gst_pad_add_probe 를 이용하여 Callback Function 추가 가능 


  • GSTREAM Pipeline Audio 구성예제
      위를 간단히 분석하면, 
  1. File을 Read해서 읽어 Ogg-demuxer 전달
  2. Ogg-demuxer는 Audio Codec인 Vorbis Codec을 Vorbis-decoder에 전달.
  3. Vorbis-decoder는 이를 Converter에 전달 ( 이부분은 Why?)
  4. 최종적으로 Audio 출력   

  출처:
  이문서를 한번는 읽어봐야 할것 같다.
  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/manual.pdf 



1.3 GSTREAMER 기본 정보


  • GSTREAMER SITE 
  http://gstreamer.freedesktop.org/
  https://wiki.freedesktop.org/gstreamer/
   

  https://gstreamer.freedesktop.org/documentation/tutorials/basic/index.html?gi-language=c

  https://gstreamer.freedesktop.org/documentation/plugin-development/index.html?gi-language=c

2. Element 구현


GObjectClass
GstBaseSinkClass


  https://gstreamer.freedesktop.org/documentation/plugin-development/index.html?gi-language=c
  https://gstreamer.freedesktop.org/documentation/plugin-development/element-types/index.html?gi-language=c


3. PC GSTREAMER  

PC에서 설치는 자신의 환경에따라 설치하자.

3.1 Ubuntu 최신버전 설치 


  http://gstreamer.freedesktop.org/wiki/BuildDependenciesDebianUbuntu/
  https://wiki.freedesktop.org/gstreamer/BuildDependenciesDebianUbuntu/


sudo apt-get build-dep gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad
sudo apt-get install cvs
sudo apt-get build-dep gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad-multiverse
sudo apt-get install pkg-config libglib2.0-dev liborc-0.4-dev bison flex
sudo apt-get install libglew1.5-dev libpng12-dev



아직 미확인
  http://egloos.zum.com/seoz/v/4002136
  http://peterhouse.tistory.com/29
  http://askubuntu.com/questions/517910/installing-can-i-install-gstreamer-1-4-on-ubuntu-14-04


3.2 Ubuntu 기본 Version 설치 

기본설치방법 본인 버전에 따라 설치하자.

  • Ubuntu에 GSTREAMER 설치 (12.04)
 
$ sudo apt-get install gstreamer-tools            //처음 gstreamer 없을 경우 설치하자.

//**** option 
$ sudo gst-install                                // source를 down 받아 설치하는데 제대로 
                                                  // 동작되는 경우가 있고 안될 경우가 있다. ubunt 12.04 실패


$ sudo apt-get install gstreamer0.10-plugins-good // 이미 설치됨
$ sudo apt-get install gstreamer0.10-plugins-bad  // 본인이 필요한  plug-in
$ sudo apt-get install gstreamer0.10-plugins-ugly // 본인이 필요한  plug-in 

sudo apt-get install gstreamer0.10-ffmpeg


  • DM8127 IPNC TEST (Failed)

gst-launch rtspsrc location=rtsp://192.168.1.168:8556/PSIA/Streaming/channels/2?videoCodecType=H.264  ! queue ! \
rtph264depay ! queue ! ffdec_h264 ! xvimagesink sync=false -v

CAPS=application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,\
sprop-parameter-sets=(string)\"J0KAKouVAoPy\\,KN4BriA\\=\",payload=(int)96,ssrc=951364645,\
clock-base=2084568768,seqnum-base=10992

CAPS=application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=(int)96


gst-launch rtspsrc location=rtsp://192.168.1.168:8556/PSIA/Streaming/channels/2?videoCodecType=H.264  ! $CAPS ! queue ! \
rtph264depay ! queue ! ffdec_h264 ! ximagesink sync=false -v


  • Ubuntu TEST 

gst-launch-0.10 videotestsrc ! xvimagesink sync=false -v

only working.....
gst-launch-0.10 videotestsrc ! ximagesink sync=false -v



  https://developer.ridgerun.com/wiki/index.php?title=DM81xx_GStreamer_Pipelines_-_SDK_2011Q2


4. GSTREAMER의 기본사용법


4.1 Gstreamer Plug-In 및 Element 확인

  • plug-in 설치 확인 및 사용법 확인 (gst-inspect)
현재 설치된 plug-in을 확인을 가능하며, 이를 이용하여 현재 사용가능한 plug-in을 설정 할수 있다.
- gst-inspect : print info about a GStreamer plugin or element

$ gst-inspect             // 설치된 plug-in or element 확인 
vp8:  vp8enc: On2 VP8 Encoder                   //plugin : element     
mimic:  mimenc: Mimic Encoder
mimic:  mimdec: Mimic Decoder
speed:  speed: Speed
****
videotestsrc:  videotestsrc: Video test source  //plugin : element 

$ gst-inspect audiotestsrc              // audiotestsrc plug-in 세부 속성 및 기타 확인 
$ gst-inspect videotestsrc              // videotestsrc plug-in 세부 속성 및 기타 확인                                     

$ gst-inspect |grep 264                          (Host에서 H264관련 검색, 설치확인)
x264:  x264enc: x264enc                   // gstreamer0.10-plugins-ugly 설치시 확인가능
rtp:  rtph264depay: RTP H264 depayloader
rtp:  rtph264pay: RTP H264 payloader
typefindfunctions: video/x-h264: h264, x264, 264

  http://docs.gstreamer.com/display/GstSDK/gst-inspect


4.2 GSTREAMER PLUG-INS 사용방법확인 

  https://gstreamer.freedesktop.org/documentation/plugins.html

      gst-inspect로 설치된것을 확인하고 아래의 사이트에서 자세한 사용법을 찾아 설정하자.
      기본사용법은 gst-launch를 사용한 후 각각의 plug-in을 연결하여 사용하면된다.
      여기에 해당옵션들을 설정을 하면되지만, bad, good, ugly 마다 지원되는 거이 틀리며,
      vendor와 version 을 반드시 확인을 해야한다.

      gstreamer는 기본적으로 pipleline 방식으로 연결되어 동작을 하고, 필요한 plugin을 찾아
      이를 사용자가 설정을 해주면되는 것이다.
      예를 들면,  rtspsrc를 보자.
 
      videomixer 와 videocrop에 대해서 위해서 찾아보자

  • videocrop 사용방법과 관련설정

확인해보면 examlple로 확인가능하며, Element Pads 구성을 보면 자세한 설정을 확인가능하다.
     direction : Sink or Source      (Manual 8.1 참조)
     presence : always, sometimes, request
   
  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-videocrop.html
   
  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-aspectratiocrop.html


4.3 GSTREAMER 명령어 설명


  • gst-feedback   :  디버깅용으로 gstream의 상태를 진단하고 보고하는용으로 사용한다. 
  • gst-install       :  내가 해본결과 소스를 받아 설치하는데, 원래는 다른것 같다. 
  • gst-launch      :  gstreamer를 pipeline을 실행한다.    
  • gst-typefind    :  파일의 정보를 보여준다 
  • gst-play         :  가장 쉽게 동영상 play가 가능한 명령어. 
  • gst-inspect     :  plug-in 과 element를 검색하며, grep를 이용하여 확인하자. 
  • gstreamer-codec-install
  • gstreamer-properties

  http://linux.die.net/man/1/gst-typefind-0.10
  https://gstreamer.freedesktop.org/documentation/tools/index.html


4.4  GSTREAMER 관련 분석 

     아래는 기본으로 사용하는 방법

  http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet

  • 기본동작

$ gst-launch videotestsrc ! ximagesink
$ gst-launch videotestsrc pattern=snow ! ximagesink 
$ gst-launch videotestsrc ! video/x-raw-rgb, framerate=25/1, width=640, height=360 ! ximagesink

  • videotestsrc         :  video test source  (pattern=snow)
  • ximagesink          :  ximage sink  
  • !                        : 연결? link? 
  • typefindfunctions  :  video/x-raw-rgb, framerate=25/1, width=640, height=360

  https://www.gitorious.org/cameractls/cameractls.git/?p=cameractls:cameractls.git;a=tree

  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-types-definitions.html


5.  GSTREAMER DEBUG

빌드시 GST_DEBUG 옵션을 주면  --enable-gst-debug=yes 이 옵션이 사용이 가능하다.
gst-launch 사용할 경우, 하지만 사용을 하지 못할 경우도 있으니, 너무 기대는 하지 말자.
만약 빌드된채로만 사용해야한다면 이부분은 사용을 못할 가능성이 크다.
   
      1~9까지 선택이 가능하다
       ( 1 - ERROR ,2 - WARNING ,3 - FIXME  ,4 - INFO  )
       ( 5 - DEBUG, 6 - LOG,  7 - TRACE, 9 - MEMDUMP )

  1. --enable-gst-debug=yes    :  debug enable 
  2. --gst-debug=3                  :  debug mode 위의 참조 
  3. -v                                   :  사용하여 print out details 

성능측정으로 Debug도 가능하다.

gstperf : TI에서만 제공되는 Element 인것 같다. 이를 이용하여 debug도 가능
RTSP로 할 경우 latency도 조절이 가능하므로 buffer 조절이 가능하다.
 
   gstperf print-fps=true print-arm-load=true
   queue !   :  중간에 buffer를 둔다.


  • Gstreamer Element perf로 검색 
  gstperf가 없다면 videorate 라든지 audiorate 사용
  https://gstreamer.freedesktop.org/documentation/plugins.html


  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html