diff mbox series

[FFmpeg-devel] avformat/movenc: Write 'av01' as a compatible brand when muxing AV1

Message ID 20200617134543.89105-1-derek.buitenhuis@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel] avformat/movenc: Write 'av01' as a compatible brand when muxing AV1 | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate fail Make fate failed

Commit Message

Derek Buitenhuis June 17, 2020, 1:45 p.m. UTC
This is a requirement of the AV1-ISOBMFF spec. Section 2.1.
General Requirements & Brands states:

    * It SHALL have the av01 brand among the compatible brands array of the FileTypeBox

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavformat/movenc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Derek Buitenhuis June 17, 2020, 2:18 p.m. UTC | #1
On 17/06/2020 14:45, Derek Buitenhuis wrote:
> This is a requirement of the AV1-ISOBMFF spec. Section 2.1.
> General Requirements & Brands states:
> 
>     * It SHALL have the av01 brand among the compatible brands array of the FileTypeBox
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  libavformat/movenc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Woops, forgot to update FATE refs. v2 incoming.

- Derek
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 520aaafb74..ddec551017 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4875,7 +4875,7 @@  static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
 {
     MOVMuxContext *mov = s->priv_data;
     int64_t pos = avio_tell(pb);
-    int has_h264 = 0, has_video = 0;
+    int has_h264 = 0, has_av1 = 0, has_video = 0;
     int i;
 
     for (i = 0; i < s->nb_streams; i++) {
@@ -4886,6 +4886,8 @@  static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
             has_video = 1;
         if (st->codecpar->codec_id == AV_CODEC_ID_H264)
             has_h264 = 1;
+        if (st->codecpar->codec_id == AV_CODEC_ID_AV1)
+            has_av1 = 1;
     }
 
     avio_wb32(pb, 0); /* size */
@@ -4925,6 +4927,8 @@  static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
             ffio_wfourcc(pb, "iso2");
             if (has_h264)
                 ffio_wfourcc(pb, "avc1");
+            if (has_av1)
+                ffio_wfourcc(pb, "av01");
         }
     }