diff mbox series

[FFmpeg-devel] avformat/avidec: recognize H265 fourcc as hevc

Message ID 20200306201850.31668-1-onemda@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] avformat/avidec: recognize H265 fourcc as hevc
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Paul B Mahol March 6, 2020, 8:18 p.m. UTC
Fixes decoding of came2_2020-01-13__20-38-58_21-00-00__Chn2.avi

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavformat/avidec.c | 2 ++
 libavformat/riff.c   | 1 +
 2 files changed, 3 insertions(+)

Comments

Michael Niedermayer March 6, 2020, 10:17 p.m. UTC | #1
On Fri, Mar 06, 2020 at 09:18:50PM +0100, Paul B Mahol wrote:
> Fixes decoding of came2_2020-01-13__20-38-58_21-00-00__Chn2.avi
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavformat/avidec.c | 2 ++
>  libavformat/riff.c   | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index 412e4a8479..7fdc0fbf8b 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -832,6 +832,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>                          st->need_parsing = AVSTREAM_PARSE_FULL;
>                      if (st->codecpar->codec_id == AV_CODEC_ID_RV40)
>                          st->need_parsing = AVSTREAM_PARSE_NONE;
> +                    if (st->codecpar->codec_id == AV_CODEC_ID_HEVC)
> +                        st->need_parsing = AVSTREAM_PARSE_FULL;

why does this not check for the codec_tag ?
the addition of a new tag in the table below makes this patch look like it
possibly affects only that tag

Thanks

>  
>                      if (st->codecpar->codec_tag == 0 && st->codecpar->height > 0 &&
>                          st->codecpar->extradata_size < 1U << 30) {
> diff --git a/libavformat/riff.c b/libavformat/riff.c
> index 3679b181df..d3719c29c2 100644
> --- a/libavformat/riff.c
> +++ b/libavformat/riff.c
> @@ -497,6 +497,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
>  
>  const AVCodecTag ff_codec_bmp_tags_unofficial[] = {
>      { AV_CODEC_ID_HEVC,         MKTAG('H', 'E', 'V', 'C') },
> +    { AV_CODEC_ID_HEVC,         MKTAG('H', '2', '6', '5') },
>      { AV_CODEC_ID_NONE,         0 }
>  };
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Paul B Mahol March 7, 2020, 7:23 a.m. UTC | #2
On 3/6/20, Michael Niedermayer <michaelni@gmx.at> wrote:
> On Fri, Mar 06, 2020 at 09:18:50PM +0100, Paul B Mahol wrote:
>> Fixes decoding of came2_2020-01-13__20-38-58_21-00-00__Chn2.avi
>>
>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> ---
>>  libavformat/avidec.c | 2 ++
>>  libavformat/riff.c   | 1 +
>>  2 files changed, 3 insertions(+)
>>
>> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
>> index 412e4a8479..7fdc0fbf8b 100644
>> --- a/libavformat/avidec.c
>> +++ b/libavformat/avidec.c
>> @@ -832,6 +832,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>>                          st->need_parsing = AVSTREAM_PARSE_FULL;
>>                      if (st->codecpar->codec_id == AV_CODEC_ID_RV40)
>>                          st->need_parsing = AVSTREAM_PARSE_NONE;
>> +                    if (st->codecpar->codec_id == AV_CODEC_ID_HEVC)
>> +                        st->need_parsing = AVSTREAM_PARSE_FULL;
>
> why does this not check for the codec_tag ?
> the addition of a new tag in the table below makes this patch look like it
> possibly affects only that tag

Are you sure about this?
Do you have other file(s) and can prove its not needed?

> Thanks
>
>>
>>                      if (st->codecpar->codec_tag == 0 &&
>> st->codecpar->height > 0 &&
>>                          st->codecpar->extradata_size < 1U << 30) {
>> diff --git a/libavformat/riff.c b/libavformat/riff.c
>> index 3679b181df..d3719c29c2 100644
>> --- a/libavformat/riff.c
>> +++ b/libavformat/riff.c
>> @@ -497,6 +497,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
>>
>>  const AVCodecTag ff_codec_bmp_tags_unofficial[] = {
>>      { AV_CODEC_ID_HEVC,         MKTAG('H', 'E', 'V', 'C') },
>> +    { AV_CODEC_ID_HEVC,         MKTAG('H', '2', '6', '5') },
>>      { AV_CODEC_ID_NONE,         0 }
>>  };
>>
>> --
>> 2.17.1
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The educated differ from the uneducated as much as the living from the
> dead. -- Aristotle
>
Michael Niedermayer March 7, 2020, 10:46 p.m. UTC | #3
On Sat, Mar 07, 2020 at 08:23:34AM +0100, Paul B Mahol wrote:
> On 3/6/20, Michael Niedermayer <michaelni@gmx.at> wrote:
> > On Fri, Mar 06, 2020 at 09:18:50PM +0100, Paul B Mahol wrote:
> >> Fixes decoding of came2_2020-01-13__20-38-58_21-00-00__Chn2.avi
> >>
> >> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> >> ---
> >>  libavformat/avidec.c | 2 ++
> >>  libavformat/riff.c   | 1 +
> >>  2 files changed, 3 insertions(+)
> >>
> >> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> >> index 412e4a8479..7fdc0fbf8b 100644
> >> --- a/libavformat/avidec.c
> >> +++ b/libavformat/avidec.c
> >> @@ -832,6 +832,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >>                          st->need_parsing = AVSTREAM_PARSE_FULL;
> >>                      if (st->codecpar->codec_id == AV_CODEC_ID_RV40)
> >>                          st->need_parsing = AVSTREAM_PARSE_NONE;
> >> +                    if (st->codecpar->codec_id == AV_CODEC_ID_HEVC)
> >> +                        st->need_parsing = AVSTREAM_PARSE_FULL;
> >
> > why does this not check for the codec_tag ?
> > the addition of a new tag in the table below makes this patch look like it
> > possibly affects only that tag
> 
> Are you sure about this?
> Do you have other file(s) and can prove its not needed?

i think you misunderstood me
i dont know at all, i was just asking if you know because the
patch looked like its added for the new tag

[...]
diff mbox series

Patch

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 412e4a8479..7fdc0fbf8b 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -832,6 +832,8 @@  FF_ENABLE_DEPRECATION_WARNINGS
                         st->need_parsing = AVSTREAM_PARSE_FULL;
                     if (st->codecpar->codec_id == AV_CODEC_ID_RV40)
                         st->need_parsing = AVSTREAM_PARSE_NONE;
+                    if (st->codecpar->codec_id == AV_CODEC_ID_HEVC)
+                        st->need_parsing = AVSTREAM_PARSE_FULL;
 
                     if (st->codecpar->codec_tag == 0 && st->codecpar->height > 0 &&
                         st->codecpar->extradata_size < 1U << 30) {
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 3679b181df..d3719c29c2 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -497,6 +497,7 @@  const AVCodecTag ff_codec_bmp_tags[] = {
 
 const AVCodecTag ff_codec_bmp_tags_unofficial[] = {
     { AV_CODEC_ID_HEVC,         MKTAG('H', 'E', 'V', 'C') },
+    { AV_CODEC_ID_HEVC,         MKTAG('H', '2', '6', '5') },
     { AV_CODEC_ID_NONE,         0 }
 };