GNOME Bugzilla – Bug 614460
matroskademux: wrong H.264 demux in some file
Last modified: 2010-04-07 10:52:13 UTC
I found a H264 video which was not played correctly. The matroskademux element seems to lost some H264 data. I made a short sample (~7MB, about 12 seconds):
With the following command, video stops after about 5 seconds from the start.
$ gst-launch filesrc location=gst-matroskademux.mkv ! matroskademux ! ffdec_h264 ! ffmpegcolorspace ! xvimagesink
It can be played correctly using ffdemux_matroska instead of matroskademux .
$ gst-launch filesrc location=gst-matroskademux.mkv ! ffdemux_matroska ! ffdec_h264 ! ffmpegcolorspace ! xvimagesink
Created attachment 157606 [details] [review]
Disable syncing for non-subtitle streams
It looks like this sample is not really muxed appropriately interleaved, that is, the audio data comes in rather big chunks, e.g.
| + SimpleBlock (key, track number 2, 8 frame(s), timecode 4.864s = 00:00:04.864000000)
| + Frame with size 7423
| + Frame with size 7488
| + Frame with size 7785
| + Frame with size 7716
| + Frame with size 8319
| + Frame with size 8827
| + Frame with size 8475
| + Frame with size 7676
| + SimpleBlock (key, track number 2, 8 frame(s), timecode 5.547s = 00:00:05.547000000)
| + Frame with size 7684
| + Frame with size 8208
| + Frame with size 7731
| + Frame with size 8097
| + Frame with size 7886
| + Frame with size 7983
| + Frame with size 8402
| + Frame with size 8995
This leads to lots of newsegment events from matroskademux resync mechanics.
I am not sure what can be done with such irregular interleaving. Pending other suggestions or inspiration for some creative heuristic, attached patch naively restricts the current sync done to subtitle tracks only (which is/was likely the intention in the first place).
It turns out that increasing the lag to 1 sec (in stead of 0.5 sec) also works in this case, if there were arguments to go this way instead ...
1 second for the gaps is fine too I guess... I don't care much, both are workarounds ;)
After bug #611194 is fixed the resyncing should happen for all streams though
Mark, please push one of the two possible patches to get this fixed before -good freezes again :)
I did not realize things were turning cold again ;)
Let's stick to the original one:
Author: Mark Nauwelaerts <email@example.com>
Date: Wed Mar 31 17:54:21 2010 +0200
matroskademux: restrict resyncing to subtitle tracks
This should prevent skipping audio or video in not so well interleaved