GStreamer

[GStreamer] h264 profile 확인하는 방법

behonestar 2017. 3. 27. 20:16

명령어 입력

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"