[Bug 740015] New: mpeg4videoparse xvid packed bitstream

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Nov 12 06:12:43 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=740015
  GStreamer | gst-plugins-bad | 1.4.4

           Summary: mpeg4videoparse xvid packed bitstream
    Classification: Platform
           Product: GStreamer
           Version: 1.4.4
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: athoik at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


DivX Networks introduced a hack with their so-called dx50 VOP mode, inserting 
dummy frames into the AVI as placeholders and packing the b-frame itself 
into the same chunk together with the I/P frame it is referencing to.

XviD does that also, but if offering a so-called 'packed bitstream' mode 
also as alternative. IN both cases parser, reading the MPEG4 
frames , would have to get rid of the dummy frames and reorder the 
b-frames such that coding order is achieved in the final output. 

-----------------

The n-vops are inserted into "empty" frames when using packed-mode.
[foo] represents an avi frame, [-] re e.g.

unpacked: [I] [P]  [B] [B] [P]  [B] [B] [P]
packed    [I] [PB] [B] [-] [PB] [B] [-] [P]

The empty frames cannot be set to length=0, because vfw decoding
interprets this as a frame drop and doesnt bother calling the codec.

So to get arround this, divx5.02 inserts a n-vop using the previous
p-vop's timecode. xvid does the same to remain compatible.

-----------------

There is no way to differentiate "packed-n-vops" from real n-vop.
however, packed bitstream can be detected from the divx userdata tag.
the tag takes the form "DivX%dB%d%c", version, build, packed.

-----------------

Packed b-frames: In packed b-frame mode there are fake nvops written
to the output by the encoder. Those are not real nvops but are rather
supposed to be totally ignored by the decoder. As such it is not really
a proper use of nvops but it's become the defacto standard how the b-frame
encoder delay got handled with the AVI container. If you don't want to
mux your output into AVI, use the "-nopacked" switch and there should be
no fake nvops added anymore.

-----------------

Currently the mpeg4videoparse doesn't discard those "fake n-vops" causing
issues in playback. 

The following is what we receive to render function of our sink:

unpacked xvid:

0x000000: 00 00 01 b0 f5 00 00 01 ........
0x000008: b5 09 00 00 01 00 00 00 ........
0x000010: 01 20 08 86 87 ff ff 0a . ......
0x000018: ad 88 82 19 0a 31 00 00 .....1..
0x000020: 01 b2 58 76 69 44 30 30 ..XviD00
0x000028: 34 33 00 00 01 b6 10 00 43......
0x000030: 0c 06 30 47 b6 fe 36 db ..0G..6.
0x000038: f8 db 6f e3 6d bf 8d b6 ..o.m...
0x000040: fe 36 db f8 db 6f e3 6d .6...o.m
0x000048: bf 8d b6 fe 36 db f8 db ....6...
0x000050: 6f e3 6d bf 8d b6 fe 36 o.m....6
0x000058: db f8 db 6f e3 6d bf 8d ...o.m..
0x000060: b6 fe 36 db f8 db 6f e3 ..6...o.
0x000068: 6d bf 8d b6 fe 36 db f8 m....6..

packed xvid:

0x000000: 00 00 01 b0 f5 00 00 01 ........
0x000008: b5 09 00 00 01 00 00 00 ........
0x000010: 01 20 08 86 87 ff ff 0a . ......
0x000018: ad 88 82 19 0a 31 00 00 .....1..
0x000020: 01 b2 44 69 76 58 35 30 ..DivX50
0x000028: 33 62 31 33 39 33 70 00 3b1393p.
0x000030: 00 01 b2 58 76 69 44 30 ...XviD0
0x000038: 30 34 33 00 00 01 b6 10 043.....
0x000040: 00 0c 06 30 47 b6 fe 36 ...0G..6
0x000048: db f8 db 6f e3 6d bf 8d ...o.m..
0x000050: b6 fe 36 db f8 db 6f e3 ..6...o.
0x000058: 6d bf 8d b6 fe 36 db f8 m....6..
0x000060: db 6f e3 6d bf 8d b6 fe .o.m....
0x000068: 36 db f8 db 6f e3 6d bf 6...o.m.

unpacked xvid: 

