在Ubuntu中使用Gstreamer通过RTP协议流式传输Mp4视频
我试图从我的本地目录中获取视频文件,启用来自服务器的流并从我的客户端捕获这些帧。我使用了以下管道:
服务器端:
gst-launch -v filesrc location = / home / gokul / Videos / Econ_TestVideo / radioactive.mp4! qtdemux! rtpmp4vpay! udpsink host = 192.168.7.61 port = 5000 sync = true
将管道设置为PAUSED ...管道正在PREROLLING ... /GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:src:caps = application / x-rtp,media =(string)video,clock-rate =(int)90000, (字符串)1,config =(字符串)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30,净荷=(int)96,ssrc =(uint)3003638799,clock-base =(uint) (String)1542273545,seqnum-base =(uint)49176 /GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:sink:caps = video / mpeg,mpegversion =(int)4,systemstream =(boolean)false,profile =(string) 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:udpsi nk0.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流水线是PREROLLED ...将管道设置为PLAYING ...新时钟:GstSystemClock
客户端:
gst-launch -v udpsrc port = 5000 caps =“application / x-rtp”! rtpmp4vdepay! mpeg4videoparse! 队列! ffdec_mpeg4! ffmpegcolorspace! xvimagesink
将管道设置为PAUSED ... /GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src:caps = application / x-rtp,media =(string)video,payload =(int)96,clock-rate =(int)1 ,encoding-name =(字符串)MP4V-ES管道是活的,不需要PREROLL ...将管道设置为PLAYING ...新时钟:GstSystemClock
设置这些后,我没有看到任何显示(甚至没有启动应用程序屏幕)
要添加上面的信息,我在Ubuntu-12.04的命令行中运行这些命令
以下是接收器的流水线
发件人:
gst-launch-1.0 -v filesrc location = video.mp4! 解码器! x264enc! rtph264pay! udpsink主机= 192.168.1.159端口= 5000
将输出CAPS在接收端使用这个上限:
caps =“application / x-rtp,media = video,clock-rate = 90000,encoding-name = H264,payload = 96,ssrc = 3394826012,timestamp-offset = 2215812541,seqnum-offset = 46353”
接收器:
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! 解码器! videoconvert! autovideosink sync = false
因此您将可以流式传输并且视频将流畅而干净。 在上面的管道中,如果您使用的是gst-launch-0.10,则用ffmpegcolorspace替换videoconvert
最后,我将能够在启动画面中看到一些视频。我使用了以下管道。但视频不清楚。
服务器:
gst-launch-0.10 -v filesrc location = / home / gokul / video.mp4! qtdemux name = d! 队列! rtpmp4vpay! udpsink端口= 5000
客户:
gst-launch-0.10 udpsrc port = 5000 caps =“application / x-rtp,media =(string)video,clock-rate =(int)90000,encoding-name =(string)MP4V-ES,profile-level-id =(字符串)243,config =(string)000001b0f3000001b50ee040c0cf0000010000000120008440fa282fa0f0a21f,payload =(int)96,ssrc =(uint)4291479415,clock-base =(uint)4002140493,seqnum-base =(uint)57180“! rtpmp4vdepay! ffdec_mpeg4! xvimagesink sync = false
所以任何人都可以建议我如何通过修改添加一些管道参数来增强客户端视频图像。
链接地址: http://www.djcxy.com/p/43991.html上一篇: Streaming Mp4 video through RTP protocol using Gstreamer in Ubuntu