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 620358 - [matroskademux] Sorenson Squish WebM output seeking issues
[matroskademux] Sorenson Squish WebM output seeking issues
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-02 13:17 UTC by Philip Jägenstedt
Modified: 2010-06-06 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quickfix (1.35 KB, patch)
2010-06-06 12:09 UTC, Philip Jägenstedt
committed Details | Review

Description Philip Jägenstedt 2010-06-02 13:17:21 UTC
http://lachy.id.au/dev/2010/bus.html
http://lachy.id.au/dev/2010/bus-clean.webm
http://lachy.id.au/dev/2010/bus-sorenson.webm
http://lachy.id.au/dev/2010/falls-creek.html
http://lachy.id.au/dev/2010/falls-creek.webm

bus-sorenson.webm and falls-creek.webm are output from the Sorenson Squish encoder at http://www.sorensonmedia.com/vp8/

bus-clean.webm is a version cleaned with mkclean.

All 3 WebM files have playback problems in Totem using current git master.

When seeking in falls-creek.webm, playback simply freezes at the new frame. No amount of play/pause or seeking again can get the file to continue playing. This particular input also causes Opera to deadlock when calling gst_element_get_state on the pipeline after seeking, but I can't reproduce that in Totem and don't know if it's related.

For both bus-clean.webm and bus-sorenson.webm, the duration (18 s) appears to be incorrect, even after remuxing. Seeking anywhere causes the seek handle to jump to 9 s and stay stuck there while the file continues playing to the end.
Comment 1 Sebastian Dröge (slomo) 2010-06-02 13:27:33 UTC
Yes, I can confirm this here. These are problems with matroskademux though, vp8dec/basevideodec doesn't do any seeking magic.
Comment 2 Philip Jägenstedt 2010-06-02 13:32:08 UTC
I guessed that it would be VP8 since even remuxing didn't help, but don't have any stronger leads than that.
Comment 3 Philip Jägenstedt 2010-06-02 13:41:01 UTC
Correction, Lachy tells me that falls-creek.webm is also a mkclean'd version. It's still broken though :)
Comment 4 Philip Jägenstedt 2010-06-02 13:41:46 UTC
Also, after seeking, the audio stops working in bus-sorenson.webm and and bus-clean.webm.
Comment 5 Philip Jägenstedt 2010-06-05 15:38:07 UTC
With the falls-creek-2006.webm input, the audio stream seems to be significant. This pipeline deadlocks when seeking:

gst-launch filesrc location=falls-creek-2006.webm ! decodebin2 name=dec ! queue ! navseek ! xvimagesink dec. ! queue ! fakesink

The following does not, however:

gst-launch filesrc location=falls-creek-2006.webm ! decodebin2 name=dec ! queue ! navseek ! xvimagesink

I'm not sure if the demuxer's internal state will be different if the audio pad is left unlinked or what exactly happens.
Comment 6 Philip Jägenstedt 2010-06-05 15:52:36 UTC
Actually, you can do without the queue elements too, but I don't think that's relevant.
Comment 7 Philip Jägenstedt 2010-06-06 07:26:30 UTC
Remuxing the file to have just the audio track or just video track and the problem goes away...
Comment 8 Philip Jägenstedt 2010-06-06 09:34:07 UTC
My debug pipeline:

filesrc location=~/Videos/test/bus-sorenson.webm ! decodebin2 name=dec ! queue ! navseek ! autovideosink dec. ! queue ! audioconvert ! autoaudiosink

It appears as though after seeking no audio (vorbis) buffers are being delivered, as vorbis_dec_chained is never called again after the flush in gst_matroska_demux_handle_seek_event is done.
Comment 9 Philip Jägenstedt 2010-06-06 12:09:30 UTC
Created attachment 162859 [details] [review]
quickfix

When the keyframe bit of SimpleBlock Flags wasn't set, the buffer was being marked with GST_BUFFER_FLAG_DELTA_UNIT, causing all buffers to be skipped after a seek. This may be a problem with the Sorenson Squish encoder, but arguably the keyframe bit should only be applied to video.
Comment 10 Philip Jägenstedt 2010-06-06 12:10:23 UTC
The patch is just my quickfix, I'll have to see if the keyframe flag *is* set for the audio streams that don't have this problem. If they do, that would be a bit strange.
Comment 11 Philip Jägenstedt 2010-06-06 12:45:26 UTC
Having poked around a bit, some other test files I had didn't use SimpleBlock for audio. Looking at the code, I think any file which does and doesn't set the keyframe flag for the audio tracks (which wouldn't make sense) would suffer from the same problem.
Comment 12 Sebastian Dröge (slomo) 2010-06-06 12:58:12 UTC
Yes, I think your patch completely makes sense. Thanks
Comment 13 Sebastian Dröge (slomo) 2010-06-06 13:00:07 UTC
commit b2ff8042d36077ce01e82e28efaf4e6f5d21391b
Author: Philip Jägenstedt <philipj@opera.com>
Date:   Sun Jun 6 14:03:53 2010 +0200

    matroskademux: Ignore keyframe flag for non-video streams
    
    When the keyframe bit of SimpleBlock Flags wasn't set, the buffer was being
    marked with GST_BUFFER_FLAG_DELTA_UNIT, causing all buffers to be skipped
    after a seek. This may be a problem with the Sorenson Squish encoder, but
    arguably the keyframe bit should only be applied to video.
    
    Fixes bug #620358.