Variable framerate/fps input video encoding questions
nicolas at ndufresne.ca
Thu Jul 18 11:52:46 UTC 2019
Le jeudi 18 juillet 2019 à 04:28 -0500, jles a écrit :
> I'm new with gstreamer and h264 encoding and I'm trying to understand the
> capabilities and limitations of this.
> My main goal is to be able to record an input live video stream from a
> camera that changes the framerate dynamically depending of the exposure and
> light conditions. This camera is capable to work a high framerates for low
> resolutions like 700fps on VGA(640x480) mode, so frame rate can change from
> 10fps to 700fps.
> My first question is: would it be possible to encode video to h264 for a
> variable frame rate as described above?
Yes, assuming you have a capable CPU or HW Accelerator, 700 fps will
trigger few bottleneck in GStreamer (even if the resolution is low), so
you really need a powerful machine.
What is not possible which this, is for GStreamer to evaluate the
latency requires if you would like to do live streaming out of it. Best
is to pretend you are doing 10fps, and the latency calculation will be
made from that, then having early frames should not be a problem.
> The pipeline I'm using looks similar to this:
> appsrc -> videorate -> videoconvert -> caps -> queue -> omxh264enc -> queue
> -> h264parse -> mpegtsmux -> filesink
Note that videorate will likely drop or add frames to you stream, is
this really what you are looking for ?
> These are the things I tried and the issues I found:
> - If I set the appsrc caps to a fix framerate of 15fps (regardless camera
> fps) the resulting video plays a "normal" speed but during fast movements I
> can see frame tearing issues.
What version of GStreamer are you using ? Do you reuse you buffers too
soon ? There was also some issues in omxh264enc in older versions.
> -For any fps different to 15fps the resulting encoded video plays faster
> than is should be.
> Any idea what could it be happening?
That can only be a miss-calculation of timestamp on your end. Using
appsrc requires good care on crafting correct timestamps.
> I did spend long time searching but I could not find any similar
> Any light on this would it be appreciated.
> Thanks in advance.
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: This is a digitally signed message part
More information about the gstreamer-devel