From 8c3369f3f680e7f085bb0d3933e3e1e44b49e5d3 Mon Sep 17 00:00:00 2001 From: DenizUgur Date: Tue, 3 Oct 2023 14:58:43 -0700 Subject: [PATCH 1/4] deprecated boxes support, related to #72 --- data/schemas/standard.schema.json | 21 ++++++++++++++++++++- data/standard_features/14496-12/boxes.json | 4 ++++ src/construct/boxes.py | 14 ++++++++++---- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/data/schemas/standard.schema.json b/data/schemas/standard.schema.json index 3c900956..041f1918 100644 --- a/data/schemas/standard.schema.json +++ b/data/schemas/standard.schema.json @@ -19,6 +19,9 @@ "fourcc": { "type": "string" }, + "deprecated": { + "type": "boolean" + }, "description": { "type": "string" }, @@ -98,7 +101,23 @@ } } }, - "required": ["fourcc", "description", "type", "containers", "syntax"] + "required": ["fourcc"], + "allOf": [ + { + "if": { + "properties": { + "deprecated": { + "not": { + "const": true + } + } + } + }, + "then": { + "required": ["description", "type", "containers", "syntax"] + } + } + ] }, "minItems": 1 } diff --git a/data/standard_features/14496-12/boxes.json b/data/standard_features/14496-12/boxes.json index 2bc3c70a..ca660510 100644 --- a/data/standard_features/14496-12/boxes.json +++ b/data/standard_features/14496-12/boxes.json @@ -1492,6 +1492,10 @@ ], "type": "Box", "syntax": "class URIBox extends FullBox('uri ', version = 0, 0) {\n\tutf8string theURI;\n}" + }, + { + "fourcc": "mere", + "deprecated": true } ] } diff --git a/src/construct/boxes.py b/src/construct/boxes.py index 8411e652..c2d55148 100644 --- a/src/construct/boxes.py +++ b/src/construct/boxes.py @@ -10,6 +10,7 @@ from common import get_mp4ra_boxes BOXES = {} +DEPRECATED_BOXES = set() EXTENSIONS = {} TYPE_HIERARCHY = {} @@ -76,6 +77,11 @@ def get_all_boxes(json_file): _spec = os.path.basename(os.path.dirname(json_file)) for entry in entries: + # Handle deprecated boxes + if "deprecated" in entry and entry["deprecated"]: + DEPRECATED_BOXES.add(entry["fourcc"]) + continue + _boxes.add( Box( fourcc=entry["fourcc"], @@ -343,9 +349,8 @@ def main(): buffer.append(_box.fourcc) if len(buffer) > 0: - logger.warning( - f"Missing boxes in MP4RA ({len(set(buffer))}): {set(sorted(buffer))}" - ) + buffer = set(buffer) - DEPRECATED_BOXES + logger.warning(f"Missing boxes in MP4RA ({len(buffer)}): {sorted(buffer)}") # Check missing boxes in standard features all_fourccs = set(_box.fourcc for _box in all_boxes) @@ -356,8 +361,9 @@ def main(): # FIXME: This should be an error if len(buffer) > 0: + buffer = set(buffer) - DEPRECATED_BOXES logger.warning( - f"Missing boxes in standard features ({len(set(buffer))}): {set(sorted(buffer))}" + f"Missing boxes in standard features ({len(buffer)}): {sorted(buffer)}" ) # Sort all boxes by fourcc From 8246876daec7871ac3eb846f2b9722a3fe2d3217 Mon Sep 17 00:00:00 2001 From: DenizUgur Date: Thu, 5 Oct 2023 17:32:18 -0700 Subject: [PATCH 2/4] minor fix --- src/construct/boxes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/construct/boxes.py b/src/construct/boxes.py index c2d55148..b249f943 100644 --- a/src/construct/boxes.py +++ b/src/construct/boxes.py @@ -348,8 +348,8 @@ def main(): if _box.fourcc not in get_mp4ra_boxes(): buffer.append(_box.fourcc) + buffer = set(buffer) - DEPRECATED_BOXES if len(buffer) > 0: - buffer = set(buffer) - DEPRECATED_BOXES logger.warning(f"Missing boxes in MP4RA ({len(buffer)}): {sorted(buffer)}") # Check missing boxes in standard features @@ -359,9 +359,9 @@ def main(): if _box not in all_fourccs: buffer.append(_box) + buffer = set(buffer) - DEPRECATED_BOXES # FIXME: This should be an error if len(buffer) > 0: - buffer = set(buffer) - DEPRECATED_BOXES logger.warning( f"Missing boxes in standard features ({len(buffer)}): {sorted(buffer)}" ) From c955f41e8483ed68b903aa6f72a9b51a4f445238 Mon Sep 17 00:00:00 2001 From: Dimitri Podborski Date: Wed, 18 Oct 2023 16:36:30 -0700 Subject: [PATCH 3/4] add deprecated boxes from ISOBMFF --- data/standard_features/14496-12/boxes.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/data/standard_features/14496-12/boxes.json b/data/standard_features/14496-12/boxes.json index ca660510..ad95ac38 100644 --- a/data/standard_features/14496-12/boxes.json +++ b/data/standard_features/14496-12/boxes.json @@ -1495,6 +1495,27 @@ }, { "fourcc": "mere", + "description": "Metabox Relation box", + "deprecated": true + }, + { + "fourcc": "meco", + "description": "Additional metadata container box", + "deprecated": true + }, + { + "fourcc": "imif", + "description": "IPMPInfoBox", + "deprecated": true + }, + { + "fourcc": "ipmc", + "description": "IPMP control box", + "deprecated": true + }, + { + "fourcc": "stsl", + "description": "Sample scale box", "deprecated": true } ] From a16823b8753087c8d4aa1113ad534522f5f047b1 Mon Sep 17 00:00:00 2001 From: Dimitri Podborski Date: Mon, 23 Oct 2023 18:31:35 -0700 Subject: [PATCH 4/4] remove svop as we already have svdr --- data/standard_features/14496-15/boxes.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/data/standard_features/14496-15/boxes.json b/data/standard_features/14496-15/boxes.json index d7a8b4d0..dd6d8158 100644 --- a/data/standard_features/14496-15/boxes.json +++ b/data/standard_features/14496-15/boxes.json @@ -523,13 +523,6 @@ "type": "Box", "syntax": "class EVCConfigurationBox extends Box('evcC') {\n\tEVCDecoderConfigurationRecord() EVCConfig;\n}" }, - { - "fourcc": "svop", - "description": "SVC dependency range", - "containers": ["sgpd"], - "type": "Box", - "syntax": "class SVCDependencyRangeBox extends Box('svop') {\n\tunsigned int(3) min_dependency_id;\n\tunsigned int(3) min_temporal_id;\n\tbit(6) reserved = 0;\n\tunsigned int(4) min_quality_id;\n\tunsigned int(3) max_dependency_id;\n\tunsigned int(3) max_temporal_id;\n\tbit(6) reserved = 0;\n\tunsigned int(4) max_quality_id;\n}" - }, { "fourcc": "qlif", "description": "Layer quality assignments",