管道stdout到gstreamer

问题描述 投票:2回答:1

美好的一天,

我试图让gst-launch(gstreamer)从stdout获取输入。网上的大多数示例都是关于从文件读取或从设备读取。有谁知道一个示例管道?

filesrc location="lowframe.h264"

要么

device=/dev/video0

有没有可以从stdout读取的?

video gstreamer h.264
1个回答
6
投票

有一个名为fdsrc的GStreamer元素,允许您从(已打开的)文件描述符中读取。 stdin基本上是fd 0(在Linux / Mac等POSIX系统上;参见Wikipedia),所以你可以简单地使用类似下面的启动线:

curl http://example.com:8000/stream1.ogg ! gst-launch fdsrc fd=0 ! decodebin ! autoaudiosink

另一种方法是使用filesrc并从/dev/stdin读取支持它的系统,例如:

gst-launch filesrc location=/dev/stdin ! decodebin ! autoaudiosink < /path/to/file.mp3

/编辑发现有关fdsrc方法(这似乎是解决这个问题的更好方法)

© www.soinside.com 2019 - 2024. All rights reserved.