GStreamer同时记录和查看流 [英] GStreamer Recording and Viewing Stream Simultaneously

查看:55
本文介绍了GStreamer同时记录和查看流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我手头上有一个奇怪的任务,我已经尝试了一切.我想知道你能不能帮忙.

I have a strange task at hand, and I've tried everything. I was wondering if you could help.

我的任务是获取RaspPi发出的流并将其保存到我的PC中.但是,我需要同时查看和保存它.

My task is to grab a stream put out by a RaspPi and save it to my PC. However, I need to view AND save it simultaneously.

可以查看它:

gst-launch-1.0 udpsrc port = 5000!application/x-rtp,有效载荷= 96!rtpjitterbuffer!rtph264depay!avdec_h264!fpsdisplaysink sync = false text-overlay = false

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false

好的,太好了.现在要同时保存它.

Okay, great. Now to save it simultaneously.

我只是经验不足,无法弄清楚这一点.我知道我必须使用"tee"命令.但这就是我所知道的...

I am just not experienced enough to figure this out. I know I have to use the "tee" command. But that's all I know...

帮助?

推荐答案

下面是一个测试管道,该管道呈现 videotestsrc ,对其进行编码,然后将其保存到磁盘:

Here's a test pipeline that renders videotestsrc, encodes it, and then saves it to disk:

gst-launch-1.0 -vv videotestsrc ! tee name=t ! queue leaky=1 ! autovideosink sync=false t. ! queue ! x264enc ! mpegtsmux ! filesink location=testvideo.mp4

如此处所述:

http://www.oz9aec.net/index.php/gstreamer/410-x264enc-problem-in-gstreamer-video-switcher-solved

该管道有两个分支,它们的处理速率完全不同,因此这就是为什么您需要在渲染分支中设置 leaky 队列(并禁用时钟同步)的原因.否则,此示例管道会阻塞.

that pipeline has two branches with wildly different rates of processing, so that's why you need to set a leaky queue in the rendering branch (and also disable clock synchronization). Otherwise, this example pipeline blocks.

在您的问题中,您没有解释要保存的格式,但是可能要保存编码的格式.我建议您使用 gst-inspect-1.0 并仔细阅读每个过滤器的规格,这样您就可以知道每种插件流过什么类型的增益.这将帮助您找到正确的插件,以进行编码和保存流所需的连接.

In your question you don't explain what format you want to save, but probably you want to save it encoded. I suggest that you use gst-inspect-1.0 and read the specs for each filter carefully, so you know what type of buffes are flowing through each plugin. This will help you find the proper plugins you need to connect to encode and save the stream.

Gstreamer有时会令人困惑,但我确实建议您下次再看一遍.gstreamer-devel邮件列表是一个很好的信息来源: http://gstreamer-devel.966125.n4.nabble.com/

Gstreamer can be confusing at times, but I really suggest that you look around a bit longer next time. The gstreamer-devel mailing list is a good source of information: http://gstreamer-devel.966125.n4.nabble.com/

这篇关于GStreamer同时记录和查看流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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