GStreamer:Basic
GStreamer의 기초 내용 정리.
Terms
예제 구성:
Gstreamer_-basic-pipeline-_ogg_player.png
구성 요소
- Elements
- GStreamer에 있어 가장 중요한 객체. 연결된 elements 들의 체인을 만들 수도 있으며 이렇게 만들어진 체인을 이용하여 스트림 데이터를 처리할 수도 있다.
-
Gstreamer_-basic-_elements.png - Source elements
- 입력(받는곳)은 없고 출력만 있습니다.
- 디스크, 사운드 카드에서 읽어 파이프라인에서 사용할 데이터 생성
- Filters, Convertors, Demuxers, Muxers, Codecs
- 입력, 출력 pad가 있습니다. (데이터를 받고, 데이터를 처리 후 내보냄)
- 1:1(filter, convertor) 일수도, 1:N(demuxer, muxer) 일수도 있습니다.
- Filter(볼륨), Convertor(비디오 크기변환), Ogg(비디오+음성 포함 파일) Demuxer 등이 있습니다.
- Sink elements
- 미디어 파이프라인의 끝 점
- 입력(받는곳)만 있고, 출력은 없습니다.
- 주로 H/W 적인 출력(모니터에 출력, 오디오 출력) 및 파일 저장 등 수행
- Source elements
- Pads
- Pads는 Element의 Input과 Output을 나타낸다. 이를 통해 다른 Element와 연결할 수가 있다.
- Pads는 Data를 처리할 수 있는 Capability를 가지고 있다. 예를 들어 Pad에서 특정 데이터의 흐름에 제한을 둘 수 있다.
- Pads는 Source Pad와 Sink Pad로 나눌 수가 있다.
- Sink Pad 는 데이터를 Element 내부로 가져올 때 사용되고, - Sink 는 입력! (나의 마인드맵과 다르다!)
- Source Pad는 데이터를 Element 외부로 보낼 때 사용된다. - Src 는 출력! (나의 마인드맵과 다르다!)
-
Gstreamer_-basic-_bin.png
- Cap
- Pad 에서 지원하는 데이터 Type을 필터링한다. (사이즈, 프레임수 등) 주로 Converter 뒤에 위치한다.
- Bins
- Element 들을 모아 놓은 하나의 Container (일종의 그룹)
- Bin 으로 묶어 놓으면 일일이 Element를 제어할 필요 없이 한번에 제어가 가능하다.
- 예를 들어 Bin 안에 묶여 있는 모든 Element의 상태를 변경하고 싶을 경우에는 단순하게 Bin 자체의 상태만 변경하면 Bin 내부의 모든 Element의 상태가 바뀌게 된다.
- Pipelines
- 최상위 Bin, 응용 프로그램을 위한 Bus 제공. 자식에 대한 동기화 관리.
-
Gstreamer_-basic-_pipeline.png
통신
GStreamer는 다양한 방식으로 application과 pipelin 사이의 데이터 교환 또는 통신을 위한 매커니즘을 제공한다.
Gstreamer_-basic-_communication.png
- Bus
- Pipeline loop가 돌 때 상태를 체크한다. Bus에 메세지 핸들러를 붙여 사용한다.
- Buffer
- Buffer는 Pipeline 내에 있는 Element들 간의 데이터 전송을 위해 사용된다.
- Buffer는 항상 Source에서 Sink로 이동한다. (Downstream)
- Message
- 각 Element 에서 응용프로그램으로 보내는 데이터
- Event
- 응용프로그램 -> 각 Element 로 전송되는 객체
- Query
- 응용프로그램 -> Pipeline 으로 보내는 데이터
Basic tutorials
- Basic tutorials - 공식 사이트의 Basic Tutorials 링크.
These tutorials describe general topics required to understand the rest of tutorials.
- Basic tutorial 1: Hello world! – The mandatory 'Hello world' example
- Basic tutorial 2: GStreamer concepts – Gstreamer Elements, Pipeline and the Bus
- Basic tutorial 3: Dynamic pipelines
- Basic tutorial 4: Time management
- Basic tutorial 5: GUI toolkit integration
- Basic tutorial 6: Media formats and Pad Capabilities
- Basic tutorial 7: Multithreading and Pad Availability
- Basic tutorial 8: Short-cutting the pipeline
- Basic tutorial 9: Media information gathering
- Basic tutorial 10: GStreamer tools
- Basic tutorial 11: Debugging tools
- Basic tutorial 12: Streaming
- Basic tutorial 13: Playback speed
- Basic tutorial 14: Handy elements
- Basic tutorial 16: Platform-specific elements
See also
- GStreamer
- GStreamer:Basic
- GStreamer:GstLaunch - gst-launch-1.0 명령행.
- GStreamer:GstInspect - gst-inspect-1.0 명령행.
- GStreamer:Python
- GStreamer:C
Favorite site
Tutorials
- 공부하는 개발자 :: I. GStreamer 소개 : 1장. GStreamer란 무엇인가?
- (번역)(gstreamer) basic tutorial 1: Hello world! :: 팔랑귀
- (NNStreamer) Gstreamer 기본 튜토리얼 1 - NiklasJang’s Blog - Basic tutorial 1: Hello world! 을 참조함.
- (NNStreamer) Gstreamer 기본 튜토리얼 3 - NiklasJang’s Blog
- Gstreamer 기본 튜토리얼 02: GStreamer concepts - jtrimind blog