Stream H.264 video over rtp using gstreamer

随声附和 提交于 2019-11-29 21:06:32

filesrc will read the data from the given file as raw bytes; you cannot just encode these raw bytes with x264enc, you will need video-data for this to work. try adding a demuxer/decoder before re-encoding the stream), e.g. something like this:

Sender:

gst-launch-1.0 -v \
   filesrc location=/tmp/sample_h264.mov
   ! qtdemux \
   ! h264parse \
   ! ffdec_h264 \
   ! ffmpegcolorspace \
   ! x264enc \
   ! rtph264pay \
   ! udpsink host=127.0.0.1 port=5000

You should do a quick check whether this works by using a test video soure:

gst-launch-1.0 -v \
   videotestsrc 
   ! x264enc \
   ! rtph264pay \
   ! udpsink host=127.0.0.1 port=5000
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!