The branch, master has been updated
       via  9a34ddc345ddbc4810799fad65c7fa9d65b15eb1 (commit)
      from  126671e73065e29c9582e47bc74774af2200fc8f (commit)


- Log -----------------------------------------------------------------
commit 9a34ddc345ddbc4810799fad65c7fa9d65b15eb1
Author:     Zhao Zhili <[email protected]>
AuthorDate: Mon Sep 1 14:55:44 2025 +0800
Commit:     James Almer <[email protected]>
CommitDate: Mon Sep 1 12:41:38 2025 +0000

    avformat/movenc: remove mvex from final mp4 in hybrid_fragmented mode
    
    In hybrid_fragmented mode, the first moov at start should contain
    mvex tag, since it's fmp4. When writing the moov at the second time,
    it's not fmp4 any more, so mvex should be skipped.

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index efd6329d70..e67a14a7d6 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5183,7 +5183,11 @@ static int mov_write_moov_tag(AVIOContext *pb, 
MOVMuxContext *mov,
                 return ret;
         }
     }
-    if (mov->flags & FF_MOV_FLAG_FRAGMENT)
+    /* Don't write mvex for hybrid_fragmented during mov_write_trailer
+     * (mov->moov_written != 0)
+     */
+    if (mov->flags & FF_MOV_FLAG_FRAGMENT &&
+        !(mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED && mov->moov_written))
         mov_write_mvex_tag(pb, mov); /* QuickTime requires trak to precede 
this */
 
     if (mov->mode == MODE_PSP)
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 421845969b..8e0988000d 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -92,7 +92,7 @@ fate-mov-frag-overlap: CMD = framemd5 -i 
$(TARGET_SAMPLES)/mov/frag_overlap.mp4
 
 fate-mov-mp4-frag-flush: CMD = md5 -f lavfi -i 
color=blue,format=rgb24,trim=duration=0.04 -f lavfi -i 
anullsrc,aformat=s16,atrim=duration=2 -c:v png -c:a pcm_s16le -movflags 
+empty_moov+hybrid_fragmented -frag_duration 1000000 -frag_interleave 1 
-bitexact -f mp4
 fate-mov-mp4-frag-flush: CMP = oneline
-fate-mov-mp4-frag-flush: REF = c9d0236bde4a0b24a01f6a032fd72e04
+fate-mov-mp4-frag-flush: REF = a1ac687d15552505f3c01a43285f32d0
 FATE_MOV_FFMPEG-$(call ALLYES, LAVFI_INDEV COLOR_FILTER FORMAT_FILTER 
TRIM_FILTER \
                                ANULLSRC_FILTER AFORMAT_FILTER ATRIM_FILTER     
   \
                                WRAPPED_AVFRAME_DECODER PCM_S16LE_DECODER 
PCM_S16BE_DECODER \
diff --git a/tests/ref/lavf/mov_hybrid_frag b/tests/ref/lavf/mov_hybrid_frag
index cd449712b9..64f4e9085e 100644
--- a/tests/ref/lavf/mov_hybrid_frag
+++ b/tests/ref/lavf/mov_hybrid_frag
@@ -1,3 +1,3 @@
-4871796f41234350f1b050317d0288a3 *tests/data/lavf/lavf.mov_hybrid_frag
-358508 tests/data/lavf/lavf.mov_hybrid_frag
+7f79311fa73287c093aa029f58b71476 *tests/data/lavf/lavf.mov_hybrid_frag
+358436 tests/data/lavf/lavf.mov_hybrid_frag
 tests/data/lavf/lavf.mov_hybrid_frag CRC=0xbb2b949b

-----------------------------------------------------------------------

Summary of changes:
 libavformat/movenc.c           | 6 +++++-
 tests/fate/mov.mak             | 2 +-
 tests/ref/lavf/mov_hybrid_frag | 4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)


hooks/post-receive
-- 

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

Reply via email to