Gstreamer timestamps with start/stop recording

Terry Barnaby terry1 at beam.ltd.uk
Wed Aug 17 17:20:06 UTC 2022


On 17/08/2022 15:34, Nicolas Dufresne via gstreamer-devel wrote:
> Hi Terry,
>
> Le mercredi 17 août 2022 à 14:07 +0100, Terry Barnaby via gstreamer-devel a
> écrit :
>> videotestsrc pattern=smpte !
>> video/x-raw,width=640,height=480,framerate=5/1 ! c.sink_0
>> appsrc name="appsrc" ! imagefreeze ! videoconvert ! c.sink_1
>> t. ! queue ! glimagesink name=videoSink
>> t. ! queue ! fakesink enable-last-sample=true name=picturestream"
>> t. ! queue ! beamvalve name=recordValve drop=true ! vaapih264enc
>> name=recordEncoder ! h264parse ! mp4mux fragment-duration=10 ! filesink
>> append=true location="video.mp4" async=false
>>
>> This pipeline is created in software and the recordValve is set to drop
>> or not the video frames to disable/enable recording to the file.
> its been my recommendation for a while now, and have worked for my projects
> also. For recording purposed, I keep recommending using a separate "offline"
> pipeline. End a branch of your live pipeline with appsink, and create the
> offline pipeline starting with the appsrc. You can then pass the samples from
> you application, which gives you the opportunity to redo or offset the timing if
> needed. It also makes the closing of the recording way simpler.
>
> regards,
> Nicolas
>
> p.s. don't forget to discard the buffer from you appsink(s) while not recording

Thanks for the reply.

I will have a go at that.

I am trying to keep everything as efficient as possible. We have a 
relatively low resource embedded system, want to use low power, keep CPU 
resources and memory bandwidth available for other things etc. We have 
tuned the pipeline with experimentation as its difficult to know which 
is the most efficient way with various hardware blocks, how well the 
software works with them (kernel and gstreamer), where the memory to 
memory transfers are and how this works with the various hardware blocks 
etc.

I will see how much the appsink/appsrc affects things, but I like the 
idea of the separate pipelines as I am seeing lots of random (well it 
appears random!) issues when I try things with one pipeline.

Cheers

Terry




More information about the gstreamer-devel mailing list