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 797292 - mpegts: support for JPEG 2000 is broken
mpegts: support for JPEG 2000 is broken
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-10-16 11:46 UTC by Aaron Boxer
Modified: 2018-11-03 14:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Aaron Boxer 2018-10-16 11:46:56 UTC
The following pipeline used to work:

$ gst-launch-1.0 -v videotestsrc ! openjpegenc ! jpeg2000parse ! mpegtsmux ! tsdemux ! jpeg2000parse ! openjpegdec ! videoconvert ! ximagesink



Now, with gst-plugins-bad master and OpenJPEG master, I get these errors:



:00:00.076905409 26973      0x194c0a0 ERROR                tsdemux tsdemux.c:2795:parse_jp2k_access_unit: Required size (23237) greater than remaining size in buffer (23229)
0:00:00.076924988 26973      0x194c0a0 ERROR                tsdemux tsdemux.c:2807:parse_jp2k_access_unit: Failed to parse JP2K access unit
Comment 1 Nicolas Dufresne (ndufresne) 2018-10-16 12:17:20 UTC
Whoever fixes this should add a jpeg2000 to gat-validate to prevent further regression.
Comment 2 Aaron Boxer 2018-10-16 12:52:24 UTC
Reference bug:  

https://bugzilla.gnome.org/show_bug.cgi?id=753323
Comment 3 Aaron Boxer 2018-10-16 13:10:04 UTC
Annex S of this doc describes J2K elementary stream header:

https://www.itu.int/rec/T-REC-H.222.0-201206-S/en
Comment 4 Aaron Boxer 2018-10-16 14:13:18 UTC
mpegtsmux_prepare_jpeg2000 receives an input J2K buffer of size X,
and adds an elsm header of size 38, to create a buffer of size X+38.

However, the buffer that tsdemux receives has a header of size 46, which triggers an error. If I comment out the code that triggers an error, then the video displays correctly.
Comment 5 Aaron Boxer 2018-10-16 14:14:00 UTC
So, there are 8 more bytes in the demux header.
Comment 6 Aaron Boxer 2018-10-16 14:18:46 UTC
Actually, the header size is the same for both mux and demux, but the demux payload is 8 bytes shorted than the mux payload.
Comment 7 Aaron Boxer 2018-10-16 15:38:43 UTC
So, the problem is: for the very first (preroll) frame, the payload J2K buffer is shifted to the right by 8 bytes, so that the last 8 bytes are missing. This triggers an error condition in the code.
Comment 8 GStreamer system administrator 2018-11-03 14:36:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/802.