GNOME Bugzilla – Bug 665412
matroskamux: jpeg muxing regression
Last modified: 2011-12-03 18:49:05 UTC
Try the following (the mjpeg url above is public available): gst-launch -v -m -t souphttpsrc location=http://www.warwick.ac.uk/newwebcam/cgi-bin/webcam.pl?dummy=garb do-timestamp=true is-live=true ! jpegparse ! matroskamux streamable=true ! filesink location=/tmp/test1.mkv the file seems good mkvinfo produce: + Intestazione EBML |+ Tipo documento: matroska |+ Versione tipo documento: 2 |+ Versione tipo documento letta: 2 + Segment, size unknown |+ Tags | + Tag | + Simple | + Name: COMMENTS | + String: "\012\001N\303\230\303\275\023\022" |+ Segment information | + Segment UID: 0xdd 0x48 0xf6 0x59 0xbb 0xcc 0xaa 0xe0 0x45 0x80 0x20 0x48 0xaf 0xba 0xe5 0xc2 | + Timecode scale: 1000000 | + Applicazione muxing: GStreamer plugin version 0.10.30.1 | + Writing application: GStreamer Matroska muxer | + Data: Fri Dec 2 16:30:11 2011 UTC |+ Segment tracks | + Una traccia | + Track number: 1 | + Track type: video | + Track UID: 3516825334 | + Durata predifinita: 1000.000ms (1.000 fps per una traccia video) | + Video track | + Larghezza pixel: 640 (MKVInfo) Espressione catturata now try the pipeline: gst-launch filesrc location=/tmp/test1.mkv ! matroskaparse ! filesink location=/tmp/test2.mkv now mkvinfo give: mkvinfo /tmp/test2.mkv + Intestazione EBML |+ Tipo documento: matroska |+ Versione tipo documento: 2 |+ Versione tipo documento letta: 2 + Segment, size unknown |+ Tags | + Tag | + Simple | + Name: COMMENTS | + String: "\012\001N\303\230\303\275\023\022" |+ Segmenti and the file is unplayable, using the same pipelines with 0.10.30 give mkvinfo /tmp/test2.mkv + Intestazione EBML |+ Tipo documento: matroska |+ Versione tipo documento: 2 |+ Versione tipo documento letta: 2 + Segment, size unknown |+ Segment information | + Segment UID: 0x3e 0x7a 0xaf 0x03 0x61 0x5a 0x37 0x21 0x6d 0x90 0x6d 0xa3 0x57 0xf2 0xd4 0x07 | + Timecode scale: 1000000 | + Applicazione muxing: GStreamer plugin version 0.10.30 | + Writing application: GStreamer Matroska muxer | + Data: Fri Dec 2 16:31:34 2011 UTC |+ Segment tracks | + Una traccia | + Track number: 1 | + Track type: video | + Track UID: 1818821041 | + Durata predifinita: 1000.000ms (1.000 fps per una traccia video) | + Video track | + Larghezza pixel: 640 (MKVInfo) Espressione catturata and the file is playable so this seems a regression in the muxer: if I use good 0.10.30 to produce the file and git version of mastroskaparse the file is fine.
Introduced by: commit 0672232b260096c8879698cae633f6c55fde217a Author: David Schleef <ds@schleef.org> Date: Wed Jun 1 17:04:27 2011 -0700 matroskamux: For streaming files, push tags first I don't know the Matroska format so can't tell if that makes sense. It may be that matroskaparse is confused by this new arrangement, which seems more likely.
FWIW, replacing matroskaparse with matroskademux ! matroskamux keeps the file in working order, so that seems to point a bit more to matroskaparse being the culprit here, and just behaving badly with the new ordering put out by matroskamux.
Created attachment 202717 [details] [review] matroskaparse: do not write incorrect files when tags are seen early Seeing tags was triggering the header flush, but since tags can be written before other header type information, this would cause that other information to not be written to the file. This fixes parsing and rewriting of streamable files created by matroskamux, but seems incomplete, as other information (such as attachments) seem similar enough to warrant the same behavior. However, I don't know the constraints for Matroska about the order in which all the bits of information must be (1), so I'm doing the least invasive patch for now, since it fixes the issue of not being able to parse our own files. (1) http://matroska.org/technical/diagram/index.html seems to put almost everything in the same "segment" bin, implying there is no ordering among those - unless there is strict ordering within the bin, in which case matroskamux is wrong...
This patch fixes parsing/rewriting. I think it only fixes part of the issue though, someone who knows Matroska might have a better idea about the ordering (or lack thereof) needed within a "segment" bin.
Created attachment 202723 [details] [review] matroskaparse: warn if accumulating headers after they were pushed
I just talked to ds, who had that very same patch locally already, which he pushed now. So I'll just add a warning if we try to accumulate headers which are already pushsed.