Changing filesink location when file reaches 4gb

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Jan 17 11:46:44 PST 2013


On Thu, 2013-01-17 at 11:24 -0800, hobbesc7 wrote:

> I'm currently writing a stream to a local .h264 file, as well as streaming
> live over udp to a remote client.
> 
> I need to record for long periods, and am writing to fat32-formatted SD
> cards.  When the file reaches 4gb, I'd like to seamlessly switchover to a
> new file, i.e. when video1.h264 reaches 4gb, I'd like to start recording to
> video2.h264.
> 
> I'd like to do this without the user having to stop/start the stream.
> 
> This is how my what I'm doing:
> 
> filesrc -- > tee --> queue1 --> udpsink
>                      --> queue2 --> filesink
> 
> Is there a way to change the filesink location property on the fly?  Or if I
> use fdsink instead of filesink, could I somehow change the file name on the
> fly?
> 
> Also, am I going to have to keep track of the file size myself?  How best to
> do that?

Try multifilesink next-file=max-size max-file-size=4294967295

(see gst-inspect-{1.0|0.10} multifilesink)

If you use mpegpsmux aggregate-gops=true ! multifilesink you might even
get the next file started with a keyframe.

Cheers
 -Tim



More information about the gstreamer-devel mailing list