This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 199e49d9b663c40cc92af8f5bb0202eb39365377
Author:     Romain Beauxis <[email protected]>
AuthorDate: Wed Apr 22 10:00:47 2026 -0500
Commit:     toots <[email protected]>
CommitDate: Sat May 30 17:37:28 2026 +0000

    avformat/movenc: write hvcE box for Dolby Vision enhancement layer
    
    When AV_PKT_DATA_HEVC_CONF is present on a MODE_MP4 HEVC
    track, write it as an hvcE box alongside hvcC and dvcC. Like dvcC,
    writing requires -strict unofficial.
---
 libavformat/movenc.c                    | 17 +++++++++++++++++
 tests/ref/fate/mov-dovi-hvce-mp4-to-mp4 |  7 +++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7aa3f508c7..ca96c0887c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2537,6 +2537,14 @@ static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, 
AVIOContext *pb, AVDOVIDe
     return 32; /* 8 + 24 */
 }
 
+static int mov_write_hvce_tag(AVIOContext *pb, const AVPacketSideData *sd)
+{
+    avio_wb32(pb, 8 + sd->size);
+    ffio_wfourcc(pb, "hvcE");
+    avio_write(pb, sd->data, sd->size);
+    return 8 + sd->size;
+}
+
 static int mov_write_clap_tag(AVIOContext *pb, MOVTrack *track,
                               uint32_t top, uint32_t bottom,
                               uint32_t left, uint32_t right)
@@ -3004,6 +3012,15 @@ static int mov_write_video_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContex
         } else if (dovi) {
             av_log(mov->fc, AV_LOG_WARNING, "Not writing 'dvcC'/'dvvC' box. 
Requires -strict unofficial.\n");
         }
+
+        const AVPacketSideData *hvce = 
av_packet_side_data_get(track->st->codecpar->coded_side_data,
+                                                               
track->st->codecpar->nb_coded_side_data,
+                                                               
AV_PKT_DATA_HEVC_CONF);
+        if (hvce && mov->fc->strict_std_compliance <= 
FF_COMPLIANCE_UNOFFICIAL) {
+            mov_write_hvce_tag(pb, hvce);
+        } else if (hvce) {
+            av_log(mov->fc, AV_LOG_WARNING, "Not writing 'hvcE' box. Requires 
-strict unofficial.\n");
+        }
     }
 
     if (track->par->sample_aspect_ratio.den && 
track->par->sample_aspect_ratio.num) {
diff --git a/tests/ref/fate/mov-dovi-hvce-mp4-to-mp4 
b/tests/ref/fate/mov-dovi-hvce-mp4-to-mp4
index babd7ba02e..c2db018563 100644
--- a/tests/ref/fate/mov-dovi-hvce-mp4-to-mp4
+++ b/tests/ref/fate/mov-dovi-hvce-mp4-to-mp4
@@ -1,5 +1,5 @@
-cf2732a0d8f93e0a8695c1a1c7979b01 *tests/data/fate/mov-dovi-hvce-mp4-to-mp4.mp4
-667954 tests/data/fate/mov-dovi-hvce-mp4-to-mp4.mp4
+1d9ac9b893ed7e990b06fa13ebd97901 *tests/data/fate/mov-dovi-hvce-mp4-to-mp4.mp4
+668149 tests/data/fate/mov-dovi-hvce-mp4-to-mp4.mp4
 #extradata 0:      187, 0x34a930cb
 #tb 0: 1/16000
 #media_type 0: video
@@ -20,4 +20,7 @@ bl_present_flag=1
 dv_bl_signal_compatibility_id=6
 dv_md_compression=none
 [/SIDE_DATA]
+[SIDE_DATA]
+side_data_type=HEVC enhancement-layer decoder configuration
+[/SIDE_DATA]
 [/STREAM]

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

Reply via email to