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 665412 - matroskamux: jpeg muxing regression
matroskamux: jpeg muxing regression
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal blocker
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-02 16:37 UTC by Nicola
Modified: 2011-12-03 18:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
matroskaparse: do not write incorrect files when tags are seen early (2.33 KB, patch)
2011-12-03 18:22 UTC, Vincent Penquerc'h
none Details | Review
matroskaparse: warn if accumulating headers after they were pushed (913 bytes, patch)
2011-12-03 18:45 UTC, Vincent Penquerc'h
committed Details | Review

Description Nicola 2011-12-02 16:37:26 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.
Comment 1 Vincent Penquerc'h 2011-12-02 17:41:08 UTC
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.
Comment 2 Vincent Penquerc'h 2011-12-02 18:11:54 UTC
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.
Comment 3 Vincent Penquerc'h 2011-12-03 18:22:58 UTC
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...
Comment 4 Vincent Penquerc'h 2011-12-03 18:25:01 UTC
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.
Comment 5 Vincent Penquerc'h 2011-12-03 18:45:27 UTC
Created attachment 202723 [details] [review]
matroskaparse: warn if accumulating headers after they were pushed
Comment 6 Vincent Penquerc'h 2011-12-03 18:47:43 UTC
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.