Recording playbin output.
dgoiko
dario at dail-software.com
Mon Oct 1 11:30:37 UTC 2018
Hello.
I'm using GStreammer Python 3 bind to build an application that records and
optionally plays on screen while recording online streamming videos. I'm
using Streamlink to get the m3u8 and/or the stream. The users may add
strange sources, so my original idea was to use something that could detect
source's format and decode it automatically. In order to do so, I found out
that using Streamlink <https://github.com/streamlink/streamlink> in
conjunction with GStreammer's Playbin was the best way to go.
This code from Streamlink documentation allows to play any m3u8 stream:
Code can be found in my original stack overflow post, here StackOverflow
question
<https://stackoverflow.com/questions/52589779/python-gstreamer-playbin-record-and-play>
Usage:
TestStreamlink.py https://www.mitele.es/directo/divinity best
You can change mitele URL with a twitch one, for instance.
I've checked gst documentation ( GStreammer API reference)
<https://gstreamer.freedesktop.org/documentation/> and I think the best
thing to use in order to save files is "filesink bin", however, I've no clue
how to make a tee on playbin's output to split between recording and
playing. I don't know how to do only recording either.
I'm new to Python, but I must do it in that language, so its quite a
handycap for me. As far as I know, the way to go is to create a "tee" to
clone the downloaded stream into two different pipes, one for normal GUI
output connected to the standard pad (this is the optional play stream,
which will be used only for debugging) and the other connected to a "bin",
"filesink", for instance. Then enabling and disabling the live play is just
a matter of removing/adding the pad. I've consulted this tutorial,
however,as I said i'm new to Python and GST, so I'm not familiar with it :S
By the way, being able to record is by far more important than live playing,
so any ideas about how to integrate playbin and filesink (for mp4 recording,
just to say a random audio/video) format would suffice. BTW: I've to record
audio/video (mp4) but also process audio in another process, so my idea was
to simultaneously record mp4 containing video+audio AND mp3 containing ONLY
audio. mp3 may be sent to another application using RAM OR stored in disk to
later reading, whatever is more convenient.
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list