[gst-devel] How to split filesink output dynamically

Aurelien Grimaud gstelzz at yahoo.fr
Thu Oct 8 01:06:10 CEST 2009

Le 07/10/2009 23:05, Shiping a écrit :
> Hi, folks:
> I am trying to record live video into files using filesink, as you know, the
> output file will become pretty large very quick.
> I would like to know if there is a way to split the output file into small
> chunks with minimum affect to the pipeline, say every 3 minutes or every 10
> MB.
> Any hints or helps will be very appreciate.
> Thanks in advance.
> Shiping

If you have something like :
A/V -> mux -> filesink

I would :
- Wait for a video key frame
- block audio / video sources
- send eos on mux to cleanly end recording
- set mux and filesink to READY
- change filesink location
- set mux and filesink to PLAYING

Maybe going to READY and back to PLAYING is not enough to restart 
elements, then get rid of them and recreate your downstream branch.

I do not know if audio/video will still be in sync after switching to 
another file.

Let us know when you have a solution.

I worked on a streaming service allowing timeshift and tried to do 
something close to this to achieve it. Record small files to allow small 
timeshifting. Replay them in sequence.

I remember running into trouble with A/V sync, but I do not remember if 
it was on recording part or replay part.

The source was a rtsp provided stream.
I also tried not to decode / reencode audio or video before muxing it. 
This is a tricky part.

Another solution could be to just record the RTP live streaming with 
tcpdump (using the -c option).
For timeshift, this would clearly be a saving ressources solution.
Using pcapparse could be a way to replay.


More information about the gstreamer-devel mailing list