XviD Packet Dump
0x000000: 00 00 01 b0 f5 00 00 01 ........
0x000008: b5 09 00 00 01 00 00 00 ........
--
XviD Packet Dump
0x000000: 00 00 01 b6 52 22 78 10 ....R"x.
0x000008: b1 93 b1 95 90 be 97 04 ........
--
XviD Packet Dump
0x000000: 00 00 01 b6 91 28 38 29 .....(8)
0x000008: 3f f4 fc a9 b9 a6 3d 06 ?.....=.
--
XviD Packet Dump
0x000000: 00 00 01 b6 91 a5 58 31 ......X1
0x000008: 34 ff fe 8e be 48 e1 ef 4....H..
--
XviD Packet Dump
0x000000: 00 00 01 b6 53 99 dc 14 ....S...
0x000008: be fb eb 62 e5 f0 70 60 ...b..p`
--
XviD Packet Dump
0x000000: 00 00 01 b6 92 9f 98 29 .......)
0x000008: 3f a7 fc 89 b4 b3 83 83 ?.......
--
XviD Packet Dump
0x000000: 00 00 01 b6 93 1c b8 31 .......1
0x000008: 3f ff 4f ff ff 4b ff 09 ?.O..K..
--
XviD Packet Dump
0x000000: 00 00 01 b6 55 11 38 10 ....U.8.
0x000008: b7 8b 56 c1 62 af d8 70 ..V.b..p
--
XviD Packet Dump
0x000000: 00 00 01 b6 94 16 f8 39 .......9
0x000008: 3a 3f fe 08 8e 74 18 9c :?...t..
--
XviD Packet Dump
0x000000: 00 00 01 b6 94 94 18 31 .......1
0x000008: 3d 3f ff 4e 9f d1 bf fa =?.N....
--
XviD Packet Dump
0x000000: 00 00 01 b6 56 88 9c 10 ....V...
0x000008: b7 85 88 78 2f 01 29 3c ...x/.)<


packed xvid: 

XviD Packet Dump
0x000000: 00 00 01 b0 f5 00 00 01 ........
0x000008: b5 09 00 00 01 00 00 00 ........
--
XviD Packet Dump
0x000000: 00 00 01 b6 52 22 78 10 ....R"x.
0x000008: b1 93 b1 95 90 be 97 04 ........
--
XviD Packet Dump
0x000000: 00 00 01 b6 91 28 38 29 .....(8)
0x000008: 3f f4 fc a9 b9 a6 3d 06 ?.....=.
--
XviD Packet Dump
0x000000: 00 00 01 b6 91 a5 58 31 ......X1
0x000008: 34 ff fe 8e be 48 e1 ef 4....H..
--
XviD Packet Dump
0x000000: 00 00 01 b6 52 22 73    ....R"s

--
XviD Packet Dump
0x000000: 00 00 01 b6 53 99 dc 14 ....S...
0x000008: be fb eb 62 e5 f0 70 60 ...b..p`
--
XviD Packet Dump
0x000000: 00 00 01 b6 92 9f 98 29 .......)
0x000008: 3f a7 fc 89 b4 b3 83 83 ?.......
--
XviD Packet Dump
0x000000: 00 00 01 b6 93 1c b8 31 .......1
0x000008: 3f ff 4f ff ff 4b ff 09 ?.O..K..
--
XviD Packet Dump
0x000000: 00 00 01 b6 53 99 d3    ....S

--
XviD Packet Dump
0x000000: 00 00 01 b6 55 11 38 10 ....U.8.
0x000008: b7 8b 56 c1 62 af d8 70 ..V.b..p
--
XviD Packet Dump
0x000000: 00 00 01 b6 94 16 f8 39 .......9
0x000008: 3a 3f fe 08 8e 74 18 9c :?...t..
--
XviD Packet Dump
0x000000: 00 00 01 b6 94 94 18 31 .......1
0x000008: 3d 3f ff 4e 9f d1 bf fa =?.N....
--
XviD Packet Dump
0x000000: 00 00 01 b6 55 11 33    ....U.3

--
XviD Packet Dump
0x000000: 00 00 01 b6 56 88 9c 10 ....V...
0x000008: b7 85 88 78 2f 01 29 3c ...x/.)<
--


Packed XviD has extra packets received on sink and those are causing problems
in rendering.

0x000000: 00 00 01 b6 52 22 73    ....R"s
--
0x000000: 00 00 01 b6 53 99 d3    ....S
--
0x000000: 00 00 01 b6 55 11 33    ....U.3


So if those packets removed and also packed bitstream (DivX503b1393p) removed,
then there will be no difference between packed and unpacked xvid.


More info:
https://bugzilla.gnome.org/show_bug.cgi?id=739196
http://itsjustonesandzeros.blogspot.ca/2007/01/what-is-packed-bitstream.html
http://list.xvid.org/pipermail/xvid-devel/2002-September/000870.html
http://lists.matroska.org/pipermail/matroska-devel/2003-June/000603.html
http://list.xvid.org/pipermail/xvid-devel/2004-March/004091.html
http://list.xvid.org/pipermail/xvid-devel/2014-April/006418.html

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list