diff mbox series

[FFmpeg-devel,1/2] avformat/mov: always parse video headers

Message ID 20210129172401.681-2-nicolas.gaullier@cji.paris
State New
Headers show
Series Enhance progressive content detection | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate fail Make fate failed
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

Nicolas Gaullier Jan. 29, 2021, 5:24 p.m. UTC
This is aligned with current code of matroskadec.
Fixes field_order reported by ffprobe for MP4 H264, for example.
---
 libavformat/mov.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Paul B Mahol Jan. 29, 2021, 10:45 p.m. UTC | #1
Why is AV1 touched?

On Fri, Jan 29, 2021 at 6:24 PM Nicolas Gaullier <nicolas.gaullier@cji.paris>
wrote:

> This is aligned with current code of matroskadec.
> Fixes field_order reported by ffprobe for MP4 H264, for example.
> ---
>  libavformat/mov.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index ad0b9a58d3..b5e012190b 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -2461,12 +2461,13 @@ static int mov_finalize_stsd_codec(MOVContext *c,
> AVIOContext *pb,
>      case AV_CODEC_ID_VP9:
>          st->need_parsing = AVSTREAM_PARSE_FULL;
>          break;
> -    case AV_CODEC_ID_AV1:
> -        st->need_parsing = AVSTREAM_PARSE_HEADERS;
> -        break;
>      default:
>          break;
>      }
> +    if (!st->need_parsing && st->codecpar->codec_type ==
> AVMEDIA_TYPE_VIDEO
> +        && st->codecpar->codec_id != AV_CODEC_ID_HEVC)
> +        st->need_parsing = AVSTREAM_PARSE_HEADERS;
> +
>      return 0;
>  }
>
> --
> 2.27.0.windows.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".
Nicolas Gaullier Jan. 29, 2021, 11:07 p.m. UTC | #2
>De : Paul B Mahol <onemda@gmail.com> 
>Envoyé : vendredi 29 janvier 2021 23:46
>À : FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
>Cc : Nicolas Gaullier <nicolas.gaullier@cji.paris>
>Objet : Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: always parse video headers
>
>Why is AV1 touched?
Well, AV1 is supposed to be left untouched but follows now the general case (except HEVC which has rich extradata and don't need "deep" parsing).
But sorry, I realized with patchwork that I forgot to run fate with SAMPLES set... and so at the end, I have to fix fate results for two items
mov-init-nonkeyframe
mov-zombie
I will take some time next week to check the reason why before commiting the diff (or fixing my patch if there were a real issue).

Nicolas
>On Fri, Jan 29, 2021 at 6:24 PM Nicolas Gaullier <mailto:nicolas.gaullier@cji.paris> wrote:
>This is aligned with current code of matroskadec.
>Fixes field_order reported by ffprobe for MP4 H264, for example.
>---
> libavformat/mov.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/libavformat/mov.c b/libavformat/mov.c
>index ad0b9a58d3..b5e012190b 100644
>--- a/libavformat/mov.c
>+++ b/libavformat/mov.c
>@@ -2461,12 +2461,13 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
>     case AV_CODEC_ID_VP9:
>         st->need_parsing = AVSTREAM_PARSE_FULL;
>         break;
>-    case AV_CODEC_ID_AV1:
>-        st->need_parsing = AVSTREAM_PARSE_HEADERS;
>-        break;
>     default:
>         break;
>     }
>+    if (!st->need_parsing && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO
>+        && st->codecpar->codec_id != AV_CODEC_ID_HEVC)
>+        st->need_parsing = AVSTREAM_PARSE_HEADERS;
>+
>     return 0;
> }
>
>-- 
>2.27.0.windows.1
>
>_______________________________________________
>ffmpeg-devel mailing list
>mailto:ffmpeg-devel@ffmpeg.org
>https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>To unsubscribe, visit link above, or email
>mailto:ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index ad0b9a58d3..b5e012190b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2461,12 +2461,13 @@  static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
     case AV_CODEC_ID_VP9:
         st->need_parsing = AVSTREAM_PARSE_FULL;
         break;
-    case AV_CODEC_ID_AV1:
-        st->need_parsing = AVSTREAM_PARSE_HEADERS;
-        break;
     default:
         break;
     }
+    if (!st->need_parsing && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO
+        && st->codecpar->codec_id != AV_CODEC_ID_HEVC)
+        st->need_parsing = AVSTREAM_PARSE_HEADERS;
+
     return 0;
 }