After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595825 - [v4l2src] use timestamps from v4l2 and slave to the pipeline clock
[v4l2src] use timestamps from v4l2 and slave to the pipeline clock
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 595614
 
 
Reported: 2009-09-21 11:46 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2012-05-24 15:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stefan Sauer (gstreamer, gtkdoc dev) 2009-09-21 11:46:59 UTC
v4l2 buffers have a timestamp already:
http://v4l2spec.bytesex.org/spec-single/v4l2.html#V4L2-BUFFER

we could slave the timstamps taken as http://v4l2spec.bytesex.org/spec-single/v4l2.html#V4L2-BUFFER to the pipeline clock.

This should provide less jitter then timestamping when dequeueing (after the poll_wait).
Comment 1 Tristan Matthews 2009-09-30 16:49:11 UTC
Have you had any luck with this? If you any patches you want tested i'd be happy to give it a shot.
Comment 2 Sebastian Dröge (slomo) 2011-05-20 07:29:38 UTC
Any news on this?
Comment 3 Tobias Mueller 2011-10-08 01:18:32 UTC
Reopening as I can't see any open non-developer issue
Comment 4 Olivier Crête 2011-10-08 03:26:34 UTC
This is also especially important with encoding webcams are there is no guarantee that the buffer will come out in PTS order (could be DTS order), so we have to rely on the timestamps from v4l2 (which should ideally come directly from the webcam).
Comment 5 Tim-Philipp Müller 2012-05-24 15:34:01 UTC
I believe this is fixed in 0.11:

  gstv4l2bufferpool.c:588:  struct v4l2_buffer vbuffer;
  gstv4l2bufferpool.c:619:  timestamp = GST_TIMEVAL_TO_TIME (vbuffer.timestamp);




commit a473750350d60ed2f9076b85c9255ae44ae764cb
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed Apr 25 09:41:46 2012 +0200

    v4l2: improve timestamp code
    
    Sample the pipeline clock and device clock closer to eachother to reduce jitter.
    Don't subtract the frame duration from the timestamp when we can use the device
    timestamps.
    Assume a delay of 1 frame in read-write mode.

commit 46045316cef28e0d892bc5f319b8ca944f3d51cb
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Tue Apr 24 12:37:33 2012 +0200

    v4l2: use driver timestamps
    
    Use the drive timestamps for timestamping outgoing buffers.