Re: V4l2encoder timestamp expectation

Nicolas Dufresne via gstreamer-devel <[email protected]> Wed, 28 Feb 2024 20:07:06 -0500
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <CAKQmDh_sR_tOX-bK7TQYHDnTKr5opX6pFZ034Q7Vf_HTUBVLBQ@mail.gmail.com>
Le mer. 28 févr. 2024, 13 h 45, Arindam Biswas via gstreamer-devel <
[email protected]> a écrit :

> Hi All,
>
> For gstreamer v4l2 encoder we send frame numbers instead of actual
> timestamp in th output plane
>
> gst_v4l2_buffer_pool_qbuf
>  if (frame_number) {
>     group->buffer.timestamp.tv_sec = *frame_number;
>     group->buffer.timestamp.tv_usec = 0;
>   }
>
> But if v4l2 driver (Encoder) need buffer actual timestamps for some reason
> how can we send that?
>

This is against the spec for a driver to inspect and interpret the
timestamp. The only timing information that v4l2 drivers can use is the
configured frame interval. The driver is free to generate timestamp from
the framerate if this a what the rate controller needs.


> From the patch below it looks like the frame number is mandated over the
> actual timestamp.
> v4l2codec: Pass system frame number as timestamp and use it to retrie… ·
> GStreamer/gst-plugins-good@bcb3428 · GitHub
> <https://github.com/GStreamer/gst-plugins-good/commit/bcb3428ed06e59945dc1c6034f6e68c0e9d3a964>
>
> Thanks
> Arindam
>