[FFmpeg-devel] [PATCH 4/4] avformat/mxfenc: allow muxing prores

Paul B Mahol onemda at gmail.com
Thu Dec 6 01:18:46 EET 2018


On 12/6/18, Baptiste Coudurier <baptiste.coudurier at gmail.com> wrote:
> Hi Paul
>
> On Wed, Dec 5, 2018 at 9:52 AM Paul B Mahol <onemda at gmail.com> wrote:
>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  libavformat/mxfenc.c | 49 ++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 49 insertions(+)
>>
>> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
>> index 3549b4137d..e481b19ff3 100644
>> --- a/libavformat/mxfenc.c
>> +++ b/libavformat/mxfenc.c
>> @@ -146,6 +146,7 @@ enum ULIndex {
>>      INDEX_JPEG2000,
>>      INDEX_H264,
>>      INDEX_S436M,
>> +    INDEX_PRORES,
>>  };
>>
>>  static const struct {
>> @@ -159,6 +160,7 @@ static const struct {
>>      { AV_CODEC_ID_DNXHD,      INDEX_DNXHD },
>>      { AV_CODEC_ID_JPEG2000,   INDEX_JPEG2000 },
>>      { AV_CODEC_ID_H264,       INDEX_H264 },
>> +    { AV_CODEC_ID_PRORES,     INDEX_PRORES },
>>      { AV_CODEC_ID_NONE }
>>  };
>>
>> @@ -314,6 +316,11 @@ static const MXFContainerEssenceEntry
>> mxf_essence_container_uls[] = {
>>        {
>> 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x17,0x01,0x02,0x00
>> },
>>        {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x01,0x5C,0x00
>> },
>>        mxf_write_s436m_anc_desc },
>> +    // ProRes
>> +    { {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x0d,0x01,0x03,0x01,0x02,0x1c,0x01,0x00
>> },
>> +      {
>> 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x15,0x01,0x17,0x00
>> },
>> +      {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00
>> },
>> +      mxf_write_cdci_desc },
>>      { {
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
>> },
>>        {
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
>> },
>>        {
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
>> },
>> @@ -1945,6 +1952,43 @@ static int mxf_write_partition(AVFormatContext *s,
>> int bodysid,
>>      return 0;
>>  }
>>
>> +static const struct {
>> +    int profile;
>> +    UID codec_ul;
>> +} mxf_prores_codec_uls[] = {
>> +    { FF_PROFILE_PRORES_PROXY,    {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x01,0x00
>> } },
>> +    { FF_PROFILE_PRORES_LT,       {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x02,0x00
>> } },
>> +    { FF_PROFILE_PRORES_STANDARD, {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00
>> } },
>> +    { FF_PROFILE_PRORES_HQ,       {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x04,0x00
>> } },
>> +    { FF_PROFILE_PRORES_4444,     {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x05,0x00
>> } },
>> +    { FF_PROFILE_PRORES_XQ,       {
>> 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x06,0x00
>> } },
>> +};
>> +
>> +static int mxf_parse_prores_frame(AVFormatContext *s, AVStream *st,
>> AVPacket *pkt)
>> +{
>> +    MXFContext *mxf = s->priv_data;
>> +    MXFStreamContext *sc = st->priv_data;
>> +    int i, profile;
>> +
>> +    if (mxf->header_written)
>> +        return 1;
>> +
>> +    sc->codec_ul = NULL;
>> +    profile = st->codecpar->profile;
>>
>
> We should fetch the profile from the bitstream.
>

AFAIK profile is not stored in it.


More information about the ffmpeg-devel mailing list