[gst-devel] Re : Changing file location during recording

Marco Ballesio gibrovacco at gmail.com
Thu Jul 8 11:14:29 CEST 2010


Hi,

On Thu, Jun 17, 2010 at 3:16 PM, Albert Costa <costa_albert at yahoo.fr> wrote:
> Hi,
> thanks a lot to all people, this works fine!
> Now my only concern left is to be able to reset the timestamps (start again
> at 0) when changing the file. Currently when I apply this solution,
> timestamps continue to increase (for example 0 to 2 seconds in first file,
> then 2 to 4 seconds in the second file when I change it).
> I've tried to put a homemade plugin that offsets the timestamps back to 0
> when I change the file (changing my branch to tee0. ! queue ! offsetplugin !
> ffenc ! mpgtsmux ! filesink). But it seems it doen't work well: even doing
> that, dumping the timestamps of the second file starts at 2 seconds (with
> this example).

Sorry, for the late reply, hope this helps..

I think here you'd need to put also your source element to NULL and
then back to PLAYING state.

Regards

> Regards,
> Al
> ________________________________
> De : Edward Hervey <bilboed at gmail.com>
> À : Discussion of the development of GStreamer
> <gstreamer-devel at lists.sourceforge.net>
> Envoyé le : Jeu 17 juin 2010, 8h 36min 15s
> Objet : Re: [gst-devel] Changing file location during recording
>
> 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,
> filesink);
> * 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);
>
>   Edward
>
> 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
>
>
>
> ------------------------------------------------------------------------------
> 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
>
>
> ------------------------------------------------------------------------------
> 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