[FFmpeg-soc] [Patch]Mxf muxer 0.0.1

Michael Niedermayer michaelni at gmx.at
Fri Aug 15 14:22:05 CEST 2008


On Fri, Aug 15, 2008 at 03:00:11PM +0800, zhentan feng wrote:
> Hi
> 
> 2008/8/15 Michael Niedermayer <michaelni at gmx.at>
> 
> > On Fri, Aug 15, 2008 at 01:03:52AM +0800, zhentan feng wrote:
> > > Hi
> > >
> > > 2008/8/14 Michael Niedermayer <michaelni at gmx.at>
> > >
> > > > On Thu, Aug 14, 2008 at 11:41:01AM +0800, zhentan feng wrote:
> > [...]
> > > > >
> > > > >
> > > > > >
> > > > > > [...]
> > > > > > > +static const MXFCodecUL mxf_essence_container_uls[] = {
> > > > > > > +    // picture essence container
> > > > > > > +    { {
> > > > > >
> > > >
> > 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 */
> > > > > > > +    // audio essence conatiner 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 },
> > > > > > > +};
> > > > > >
> > > > > > duplicate
> > > > > >
> > > > >
> > > > > I tried to extract this code ,however, we muxing by CodecID type to
> > get
> > > > UL,
> > > > > but one CodecID have different ULs, such as CODEC_ID_PCM_S16LE.
> > > > >
> > > > > so when checking each item in mxf_essence_container_uls for streams
> > to
> > > > build
> > > > > essence container references, we can not decide which ul to use only
> > by
> > > > > CodecID type.
> > > > > But we actually know which type we should mux, so just write what
> > will be
> > > > > muxed type in the table.
> > > >
> > > > no reason not the share the tables, either CODEC_ID_PCM_S16LE must be
> > > > special
> > > > handled or the UL used for muxing can be the first CODEC_ID_PCM_S16LE
> > in
> > > > the
> > > > table.
> > > >
> > >
> > > hmm, to get the ul when muxing, i think it is not enough only by CodecID
> > > type.
> > > Is it necessary to add some flag in the table( or get information from
> > some
> > > api in FFmpeg) to distinguish one CodecID type having different uls?
> >
> > Either
> > A. MXF supports generic 16bit PCM, in which case it has one (or more)
> >   identifers for it and any of them can be used at will
> > or
> > B. MXF does not support generic 16bit PCM but supports just 16bit PCM with
> >   a finite set of fixed samplerates/ channels in which case a different
> >   identifer might need to be choosen for each sample rate or channel count.
> >   in that case a simple
> >   if(codec_id == CODEC_ID_PCM_S16LE && sample_rate==123) write(aaaa); can
> >   be used.
> >
> > I do not see a problem with sharing the table
> >
> >
> > >
> > >
> > > >
> > > >
> > > > >
> > > > > on the other side, demuxer can get the correct CodecID type by uls,
> > uls
> > > > are
> > > > > unique.
> > > > >
> > > > >
> > > > > >
> > > > > >
> > > > > > > +
> > > > > > > +/**
> > > > > > > + * SMPTE RP210 http://www.smpte-ra.org/mdd/index.html
> > > > > > > + */
> > > > > > > +static const MXFLocalTagPair mxf_local_tag_batch[] = {
> > > > > > > +    // preface set
> > > > > > > +    { 0x3C0A,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x01,0x15,0x02,0x00,0x00,0x00,0x00}},
> > > > > > /* Instance UID */
> > > > > > > +    { 0x3B02,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x04,0x00,0x00}},
> > > > > > /* Last Modified Date */
> > > > > > > +    { 0x3B05,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x01,0x02,0x01,0x05,0x00,0x00,0x00}},
> > > > > > /* Version */
> > > > > > > +    { 0x3B06,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x04,0x00,0x00}},
> > > > > > /* Identifications reference */
> > > > > > > +    { 0x3B03,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x01,0x00,0x00}},
> > > > > > /* Content Storage reference */
> > > > > > > +    { 0x3B09,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x03,0x00,0x00,0x00,0x00}},
> > > > > > /* Operational Pattern UL */
> > > > > > > +    { 0x3B0A,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x10,0x02,0x01,0x00,0x00}},
> > > > > > /* Essence Containers UL batch */
> > > > > > > +    { 0x3B0B,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x10,0x02,0x02,0x00,0x00}},
> > > > > > /* DM Schemes UL batch */
> > > > > > > +    // Identification
> > > > > > > +    { 0x3C09,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x01,0x00,0x00,0x00}},
> > > > > > /* This Generation UID */
> > > > > > > +    { 0x3C01,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x02,0x01,0x00,0x00}},
> > > > > > /* Company Name */
> > > > > > > +    { 0x3C02,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x03,0x01,0x00,0x00}},
> > > > > > /* Product Name */
> > > > > > > +    { 0x3C04,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x04,0x00,0x00,0x00}},
> > > > > > /* Version String */
> > > > > > > +    { 0x3C05,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x07,0x00,0x00,0x00}},
> > > > > > /* Product ID */
> > > > > > > +    { 0x3C06,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x03,0x00,0x00}},
> > > > > > /* Modification Date */
> > > > > > > +    // Content Storage
> > > > > > > +    { 0x1901,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x05,0x01,0x00,0x00}},
> > > > > > /* Package strong reference batch */
> > > > > > > +    // Essence Container Data
> > > > > > > +    { 0x2701,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x06,0x01,0x00,0x00,0x00}},
> > > > > > /* Linked Package UID */
> > > > > > > +    { 0x3F07,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x01,0x03,0x04,0x04,0x00,0x00,0x00,0x00}},
> > > > > > /* BodySID */
> > > > > > > +    // Package
> > > > > > > +    { 0x4401,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x01,0x15,0x10,0x00,0x00,0x00,0x00}},
> > > > > > /* Package UID */
> > > > > > > +    { 0x4405,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x01,0x03,0x00,0x00}},
> > > > > > /* Package Creation Date */
> > > > > > > +    { 0x4404,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x05,0x00,0x00}},
> > > > > > /* Package Modified Date */
> > > > > > > +    { 0x4403,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x05,0x00,0x00}},
> > > > > > /* Tracks Strong reference array */
> > > > > > > +    { 0x4701,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}},
> > > > > > /* Descriptor */
> > > > > > > +    // Track
> > > > > > > +    { 0x4801,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x07,0x01,0x01,0x00,0x00,0x00,0x00}},
> > > > > > /* Track ID */
> > > > > > > +    { 0x4804,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x03,0x00,0x00}},
> > > > > > /* Track Numberr */
> > > > > > > +    { 0x4B01,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x30,0x04,0x05,0x00,0x00,0x00,0x00}},
> > > > > > /* Edit Rate */
> > > > > > > +    { 0x4B02,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x03,0x00,0x00}},
> > > > > > /* Origin */
> > > > > > > +    { 0x4803,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x04,0x00,0x00}},
> > > > > > /* Sequence reference */
> > > > > > > +    // Sequence
> > > > > > > +    { 0x0201,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x07,0x01,0x00,0x00,0x00,0x00,0x00}},
> > > > > > /* Data Definition UL */
> > > > > > > +    { 0x0202,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x02,0x01,0x01,0x03,0x00,0x00}},
> > > > > > /* Duration */
> > > > > > > +    { 0x1001,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x09,0x00,0x00}},
> > > > > > /* Structural Components reference array */
> > > > > > > +    // Source Clip
> > > > > > > +    { 0x1201,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x07,0x02,0x01,0x03,0x01,0x0A,0x00,0x00}},
> > > > > > /* Start position */
> > > > > > > +    { 0x1101,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x03,0x01,0x00,0x00,0x00}},
> > > > > > /* SourcePackageID */
> > > > > > > +    { 0x1102,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x03,0x02,0x00,0x00,0x00}},
> > > > > > /* SourceTrackID */
> > > > > > > +    // file descriptor
> > > > > > > +    { 0x3F01,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}},
> > > > > > /* sub descriptor uid*/
> > > > > > > +    { 0x3006,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x06,0x01,0x01,0x03,0x05,0x00,0x00,0x00}},
> > > > > > /* Linked Track ID */
> > > > > > > +    { 0x3001,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x00,0x00,0x00,0x00}},
> > > > > > /* SampleRate */
> > > > > > > +    { 0x3004,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x02,0x00,0x00}},
> > > > > > /* essence container ul */
> > > > > > > +    // generic picture eseence descriptor
> > > > > >
> > > > > > > +    { 0x3203,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x02,0x00,0x00,0x00}},
> > > > > > /* stored width */
> > > > > > > +    { 0x3202,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x01,0x00,0x00,0x00}},
> > > > > > /* stored heigth */
> > > > > > > +    { 0x320E,
> > > > > >
> > > >
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}},
> > > > > > /* aspect ratio*/
> > > > > >
> > > > > > i dont know mxf but what do these mean?
> > > > > > the aspect ratio is not stored anywhere ...
> > > >
> > > > ping?
> > > >
> > > I made a mistake in mxfenc.c, i restored time_base, this is obviously
> > wrong.
> > >
> > > I meaned to store aspect ratio of the video.
> > > Is AVCodecContext->sample_aspect_ratio correct?
> >
> > yes ,but it is the sample aspect ratio not the display aspect ratio!
> >
> 
> well, how to get present aspect ratio?
> is it AVCodecContext->width/heigth?

sample_aspect_ratio is the sample aspect ratio, also called pixel aspect ratio
sample_aspect_ratio * width / height is the display aspect ratio

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080815/de514d76/attachment.pgp>


More information about the FFmpeg-soc mailing list