Changing filesink location dynamically

Tim Müller tim at centricular.com
Sun Feb 5 11:08:11 UTC 2017


On Wed, 2017-02-01 at 08:30 -0800, ivan-perez wrote:

> I have a pipeline which gets a video in H.264 format from a camera
> and splits it into two sinks: a RTP sink and a file sink. I want the
> file sink to create videos of 10 seconds every minute.

Couple of things you could look into:

a) we have something called splitmuxsink, which allows you to start a
new file every N seconds/minutes. It will automatically make sure that
files start with a keyframe and are playable independently. Having said
that, it depends on the sender of course, if they send key frames
frequently enough.

You could just keep creating files of ca. 10 seconds and delete 5 out
of 6 files so you only get 10 secs every minute :)

Depends what you want to do with it exactly I suppose.


b) you can check out this example:
https://people.freedesktop.org/~tpm/code/test-backlog-recording-h264.c
(you can do it without a backlog too of course)

And just start/stop things with a timer then.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list