GStreamer 6

[GStreamer] Push, Pull 방식

이 글은 GStreamer 튜토리얼 문서 Different scheduling modes를 요약한 글입니다. 엘리먼트의 Pad는 Push 방식과 Pull 방식의 스케쥴링 모드를 지원합니다. 대표적으로 아래와 같은 use-case가 존재합니다. 1. 모든 엘리먼트의 패드들이 push 모드인 경우① 첫번째 엘리먼트는 다음 엘리먼트의 sinkpad에게 버퍼를 push하는 작업을 반복합니다.② 두번째 엘리먼트는 sinkpad에 등록된 _chain() 함수를 통해 전달받은 버퍼를 처리합니다.③ _chain() 함수는 gst_pad_push() 함수를 통해 다음 엘리먼트의 sinkpad에게 버퍼를 push합니다. 2. sinkpad는 pull 모드, srcpad는 push 모드인 경우① sinkpad가 pull 모..

GStreamer 2017.04.05

[GStreamer] RTSP의 H264 영상 Dump 방법

RTSP로 스트림되는 H264 영상을 GStreamer로 Dump하는 방법입니다. rtph264depay를 통해 출력되는 h264 데이터의 stream-format을 byte-stream으로 지정해줘야 streameye와 같은 툴로 분석이 가능합니다. gst-launch-1.0 rtspsrc location="rtsp://media.smart-streaming.com/mytest/mp4:sample.mp4" ! rtph264depay ! video/x-h264,stream-format=byte-stream ! h264parse ! filesink location="/path/to/video.h264" *H264 Byte Stream 포맷?- SPS > PPS > I/P/B 슬라이스 순서로 나열됩니다.- ..

GStreamer 2017.03.29

[GStreamer] h264 profile 확인하는 방법

명령어 입력1. rtsp에서 h264 파싱 후 디코딩2. x264enc 사용하여 h264로 재인코딩gst-launch-1.0 -v rtspsrc location="rtsp://media.smart-streaming.com/mytest/mp4:sample.mp4" ! rtph264depay ! video/x-h264,stream-format=avc ! h264parse ! identity silent=false name=before ! avdec_h264 ! x264enc dct8x8=false cabac=false bframes=0 ! identity silent=false name=after ! mpegtsmux ! hlssink max-files=5 location=/home/ubuntu/media/..

GStreamer 2017.03.27

[GStreamer] 윈도우 Visual Studio 개발 환경 설정

Windows7 64bit, Visual Studio 10 기준으로 기술하였습니다. GStreamer 1.10.4 설치1. 다운로드 2. gstreamer-1.0-x86_64-1.10.4.msi / gstreamer-1.0-devel-x86_64-1.10.4.msi 설치 ※ 설치 경로를 기억하세요. 저는 D:\gstreamer에 설치하였습니다. 환경변수 등록1. 내 컴퓨터 > 속성 > 고급시스템 설정 > 환경변수 > 시스템 변수 > Path [편집]2. ..;D:\gstreamer\1.0\x86_64\bin 덧붙이고 [확인] SDK 템플릿 Visual Studio로 복사1. D:\gstreamer\1.0\x86_64\share\vs\2010\wizard의 파일 3개 복사 - gst-sdk-template..

GStreamer 2017.03.06

[GStreamer] Pad-added Signal

GStreamer로 RTSP 영상을 화면에 출력하기 위해 이렇게 작성하였습니다. int main(int argc, char *argv[]) {GstElement *pipeline, *source, *demux, *parse, *filter, *decodebin, *sink;GstBus *bus;GstMessage *msg;GstStateChangeReturn ret; gst_init (&argc, &argv); // Pipeline과 Element 생성pipeline = gst_pipeline_new ("video player");source = gst_element_factory_make("rtspsrc", "source");demux = gst_element_factory_make("rtph264de..

GStreamer 2017.03.06