[FFmpeg-devel] [PATCH 1/4] libavformat/movenc: add dnxhr compatibility for apple players

Mark Reid mindmark at gmail.com
Tue Jul 19 02:37:49 EEST 2016


On Sun, Jul 17, 2016 at 4:35 AM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Sat, Jul 16, 2016 at 07:37:36PM -0700, Mark Reid wrote:
>> ---
>>  libavcodec/dnxhddec.c |  3 +++
>>  libavformat/movenc.c  | 19 ++++++++++++++-----
>>  2 files changed, 17 insertions(+), 5 deletions(-)
>
> this should be split
> a single patch changing both libs is a bit suspicous API wise
>
>
>>
>> diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
>> index 5b60326..4c6f708 100644
>> --- a/libavcodec/dnxhddec.c
>> +++ b/libavcodec/dnxhddec.c
>> @@ -204,6 +204,9 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
>>      }
>>
>>      cid = AV_RB32(buf + 0x28);
>> +    if (cid >= 1270 && cid <= 1274)
>> +        ctx->avctx->codec_tag = MKTAG('A','V','d','h');
>
> codec_tag is documented as:
> * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
>
> this sets it in the decoder by libavcodec though
>

okay, in that case I'll have to remove the same thing from the encoder patch.
I saw some other codecs doing it so I assumed it was okay.

I'll try putting this logic somewhere in movenc using the dnxhd
profiles in a separate patch instead.

>
>> +
>>      if ((ret = dnxhd_init_vlc(ctx, cid, bitdepth)) < 0)
>>          return ret;
>>      if (ctx->mbaff && ctx->cid_table->cid != 1260)
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index d614933..7906f83 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -32,6 +32,7 @@
>>  #include "isom.h"
>>  #include "avc.h"
>>  #include "libavcodec/ac3_parser.h"
>> +#include "libavcodec/dnxhddata.h"
>>  #include "libavcodec/get_bits.h"
>>  #include "libavcodec/put_bits.h"
>>  #include "libavcodec/vc1_common.h"
>
>> @@ -1070,11 +1071,7 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
>>      int cid;
>>
>>      if (track->vos_data && track->vos_len > 0x29) {
>> -        if (track->vos_data[0] == 0x00 &&
>> -            track->vos_data[1] == 0x00 &&
>> -            track->vos_data[2] == 0x02 &&
>> -            track->vos_data[3] == 0x80 &&
>> -            (track->vos_data[4] == 0x01 || track->vos_data[4] == 0x02)) {
>> +        if (avpriv_dnxhd_parse_header_prefix(track->vos_data) != 0) {
>>              /* looks like a DNxHD bit stream */
>>              interlaced = (track->vos_data[5] & 2);
>>              cid = AV_RB32(track->vos_data + 0x28);
>
> is this a separateable change that could be in its own patch ?
>

okay, I'll send a separate patch for this section. It can be tested
with -vtag flag. Thanks for taking the time to review.

> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Dictatorship: All citizens are under surveillance, all their steps and
> actions recorded, for the politicians to enforce control.
> Democracy: All politicians are under surveillance, all their steps and
> actions recorded, for the citizens to enforce control.
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list