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 704193 - avidemux: no PTS nor DTS on decoded frame
avidemux: no PTS nor DTS on decoded frame
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.1.2
Other Linux
: Normal blocker
: 1.1.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-14 12:21 UTC by Arnaud Vrac
Modified: 2013-07-24 07:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
something like this (1.52 KB, patch)
2013-07-19 16:01 UTC, Wim Taymans
committed Details | Review

Description Arnaud Vrac 2013-07-14 12:21:35 UTC
In some cases the libav decoders do not output any timestamp on decoded frames in 1.1. This seems to be due to a regression compared to 1.0 in the videodecoder base class.

To reproduce:

gst-launch-1.0 -v pushfilesrc real-filesrc::location=<path_to_avi_file> ! avidemux ! avdec_mpeg4 ! fakesink silent=false

When avidemux is activated in pull mode it works:

gst-launch-1.0 -v filesrc location=<path_to_avi_file> ! avidemux ! avdec_mpeg4 ! fakesink silent=false

I can see that in the second case the videodecoder logs outputs the following:

videodecoder gstvideodecoder.c:2252:gst_video_decoder_prepare_finish_frame:<avdec_mpeg4-0> no valid PTS, using oldest DTS 0:00:00.291958333
Comment 1 Sebastian Dröge (slomo) 2013-07-15 07:16:36 UTC
Confirmed here, happens with every AVI file probably. In push mode avidemux puts only DTS on buffers, in pull mode both... for whatever reason. Probably related https://bugzilla.gnome.org/show_bug.cgi?id=691481
Comment 2 Arnaud Vrac 2013-07-18 19:28:18 UTC
The problem happens after commit 31312d58 (videodecoder: Don't blindly assign DTS to PTS) in base.
Comment 3 Sebastian Dröge (slomo) 2013-07-19 06:53:08 UTC
Makes sense :)

The problem here is that avidemux puts PTS on buffers depending on if it is in push mode or pull mode. That doesn't feel right to me and should probably be fixed. I don't know why it does that yet
Comment 4 Tim-Philipp Müller 2013-07-19 09:09:17 UTC
Does it know anything about PTS anywaya? Shouldn't it just put DTS?
Comment 5 Sebastian Dröge (slomo) 2013-07-19 09:19:26 UTC
Right, we're talking about avi here... I wonder how it magically guesses the PTS in pull mode :)
Comment 6 Arnaud Vrac 2013-07-19 12:15:51 UTC
In pull mode, the demuxer can know when a buffer is a keyframe by looking into the index. In this case PTS is set to the same value as DTS.
Comment 7 Wim Taymans 2013-07-19 15:54:34 UTC
The video base decoder doesn't set timestamps when only DTS is set on input buffers.
Comment 8 Wim Taymans 2013-07-19 16:01:48 UTC
Created attachment 249645 [details] [review]
something like this

Maybe something like this, set PTS to DTS on sync points if all else fails
Comment 9 Tim-Philipp Müller 2013-07-19 16:02:28 UTC
For video shouldn't there be a parser as well to fix things up? (Which it doesn't actually do yet though, does it?)
Comment 10 Mark Nauwelaerts 2013-07-19 16:59:54 UTC
Though I have not looked at the details, but how does the proposed video base decoder patch relate to something we had there before and got chucked out in commit http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=31312d586e2f5282aa95fa7abbf9413c7f1bda34 ?

While it may not be constructive to note as such (and am somewhat "out of the loop"), this seems another episode in "need to sort out the timestamp stuff", and we seem to have gone as far as possible in that area by means of (only) some "local" patches sprinkled here and there ...
Comment 11 Sebastian Dröge (slomo) 2013-07-22 06:39:52 UTC
Comment on attachment 249645 [details] [review]
something like this

We had that before and it's not valid as David pointed out. PTS is not necessarily equal to DTS for keyframes.


I think the real solution here is to add the required calculations for mapping DTS to PTS to the parsers (and probably additionally the decoders) as discussed in previous discussions about the same topic.
Comment 12 David Schleef 2013-07-23 20:48:19 UTC
I thought that the PTS recovery code in videodecoder handled this case correctly.  It appears it doesn't like the case where there are *no* valid PTS values.  Wim's patch fixes this exact case, which I think is correct.
Comment 13 Sebastian Dröge (slomo) 2013-07-23 21:15:04 UTC
Comment on attachment 249645 [details] [review]
something like this

<slomo> ds: isn't wim's patch settings PTS=DTS in any case if there's no PTS? isn't that exactly what your commit was supposed to change?
<ds> "if there's no PTS"
<ds> previously, it was "always set PTS=DTS"
<slomo> only if !GST_CLOCK_TIME_IS_VALID (frame->pts)
<ds> hrm, maybe I'm confusing this with something else
<ds> in any case, I think handling it later is smarter.
<slomo> ok
Comment 14 Sebastian Dröge (slomo) 2013-07-24 07:29:02 UTC
commit 409cb22253c59e25838a7d57507cbbe980ec102a
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed Jul 24 09:24:45 2013 +0200

    videodecoder: Take DTS as PTS for keyframes as a last resort if we can't calculate any PTS
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704193