Recording previous few seconds of a live-stream

puneet puneet.joshi007 at gmail.com
Sun Aug 30 18:09:01 PDT 2015


Hi,

I am writing a live stream to a .mp4 file using the gstreamer APIs. My
pipeline is appsrc --> x264enc --> mp4mux --> filesink.  I capture frames
from a webcam, put a timestamp and push the buffer to appsrc.  This push of
buffer happens only at certain points of time, when there is a certain event
(in video), otherwise, I do not record frames.  What I would like to achieve
is to record previous 2 seconds of the event whenever I start recording. 
Currently, I have implemented this by maintaining a queue of buffers of past
2 seconds and then push them all in one go when I have to record.  Although
this works, it consumes almost 1 ms per push (perhaps because I am using
python wrappers), so at 15 fps pushing 30 buffers means 30 ms delay.  Is
there are better way of achieving this?

Thanks,
Puneet



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Recording-previous-few-seconds-of-a-live-stream-tp4673404.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list