명령어 입력
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/playok/segment%05d.ts playlist-location=/home/ubuntu/media/playok/playlist.m3u8
실행 결과
rtsp로 전달받은 데이터는 h264 baseline 프로파일이며, x264enc로 인코딩한 데이터는 h264 main 프로파일인 것을 확인할 수 있다.
/GstPipeline:pipeline0/GstIdentity:before: last-message = event ******* (before:sink) E (type: tag (20510), GstTagList-stream, taglist=(taglist)"taglist\,\ video-codec\=\(string\)\"H.264\\\ \\\(Constrained\\\ Baseline\\\ Profile\\\)\"\;";) 0x7f2a0c007f40
...
/GstPipeline:pipeline0/GstIdentity:after.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ level\=\(string\)2.1\,\ profile\=\(string\)main\,\ width\=\(int\)424\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)0/1"
'GStreamer' 카테고리의 다른 글
[GStreamer] Push, Pull 방식 (2) | 2017.04.05 |
---|---|
[GStreamer] RTSP의 H264 영상 Dump 방법 (1) | 2017.03.29 |
[GStreamer] 디버깅 로그 출력하기 (0) | 2017.03.29 |
[GStreamer] 윈도우 Visual Studio 개발 환경 설정 (2) | 2017.03.06 |
[GStreamer] Pad-added Signal (0) | 2017.03.06 |