[FFmpeg-devel] [PATCH] Clip-Wrapped MXF support (attempt #4)

Maksym Veremeyenko verem
Mon Jan 24 13:27:50 CET 2011


Tomas H?rdin ???????(??):
> Maksym Veremeyenko skrev 2011-01-13 13:14:
[...]
>> From 6127bb2ebba4fb920a578f4ec7c16bee397793c5 Mon Sep 17 00:00:00 2001
>> From: Maksym Veremeyenko <verem at m1.tv>
>> Date: Sun, 19 Sep 2010 12:14:24 +0300
>> Subject: [PATCH 2/6] revert container wrapping detection from r11567
>>
>> ---
>>  libavformat/mxfdec.c |   20 +++++++++++++-------
>>  1 files changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
>> index 6bc6b77..f840e1f 100644
>> --- a/libavformat/mxfdec.c
>> +++ b/libavformat/mxfdec.c
>> @@ -668,13 +668,19 @@ static void *mxf_resolve_strong_ref(MXFContext 
>> *mxf, UID *strong_ref, enum MXFMe
>>
>>  static const MXFContainerUL mxf_essence_container_uls[] = {
>>      // video essence container uls
>> -    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 
>> }, 14, CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
>> -    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 
>> }, 14,    CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 
>> }, 16, CODEC_ID_MPEG2VIDEO, Frame }, /* MPEG-ES Frame wrapped */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xe0,0x02 
>> }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Clip wrapped, 0xe0 MPV 
>> stream id */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x07 
>> }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Custom wrapped, 0x61 
>> ??? stream id */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 
>> }, 16,    CODEC_ID_DVVIDEO, Frame }, /* DV 625 25mbps */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x01 
>> }, 16,    CODEC_ID_DVVIDEO, Frame }, /* DV IEC 625 25mbps */
>>      // sound essence container uls
>> -    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 
>> }, 14, CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
>> -    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 
>> }, 14,       CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream 
>> id */
>> -    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 
>> }, 14, CODEC_ID_PCM_S16LE }, /* D-10 Mapping 50Mbps PAL Extended 
>> Template */
>> -    { { 
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
>> },  0,      CODEC_ID_NONE },
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 
>> }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* BWF Frame wrapped */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 
>> }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* AES Frame wrapped */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 
>> }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0x40 
>> ??? stream id */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x01 
>> }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0xc0 
>> MPA stream id */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x02 
>> }, 16,        CODEC_ID_MP2,  Clip }, /* MPEG-ES Clip wrapped, 0xc0 MPA 
>> stream id */
>> +    { { 
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 
>> }, 14,  CODEC_ID_PCM_S16LE, Frame }, /* D-10 Mapping 50Mbps PAL 
>> Extended Template */
>> +    { { 
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
>> }, 16,       CODEC_ID_NONE, Frame },
>>  };
> 
> This causes a lot of DV samples to fail. For instance, try making an 
> OPAtom file by running http://samples.mplayerhq.hu/DV-raw/voxnews.dv 
> through mxfwrap -a (in MXFLib) and you'll get an UL where byte 14 is 0x7F.

this could be fixed by next patch:

--- libavformat/mxfdec.c.qqq	2011-01-24 14:14:51.527134845 +0200
+++ libavformat/mxfdec.c	2011-01-24 14:17:21.525572709 +0200
@@ -725,6 +725,8 @@
      { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x62,0x02 
}, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 720x59.94P 
100Mbps */
      { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x63,0x01 
}, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 720x50P 
100Mbps */
      { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x63,0x02 
}, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 720x50P 
100Mbps */
+    { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x7F,0x01 
}, 16,    CODEC_ID_DVVIDEO, Frame }, // MXF-GC Frame-wrapped DV-based 
UndefinedSource
+    { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x7F,0x02 
}, 16,    CODEC_ID_DVVIDEO,  Clip }, // MXF-GC Clip-wrapped DV-based 
UndefinedSource

      // sound essence container uls
      { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 
}, 16,  CODEC_ID_PCM_S16LE, Frame }, /* BWF Frame wrapped */

these and additional UIDs could included into 
*0004-add-new-essence-container-uls.patch* or applied later...


-- 
________________________________________
Maksym Veremeyenko



More information about the ffmpeg-devel mailing list