[gst-devel] Changing file location during recording

Edward Hervey bilboed at gmail.com
Thu Jun 17 08:36:15 CEST 2010

On Wed, 2010-06-16 at 16:27 +0000, Albert Costa wrote:
> Hi,
> I have a pipeline that can be reducted to:
> gst-launch dshowvideosrc ! tee ! queue ! ffmpegcolorspace !
> ffenc_mpeg2video ! mpegtsmux ! filesink tee0. ! queue !
> ffmpegcolorspace ! directdrawsink
> All this is created/handled in a c application where I can start and
> stop the pipeline. I now have a requirement to change the location of
> the file after a given size (for example) is reached. I've started to
> test following sequence on user request for the moment:
> -set pipeline to paused
> -change filesink location
> -set back pipeline to playing
> But it seems it does not handle the change of location in the
> filesink. I've also tried to unlink/relink the filesink branch in
> combination with the state change, with no success.
> Is there a way to change dynamically the filesink location, either by
> external commands (like I tried) or even better automatically with a
> plugin I am maybe not aware of?

 You want to, when no data is flowing : set the filesink to the NULL
state, change the location, bring back the filesink to the PLAYING
state. To ensure no data is flowing, use the gst_pad_set_blocked_async()
method on the pad feeding data to your filesink.

 * Grab the mpegtsmux source pad and
gst_pad_set_blocked_async(sourcepad, TRUE, my_blocked_callback,
 * In your my_blocked_callback:
 ** WHEN blocked is TRUE:
 *** set filesink to NULL,
 *** change the location property of filesink,
 *** set filesink to PLAYING,
 *** and finally call gst_pad_set_blocked_async(sourcepad, FALSE,
my_blocked_callback, NULL);


P.S. You can only do this with container formats that don't have headers
(like mpeg-ts). There might also be quirks about the PMT/PAT not being
present at the beginning of the second file.

> Thanks for help,
> Regards,
> Al
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit.  See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

More information about the gstreamer-devel mailing list