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 563133 - oggmux outputs a broken ogg when input contains discont buffers
oggmux outputs a broken ogg when input contains discont buffers
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-03 16:32 UTC by Alessandro Decina
Modified: 2011-05-19 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
output file without the patch (730.21 KB, application/octet-stream)
2008-12-03 16:50 UTC, Alessandro Decina
Details
output file with the patch applied (730.21 KB, application/octet-stream)
2008-12-03 16:51 UTC, Alessandro Decina
Details
log (62.57 KB, text/plain)
2008-12-03 19:35 UTC, Alessandro Decina
Details
log (791.65 KB, text/plain)
2008-12-03 20:03 UTC, Alessandro Decina
Details

Description Alessandro Decina 2008-12-03 16:32:04 UTC
Since http://webcvs.freedesktop.org/gstreamer/gst-plugins-base/ext/theora/theoraenc.c?r1=1.67&r2=1.68 has been applied, recording an ogg with
pitivi produces a broken file.
The problem seems to be here http://webcvs.freedesktop.org/gstreamer/gst-plugins-base/ext/ogg/gstoggmux.c?view=diff&r1=1.85&r2=1.86

changing the code from:

  if (GST_BUFFER_IS_DISCONT (buf)) {
    packet.packetno++;
    /* No public API for this; hack things in */
    pad->stream.pageno++;
    force_flush = TRUE;
  }

to:

  if (GST_BUFFER_IS_DISCONT (buf))
    force_flush = TRUE;

fixes the bug. It's not clear to me why oggmux is incrementing packetno
and pageno there. 

It also works if I revert the theoraenc change, as the if is never executed.
Comment 1 Alessandro Decina 2008-12-03 16:50:00 UTC
Created attachment 123878 [details]
output file without the patch
Comment 2 Alessandro Decina 2008-12-03 16:51:42 UTC
Created attachment 123879 [details]
output file with the patch applied
Comment 3 Michael Smith 2008-12-03 18:13:56 UTC
Can you be more specific than "a broken ogg"?

The intent of that if() is to retain the information about there being a discontinuity here; this may be useful in some cases but is probably wrong in others.

Comment 4 Alessandro Decina 2008-12-03 19:35:29 UTC
Created attachment 123896 [details]
log

Here's the output of

gst-launch filesrc location=~/Desktop/broken.ogg ! decodebin ! fakesink sync=true -v --gst-debug=basesink:5 >broken.log 2>&1

as you can see there are gaps in the timestamps
Comment 5 Alessandro Decina 2008-12-03 20:03:34 UTC
Created attachment 123897 [details]
log

Output of the same pipeline decoding working.ogg
The timestamps are continuous here and playback is normal.
Comment 6 Michael Smith 2008-12-03 20:20:52 UTC
So this is because theoradec drops all buffers after a discont until a keyframe.

The actual ogg file seems fine.

So I guess another reasonable question would be: why are you getting theora frames with DISCONT set on non-keyframes in the muxer?
Comment 7 Alessandro Decina 2008-12-03 22:57:48 UTC
The disconts in my case were due to http://bugzilla.gnome.org/show_bug.cgi?id=563143. With the fix applied everything works
fine.

theoraenc still marks as discont two buffers if their timestamps
are too far apart. I tested that case though and the result is playable
with totem and vlc, while mplayer spits warnings on stdout (Ogg : bad packet in stream 0)

If you say that it's fine in ogg to have pageno and packetno 
non continuous and given that mplayer is probably just broken, i think this bug can be closed as invalid.
Comment 8 Sebastian Dröge (slomo) 2011-05-19 09:18:12 UTC
I think it's fine to have discontinous page/packet numbers in Ogg, please reopen if this is wrong ;)