PR #26046 opened by Baptiste Coudurier (bcoudurier)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26046
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26046.patch

ISO/IEC 14496-14:2020 section 6.4 requires both the in-movie and in-preview 
bits in the MP4 track header. Set the preview bit independently of the track 
enabled state.




>From 9539550250dca9b83399903a5126711a7c2a9d28 Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Fri, 13 Nov 2026 21:13:52 -0800
Subject: [PATCH] avformat/movenc: set the preview flag on MP4 tracks

ISO/IEC 14496-14:2020 section 6.4 requires both the in-movie and in-preview 
bits in the MP4 track header. Set the preview bit independently of the track 
enabled state.
---
 libavformat/movenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index c3fa66d816c..99c0629a082 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4168,6 +4168,8 @@ static int mov_write_tkhd_tag(AVIOContext *pb, 
MOVMuxContext *mov,
             display_matrix = (uint32_t *)sd->data;
     }
 
+    if (mov->mode == MODE_MP4)
+        flags |= MOV_TKHD_FLAG_IN_PREVIEW;
     if (track->flags & MOV_TRACK_ENABLED)
         flags |= MOV_TKHD_FLAG_ENABLED;
 
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to