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 739968 - v4l2src: outputs bogus DTS
v4l2src: outputs bogus DTS
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-11 15:10 UTC by Jan Schmidt
Modified: 2015-06-04 13:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jan Schmidt 2014-11-11 15:10:04 UTC
v4l2src doesn't explicitly set any DTS on outgoing buffers, which means
basesrc sets a default DTS (0, or segment start). There's no way to prevent
basesrc from that behaviour at the moment, which means that all v4l2src streams start with a buffer where DTS = 0.

For encoded formats, that means that (for example) h264parse starts producing
a stream withmonotonically increasing DTS from 0, and some arbitrarily offset PTS time range - leading to strange muxing.

For raw video, v4l2src can just set DTS = PTS on the output stream, but that
won't work for encoded formats with frame reordering, and I'm not sure what v4l2src should do - or if we should change basesrc to not set that first DTS.
Comment 1 Nicolas Dufresne (ndufresne) 2014-11-11 15:21:52 UTC
Hmm, that's bad from basesrc, I always thought the DTS was to be set as NONE, which would be the correct value. DTS=PTS would be incorrect as you stated.

http://linuxtv.org/downloads/v4l-dvb-apis/buffer.html

According to the spec, from v4l2src point of view, the timestamp is the time when the image was captured. Note, this is generally just an approximation, but it clearly states that the driver can only give PTS. In presence of b-frames, PTS will go forth an back, hence bad clock detection code will fail, and the system (in dev branch only) vs wall clock detection may fail too. Few changes seems needed.
Comment 2 Nicolas Dufresne (ndufresne) 2014-11-11 15:23:25 UTC
(note also that the first DTS in B-frame enable H264 stream is negative. We should let the parser fix it for us and only set what we know.)
Comment 3 Jan Schmidt 2014-11-12 16:56:35 UTC
A simple solution might be to simply make basesrc only set that initial DTS if the first buffer has both DTS *and* PTS unset.
Comment 4 Nicolas Dufresne (ndufresne) 2014-11-12 18:06:30 UTC
If it does not break other sources, I'm fine with that.
Comment 5 Nicolas Dufresne (ndufresne) 2015-04-22 14:40:22 UTC
I believe this is fixed (at least for raw cases) through https://bugzilla.gnome.org/show_bug.cgi?id=747731 ?
Comment 6 Jan Schmidt 2015-04-22 14:55:31 UTC
Yes, should be