Streaming Live H264 Video Over RTP

William Metcalf wmetcalf at niftytv.com
Thu Aug 4 07:54:02 PDT 2011


I am streaming live H264 video from an application in Windows (the input 
is from a capture card) as follows

appsrc is-live=true do-timestamp=false typefind=true ! 
"video/x-raw-yuv,format=(fourcc)UYVY,width=(int)720,height=(int)486,framerate=(fraction)30/1" 
! ffmpegcolorspace ! x264enc byte-stream=true ! h264parse ! rtph264pay ! 
udpsink clients="192.168.42.45:52000"

In order to receive the stream I use the following pipeline

gst-launch -v udpsrc port=52000 ! 
"application/x-rtp,media=(string)video,clock-rate=90000,encoding-type=(string)H264,payload=(int)96" 
! rtph264depay ! 
"video/x-h264,width=(int)720,height=(int)486,framerate=(fraction)30/1" ! 
ffdec_h264 ! ffmpegcolorspace ! glimagesink sync=false

The video produced plays fine (i.e. the framerate and all of the colors 
seem correct), but the video is of very very low quality and is very 
pixelated.  If I change the "do-timestamp" property of appsrc to true, 
the video becomes very clear and very high quality, but the video plays 
very jumpy and I get the following errors repeatedly:

0:00:04.949494000  2680   0185E490 ERROR                 ffmpeg .:0:: 
Missing reference picture
0:00:04.956495000  2680   0185E490 ERROR                 ffmpeg .:0:: 
decode_slice_header error
0:00:05.045504000  2680   0185E490 ERROR                 ffmpeg .:0:: 
reference picture missing during reorder
0:00:05.059505000  2680   0185E490 ERROR                 ffmpeg .:0:: 
reference picture missing during reorder
0:00:05.073507000  2680   0185E490 ERROR                 ffmpeg .:0:: 
reference picture missing during reorder
0:00:05.087508000  2680   0185E490 ERROR                 ffmpeg .:0:: 
reference picture missing during reorder
0:00:05.104510000  2680   0185E490 ERROR                 ffmpeg .:0:: 
Missing reference picture
0:00:05.119511000  2680   0185E490 ERROR                 ffmpeg .:0:: 
decode_slice_header error
0:00:05.148514000  2680   0185E490 ERROR                 ffmpeg .:0:: 
mmco: unref short failure
0:00:05.168516000  2680   0185E490 ERROR                 ffmpeg .:0:: 
mmco: unref short failure
0:00:05.183518000  2680   0185E490 ERROR                 ffmpeg .:0:: 
Missing reference picture

I am sure these errors are because of some setting that I am missing or 
setting to a wrong value, but so far I have not been able to find a good 
solution.  Can anyone offer some insight on how to fix this problem?  
Any help is greatly appreciated.

Thank you,
William




More information about the gstreamer-devel mailing list