Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Piping stdout to gstreamer

Good Day,

I am trying to get gst-launch (gstreamer) to get the input from stdout. Most of the examples on the net are about either reading from file or reading from device. Does anyone know an example pipeline?

filesrc location="lowframe.h264"

or

device=/dev/video0

Is there one that would read from stdout?

like image 609
raaj Avatar asked Dec 09 '22 08:12

raaj


1 Answers

There's a GStreamer element called fdsrc that allows you to read from (already open) file descriptors.
stdin is basically fd 0 (on POSIX systems like Linux/Mac; see Wikipedia), so you can simply use something like the following launch line:

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


Another way would be to use filesrc and read from /dev/stdin on systems that support it, e.g.:

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


/edit found out about the fdsrc method (which seems to be the better solution to this problem)

like image 162
mreithub Avatar answered Dec 11 '22 09:12

mreithub