使用 gstreamer 通过 RTP 流式传输视频 [英] Video streaming over RTP using gstreamer

查看:161
本文介绍了使用 gstreamer 通过 RTP 流式传输视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 gstreamer 通过 RTP 将视频文件从一台设备流式传输到另一台设备.在发送方,我使用以下命令:

I am trying to stream a video file using gstreamer from one device to another over RTP. At the sender side I am using the following command :

gst-launch filesrc location=/home/kuber/Desktop/MELT.MPG !解析!rtpsend ip=localhost

gst-launch filesrc location=/home/kuber/Desktop/MELT.MPG ! mpegparse ! rtpsend ip=localhost

但这会产生以下错误:没有元素rtpsend",我下载了所有 rtp 工具,但仍然出现相同的错误.我是否以错误的方式使用 rtpsend?也有人可以给我用于将视频文件(本地存储在我的笔记本电脑中,而不是 testvideosrc 文件)从一台设备流式传输到另一台设备的命令行代码吗?强文本

But this gives the following error : no element "rtpsend" , I downloaded all the rtp tools and still the same error. Am I using rtpsend in some wrong way? Also can someone give me the command line code for streaming video file(locally stored in my laptop and not the testvideosrc file) from one device to another? strong text

推荐答案

假设这是一个 MPEG1/2 基本流(因为你使用的是 mpegparse)你要发送出去 你需要在你的 mpegparse 之后使用 rtpmpvpay 然后给udpsink 的输出.

Assuming this is a MPEG1/2 elementary stream (because you are using mpegparse) that you want to send out You need to use rtpmpvpay after your mpegparse and then give the output to udpsink.

mpegparse ! rtpmpvpay ! udpsink host="hostipaddr" port="someport"

我不知道有任何 rtpsend 插件.以上适用于 rtp 上的任何流媒体.

I am not aware of any rtpsend plugin as such. The above holds true for any streaming on rtp.

进行商品及服务税检查 |grep rtp 查看所有的payloader,depayers

Do a gst-inspect | grep rtp to see all the payloaders, depayers

如果它是一个 mpegps 流,你需要在管道的其余部分之前先做一个 mpegpsdemux.

If it is a mpegps stream you need to first do a mpegpsdemux before the rest of the pipeline.

为什么不删除 mpegparse?不明白你为什么需要它.您应该学会在组件的 gst-inspect 中查看源和接收器要求,这将告诉您节点之间所需的兼容性.接收将是反向 udpsrc port="portno" !capsfilter caps="application/x-rtp, pt=32, ..enter caps here"!rtpmvdepay !

Why not remove mpegparse? don't see why you need it. You should learn to look at the source and sink requirements in gst-inspect of the component, that will tell you the compatibility that is needed between nodes. Recieving will be reverse udpsrc port="portno" ! capsfilter caps="application/x-rtp, pt=32, ..enter caps here" ! rtpmpvdepay !

这篇关于使用 gstreamer 通过 RTP 流式传输视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