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 699398 - mpegvideoparse: couple of issues
mpegvideoparse: couple of issues
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-01 15:27 UTC by Matej Knopp
Modified: 2013-05-04 19:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
don't compare sequence header size (1.11 KB, patch)
2013-05-01 15:28 UTC, Matej Knopp
committed Details | Review
don't send buffers until sequence header is parsed (886 bytes, patch)
2013-05-01 15:28 UTC, Matej Knopp
reviewed Details | Review

Description Matej Knopp 2013-05-01 15:27:09 UTC
When encountering new sequence header, the parser compares its size to previous one and when it differs it updates codec data and sends caps again. This is not necessary. Unless the actual header changes (first 11 bytes) the quantization matrices in codec data should not be updated, otherwise it causes unnecessary decoder reopen. 

Second issue is that when starting the parsing in the middle of GOP, the parser outputs frames before it has chance to parse the sequence header. This results in completely wrong caps (i.e. mpegversion=1 for mpeg 2).
Comment 1 Matej Knopp 2013-05-01 15:28:08 UTC
Created attachment 242999 [details] [review]
don't compare sequence header size
Comment 2 Matej Knopp 2013-05-01 15:28:29 UTC
Created attachment 243000 [details] [review]
don't send buffers until sequence header is parsed
Comment 3 Sebastian Dröge (slomo) 2013-05-03 10:54:23 UTC
Comment on attachment 242999 [details] [review]
don't compare sequence header size

commit 946ffd0da5a7bd9b004f02e306e061d1b7f52b4b
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Wed May 1 17:19:07 2013 +0200

    mpegvideoparse: don't compare buffer size when checking whether to update caps
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699398
Comment 4 Sebastian Dröge (slomo) 2013-05-03 10:55:41 UTC
Review of attachment 243000 [details] [review]:

Is this still needed after

commit f1a6d84a6c4595a94c5654131a74b6a979f53a04
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Wed May 1 17:36:47 2013 +0100

    mpegvideoparse: don't announce incomplete source caps
    
    Don't send any source caps yet if we're still in
    drop-buffers-until-we-get-a-sequence-header mode.
    
    Fixes transmuxing of many MPEG-TS/PS streams into
    formats which require things like width, height or
    codec_data on the input caps.
    
    Also fixes issues when using playbin with decoder
    sinks that want width/height etc.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695879

::: gst/videoparsers/gstmpegvideoparse.c
@@ +480,3 @@
         ret = TRUE;
+      if (!mpvparse->config)
+        ret = FALSE;

Wouldn't this cause the frames before we have a config to be either dropped or be sent together with the next frame after we got a config? I.e. either lose data or accumulate multiple frames plus config in the middle in a single buffer?
Comment 5 Matej Knopp 2013-05-03 11:50:22 UTC
It shouldn't be needed anymore. I think it should cause the parser to skip it, but I might be wrong.
Comment 6 Tim-Philipp Müller 2013-05-04 19:49:35 UTC
I also think it shouldn't be needed any more, so let's close this.