Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/mov: Add support for uuid-based senc box (PR #20719)
@ 2025-10-19 16:33 Hendi48 via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Hendi48 via ffmpeg-devel @ 2025-10-19 16:33 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Hendi48

PR #20719 opened by Hendi48
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20719
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20719.patch

In PIFF-branded mp4 files, the senc data comes in a uuid box.

The rest of the CENC code is already working fine with such files; this change is the only thing required to make them decode-able with ffmpeg.

The UUID referenced in the code is defined in the Protected Interoperable File Format 1.1 specification, section 5.3.2.


>From ce5fbb8c9da0e81e6336bc33b0416ef6a7be75d7 Mon Sep 17 00:00:00 2001
From: Hendi <hendi48@freenet.de>
Date: Sun, 19 Oct 2025 18:24:58 +0200
Subject: [PATCH] avformat/mov: Add support for uuid-based senc box

In PIFF-branded mp4 files, the senc data comes in a uuid box.
---
 libavformat/mov.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a962594990..664c5764ae 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7229,6 +7229,8 @@ out:
     return ret;
 }
 
+static int mov_read_senc(MOVContext *c, AVIOContext *pb, MOVAtom atom);
+
 static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
@@ -7247,6 +7249,10 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         0xff, 0xcc, 0x82, 0x63, 0xf8, 0x55, 0x4a, 0x93,
         0x88, 0x14, 0x58, 0x7a, 0x02, 0x52, 0x1f, 0xdd,
     };
+    static const AVUUID uuid_piff_senc = {
+        0xa2, 0x39, 0x4f, 0x52, 0x5a, 0x9b, 0x4f, 0x14,
+        0xa2, 0x44, 0x6c, 0x42, 0x7c, 0x64, 0x8d, 0xf4
+    };
 
     if (atom.size < AV_UUID_LEN || atom.size >= FFMIN(INT_MAX, SIZE_MAX))
         return AVERROR_INVALIDDATA;
@@ -7329,6 +7335,8 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             return ret;
         if (!sc->spherical)
             av_log(c->fc, AV_LOG_WARNING, "Invalid spherical metadata found\n");
+    } else if (av_uuid_equal(uuid, uuid_piff_senc)) {
+        mov_read_senc(c, pb, atom);
     }
 
     return 0;
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-19 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-19 16:33 [FFmpeg-devel] [PATCH] avformat/mov: Add support for uuid-based senc box (PR #20719) Hendi48 via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git