[gst-devel] Saving a live stream
Hayden Andrews
hayden at heydan.co.uk
Sat Jan 24 09:58:42 CET 2009
Hi guys,
We have a live A/V Ogg stream that runs for a couple of hours, but we
want to be able to save an (approximately) 40 min section of this stream
to a file.
First of all, I wrote a quick Perl script which reads directly from the
appropriate HTTP port (an Icecast Server) and writes to a file.
Everything looks fine with this file except ..
1) Suppose we record from 40 mins to 1:20 of the live stream. When we
play the file, the current time starts at the time we started recording
from rather than from 00:00. Although the run time is correct (40 mins),
the current time progresses from 40mins to 1:20.
2) When someone tries to edit the file to trim each end and make any
other minor changes that are required, seeking takes forever and the
editor takes for ever to do things that would normally be quite quick
with a normal file. I believe that if the file has a play time of about
40 mins, then the player says that it will take about 40 mins to do many
tasks.
I figure that since a live stream has an unknown length, and since it is
not possible to seek when viewing a live stream, that there is missing
info in the live stream that needs to be inserted while saving. So, I
also figure that it would be easy to insert the relevant requirements
while saving a live stream to file.....
So, I edited my script to use Gstreamer instead. I have used souphttpsrc
! filesink and I've used souphttpsrc ! decodebin ! ...... ! oggmux !
filesink. I hoped that the filesink would expect to insert [what ever is
needed] and would do [something] automatically. But we still get files
which are difficult to edit. So, I tried setting do-timestamp=true in
southttpsrc which produced a file, which when played by vlc, showed
either a very short (2-3 seconds) or unknown run time, and crashed the
player when I tried seeking within the file being played.
So, what should I be doing? Any ideas.... I expect that this is a simple
and normal scenario as I'm sure that it is more than normal to be saving
portions of live streams to file for later editing/playing.
Cheers,
Hayden
More information about the gstreamer-devel
mailing list