在Ubuntu中使用Gstreamer通过RTP协议流式传输Mp4视频

时间:2014-12-18 11:17:52

标签: ubuntu video-streaming gstreamer rtp gst-launch

我正在尝试从我的本地目录中获取视频文件,从服务器启用流并从我的客户端捕获这些帧。我使用了以下管道:

服务器端:

gst-launch -v  filesrc location=/home/gokul/Videos/Econ_TestVideo/radioactive.mp4 ! qtdemux ! rtpmp4vpay ! udpsink host=192.168.7.61 port=5000 sync=true


Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)3003638799, clock-base=(uint)1542273545, seqnum-base=(uint)49176
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)1, codec_data=(buffer)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, width=(int)1280, height=(int)720, framerate=(fraction)91/3, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0: timestamp = 1542273545
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0: seqnum = 49176
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)3003638799, clock-base=(uint)1542273545, seqnum-base=(uint)49176
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

客户端:

gst-launch -v udpsrc port=5000 caps="application/x-rtp" ! rtpmp4vdepay ! mpeg4videoparse ! queue ! ffdec_mpeg4 ! ffmpegcolorspace !  xvimagesink


Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)1, encoding-name=(string)MP4V-ES
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

设置完这些后,我没有看到任何显示(甚至没有启动应用程序屏幕)

要添加上述信息,我在Ubuntu-12.04的命令行中运行这些命令

2 个答案:

答案 0 :(得分:3)

以下是接收器的管道

发信人:

  

gst-launch-1.0 -v filesrc location = video.mp4! decodebin! x264enc! rtph264pay! udpsink host = 192.168.1.159 port = 5000

将输出CAPS在接收方使用此大写字母:

caps =" application / x-rtp,media = video,clock-rate = 90000,encoding-name = H264,payload = 96,ssrc = 3394826012,timestamp-offset = 2215812541,seqnum-offset = 46353& #34;

接收器:

  

gst-launch-1.0 -v udpsrc port = 5000 caps =" application / x-rtp,media = video,clock-rate = 90000,encoding-name = H264,payload = 96,ssrc = 3394826012,timestamp-offset = 2215812541,seqnum-offset = 46353" ! rtph264depay! decodebin!视频转换! autovideosink sync = false

因此您将能够流式传输,视频将流畅而干净。 在上面的管道中,如果你使用的是gst-launch-0.10,那么用ffmpegcolorspace替换videoconvert

答案 1 :(得分:0)

最后,我将能够在启动画面中看到一些视频。我使用了以下管道。但视频不清晰。

服务器

gst-launch-0.10 -v filesrc location = / home / gokul / video.mp4! qtdemux name = d!排队! rtpmp4vpay! udpsink port = 5000

<强>客户端:

gst-launch-0.10 udpsrc port = 5000 caps =&#34; application / x-rtp,media =(string)video,clock-rate =(int)90000,encoding-name =(string)MP4V-ES ,profile-level-id =(string)243,config =(string)000001b0f3000001b50ee040c0cf0000010000000120008440fa282fa0f0a21f,payload =(int)96,ssrc =(uint)4291479415,clock-base =(uint)4002140493,seqnum-base =(uint)57180& #34; ! rtpmp4vdepay! ffdec_mpeg4! xvimagesink sync = false

所以任何人都可以建议我如何通过修改添加一些管道参数来增强客户端的视频图像。