* [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters
@ 2024-03-07 0:49 James Almer
2024-03-07 0:49 ` [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF " James Almer
2024-03-07 16:17 ` [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid " Stefano Sabatini
0 siblings, 2 replies; 8+ messages in thread
From: James Almer @ 2024-03-07 0:49 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
fftools/ffprobe.c | 53 ++++++++++++++++---
tests/fate/mov.mak | 6 +--
.../ref/fate/mov-heic-demux-still-image-grid | 29 ++++++++++
.../ref/fate/mov-heic-demux-still-image-iovl | 19 +++++++
.../fate/mov-heic-demux-still-image-iovl-2 | 19 +++++++
5 files changed, 115 insertions(+), 11 deletions(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 4d4a85b5b0..c2ed8336f9 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -113,6 +113,7 @@ static int do_show_frames = 0;
static int do_show_packets = 0;
static int do_show_programs = 0;
static int do_show_stream_groups = 0;
+static int do_show_stream_group_components = 0;
static int do_show_streams = 0;
static int do_show_stream_disposition = 0;
static int do_show_stream_group_disposition = 0;
@@ -209,6 +210,10 @@ typedef enum {
SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION,
SECTION_ID_STREAM_GROUP_STREAM_TAGS,
SECTION_ID_STREAM_GROUP,
+ SECTION_ID_STREAM_GROUP_COMPONENTS,
+ SECTION_ID_STREAM_GROUP_COMPONENT,
+ SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
+ SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
SECTION_ID_STREAM_GROUP_STREAMS,
SECTION_ID_STREAM_GROUP_STREAM,
SECTION_ID_STREAM_GROUP_DISPOSITION,
@@ -309,7 +314,11 @@ static struct section sections[] = {
[SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
[SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION] = { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_stream_disposition" },
[SECTION_ID_STREAM_GROUP_STREAM_TAGS] = { SECTION_ID_STREAM_GROUP_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "stream_group_stream_tags" },
- [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAMS, -1 }, .get_type = get_stream_group_type },
+ [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", 0, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_COMPONENTS, SECTION_ID_STREAM_GROUP_STREAMS, -1 } },
+ [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
+ [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
+ [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
+ [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
[SECTION_ID_STREAM_GROUP_STREAMS] = { SECTION_ID_STREAM_GROUP_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_STREAM, -1 }, .unique_name = "stream_group_streams" },
[SECTION_ID_STREAM_GROUP_STREAM] = { SECTION_ID_STREAM_GROUP_STREAM, "stream", 0, { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAM_TAGS, -1 }, .unique_name = "stream_group_stream" },
[SECTION_ID_STREAM_GROUP_DISPOSITION] = { SECTION_ID_STREAM_GROUP_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_disposition" },
@@ -3385,13 +3394,35 @@ static int show_programs(WriterContext *w, InputFile *ifile)
return ret;
}
+static void print_tile_grid_params(WriterContext *w, const AVStreamGroup *stg,
+ const AVStreamGroupTileGrid *tile_grid)
+{
+ writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP_COMPONENT);
+ print_int("nb_tiles", tile_grid->nb_tiles);
+ print_int("coded_width", tile_grid->coded_width);
+ print_int("coded_height", tile_grid->coded_height);
+ print_int("horizontal_offset", tile_grid->horizontal_offset);
+ print_int("vertical_offset", tile_grid->vertical_offset);
+ print_int("width", tile_grid->width);
+ print_int("height", tile_grid->height);
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_SUB_COMPONENTS);
+ for (int i = 0; i < tile_grid->nb_tiles; i++) {
+ writer_print_section_header(w, "tile_offset", SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
+ print_int("stream_index", tile_grid->offsets[i].idx);
+ print_int("tile_horizontal_offset", tile_grid->offsets[i].horizontal);
+ print_int("tile_vertical_offset", tile_grid->offsets[i].vertical);
+ writer_print_section_footer(w);
+ }
+ writer_print_section_footer(w);
+ writer_print_section_footer(w);
+}
+
static void print_stream_group_params(WriterContext *w, AVStreamGroup *stg)
{
- const char *unknown = "unknown";
- if (stg->type != AV_STREAM_GROUP_PARAMS_NONE)
- print_str("type", av_x_if_null(avformat_stream_group_name(stg->type), unknown));
- else
- print_str_opt("type", unknown);
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_COMPONENTS);
+ if (stg->type == AV_STREAM_GROUP_PARAMS_TILE_GRID)
+ print_tile_grid_params(w, stg, stg->params.tile_grid);
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_COMPONENTS
}
static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *stg)
@@ -3401,12 +3432,17 @@ static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *
int i, ret = 0;
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
- writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP);
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP);
print_int("index", stg->index);
if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS) print_fmt ("id", "0x%"PRIx64, stg->id);
else print_str_opt("id", "N/A");
print_int("nb_streams", stg->nb_streams);
- print_stream_group_params(w, stg);
+ if (stg->type != AV_STREAM_GROUP_PARAMS_NONE)
+ print_str("type", av_x_if_null(avformat_stream_group_name(stg->type), "unknown"));
+ else
+ print_str_opt("type", "unknown");
+ if (do_show_stream_group_components)
+ print_stream_group_params(w, stg);
/* Print disposition information */
if (do_show_stream_group_disposition)
@@ -4333,6 +4369,7 @@ int main(int argc, char **argv)
SET_DO_SHOW(PROGRAMS, programs);
SET_DO_SHOW(STREAM_GROUP_DISPOSITION, stream_group_disposition);
SET_DO_SHOW(STREAM_GROUPS, stream_groups);
+ SET_DO_SHOW(STREAM_GROUP_COMPONENTS, stream_group_components);
SET_DO_SHOW(STREAMS, streams);
SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 49077ecfb3..6dc5b5f5af 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -166,19 +166,19 @@ fate-mov-heic-demux-still-image-multiple-items: CMD = framecrc -i $(TARGET_SAMPL
FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-grid
fate-mov-heic-demux-still-image-grid: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C007.heic "" "-c:v copy -map 0:g:0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
# heic demuxing - still image with multiple items in an overlay canvas.
FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-iovl
fate-mov-heic-demux-still-image-iovl: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C015.heic "" "-c:v copy -map 0:g:0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
# heic demuxing - still image where one image item is placed twice on an overlay canvas.
FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
+= fate-mov-heic-demux-still-image-iovl-2
fate-mov-heic-demux-still-image-iovl-2: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C021.heic "" "-c:v copy -map 0:g:0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
# Resulting remux should have:
# 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED
diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid b/tests/ref/fate/mov-heic-demux-still-image-grid
index b15ce91e1a..d8dfccea8f 100644
--- a/tests/ref/fate/mov-heic-demux-still-image-grid
+++ b/tests/ref/fate/mov-heic-demux-still-image-grid
@@ -31,6 +31,35 @@ index=0
id=0x3f1
nb_streams=4
type=Tile Grid
+[COMPONENT]
+nb_tiles=4
+coded_width=2560
+coded_height=1440
+horizontal_offset=0
+vertical_offset=0
+width=2560
+height=1440
+[SUBCOMPONENT]
+stream_index=0
+tile_horizontal_offset=0
+tile_vertical_offset=0
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+stream_index=1
+tile_horizontal_offset=1280
+tile_vertical_offset=0
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+stream_index=2
+tile_horizontal_offset=0
+tile_vertical_offset=720
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+stream_index=3
+tile_horizontal_offset=1280
+tile_vertical_offset=720
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
diff --git a/tests/ref/fate/mov-heic-demux-still-image-iovl b/tests/ref/fate/mov-heic-demux-still-image-iovl
index 113b251c00..2b211267a4 100644
--- a/tests/ref/fate/mov-heic-demux-still-image-iovl
+++ b/tests/ref/fate/mov-heic-demux-still-image-iovl
@@ -17,6 +17,25 @@ index=0
id=0x3ee
nb_streams=2
type=Tile Grid
+[COMPONENT]
+nb_tiles=2
+coded_width=1440
+coded_height=960
+horizontal_offset=0
+vertical_offset=0
+width=1440
+height=960
+[SUBCOMPONENT]
+stream_index=0
+tile_horizontal_offset=0
+tile_vertical_offset=0
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+stream_index=1
+tile_horizontal_offset=160
+tile_vertical_offset=240
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
diff --git a/tests/ref/fate/mov-heic-demux-still-image-iovl-2 b/tests/ref/fate/mov-heic-demux-still-image-iovl-2
index 8ee3543e43..492f404a3c 100644
--- a/tests/ref/fate/mov-heic-demux-still-image-iovl-2
+++ b/tests/ref/fate/mov-heic-demux-still-image-iovl-2
@@ -10,6 +10,25 @@ index=0
id=0x3eb
nb_streams=1
type=Tile Grid
+[COMPONENT]
+nb_tiles=2
+coded_width=640
+coded_height=360
+horizontal_offset=0
+vertical_offset=0
+width=640
+height=360
+[SUBCOMPONENT]
+stream_index=0
+tile_horizontal_offset=0
+tile_vertical_offset=0
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+stream_index=0
+tile_horizontal_offset=64896
+tile_vertical_offset=65176
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
--
2.44.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF Stream Group parameters
2024-03-07 0:49 [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters James Almer
@ 2024-03-07 0:49 ` James Almer
2024-03-07 16:45 ` Stefano Sabatini
2024-03-07 16:17 ` [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid " Stefano Sabatini
1 sibling, 1 reply; 8+ messages in thread
From: James Almer @ 2024-03-07 0:49 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
fftools/ffprobe.c | 157 +++++++++++++++++++++++-
tests/fate/iamf.mak | 8 +-
tests/fate/mov.mak | 8 +-
tests/ref/fate/iamf-5_1_4 | 92 ++++++++++++++
tests/ref/fate/iamf-7_1_4 | 92 ++++++++++++++
tests/ref/fate/iamf-ambisonic_1 | 39 ++++++
tests/ref/fate/iamf-stereo | 67 ++++++++++
tests/ref/fate/mov-mp4-iamf-5_1_4 | 92 ++++++++++++++
tests/ref/fate/mov-mp4-iamf-7_1_4 | 92 ++++++++++++++
tests/ref/fate/mov-mp4-iamf-ambisonic_1 | 39 ++++++
tests/ref/fate/mov-mp4-iamf-stereo | 67 ++++++++++
11 files changed, 741 insertions(+), 12 deletions(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index c2ed8336f9..393f8d2a99 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -41,6 +41,7 @@
#include "libavutil/display.h"
#include "libavutil/hash.h"
#include "libavutil/hdr_dynamic_metadata.h"
+#include "libavutil/iamf.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/hdr_dynamic_vivid_metadata.h"
#include "libavutil/dovi_meta.h"
@@ -214,6 +215,12 @@ typedef enum {
SECTION_ID_STREAM_GROUP_COMPONENT,
SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
+ SECTION_ID_STREAM_GROUP_PIECES,
+ SECTION_ID_STREAM_GROUP_PIECE,
+ SECTION_ID_STREAM_GROUP_SUB_PIECES,
+ SECTION_ID_STREAM_GROUP_SUB_PIECE,
+ SECTION_ID_STREAM_GROUP_BLOCKS,
+ SECTION_ID_STREAM_GROUP_BLOCK,
SECTION_ID_STREAM_GROUP_STREAMS,
SECTION_ID_STREAM_GROUP_STREAM,
SECTION_ID_STREAM_GROUP_DISPOSITION,
@@ -287,8 +294,8 @@ static struct section sections[] = {
[SECTION_ID_FRAME_SIDE_DATA_TIMECODE] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, "timecode", 0, { -1 } },
[SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, -1 }, .element_name = "component", .unique_name = "frame_side_data_components" },
[SECTION_ID_FRAME_SIDE_DATA_COMPONENT] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, -1 }, .unique_name = "frame_side_data_component", .element_name = "component_entry", .get_type = get_raw_string_type },
- [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece" },
- [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .get_type = get_raw_string_type },
+ [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece", .unique_name = "frame_side_data_pieces" },
+ [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .unique_name = "frame_side_data_piece", .get_type = get_raw_string_type },
[SECTION_ID_FRAME_LOGS] = { SECTION_ID_FRAME_LOGS, "logs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_LOG, -1 } },
[SECTION_ID_FRAME_LOG] = { SECTION_ID_FRAME_LOG, "log", 0, { -1 }, },
[SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
@@ -318,7 +325,13 @@ static struct section sections[] = {
[SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
[SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
[SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
- [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
+ [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_PIECES, -1 }, .element_name = "subcomponent_entry", .get_type = get_raw_string_type },
+ [SECTION_ID_STREAM_GROUP_PIECES] = { SECTION_ID_STREAM_GROUP_PIECES, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_PIECE, -1 }, .element_name = "piece", .unique_name = "stream_group_pieces" },
+ [SECTION_ID_STREAM_GROUP_PIECE] = { SECTION_ID_STREAM_GROUP_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_PIECES, -1 }, .unique_name = "stream_group_piece", .element_name = "piece_entry", .get_type = get_raw_string_type },
+ [SECTION_ID_STREAM_GROUP_SUB_PIECES] = { SECTION_ID_STREAM_GROUP_SUB_PIECES, "subpieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_PIECE, -1 }, .element_name = "subpiece" },
+ [SECTION_ID_STREAM_GROUP_SUB_PIECE] = { SECTION_ID_STREAM_GROUP_SUB_PIECE, "subpiece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_BLOCKS, -1 }, .element_name = "subpiece_entry", .get_type = get_raw_string_type },
+ [SECTION_ID_STREAM_GROUP_BLOCKS] = { SECTION_ID_STREAM_GROUP_BLOCKS, "blocks", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_BLOCK, -1 }, .element_name = "block" },
+ [SECTION_ID_STREAM_GROUP_BLOCK] = { SECTION_ID_STREAM_GROUP_BLOCK, "block", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "block_entry", .get_type = get_raw_string_type },
[SECTION_ID_STREAM_GROUP_STREAMS] = { SECTION_ID_STREAM_GROUP_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_STREAM, -1 }, .unique_name = "stream_group_streams" },
[SECTION_ID_STREAM_GROUP_STREAM] = { SECTION_ID_STREAM_GROUP_STREAM, "stream", 0, { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAM_TAGS, -1 }, .unique_name = "stream_group_stream" },
[SECTION_ID_STREAM_GROUP_DISPOSITION] = { SECTION_ID_STREAM_GROUP_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_disposition" },
@@ -523,7 +536,7 @@ typedef struct Writer {
int flags; ///< a combination or WRITER_FLAG_*
} Writer;
-#define SECTION_MAX_NB_LEVELS 10
+#define SECTION_MAX_NB_LEVELS 12
struct WriterContext {
const AVClass *class; ///< class of the writer
@@ -3417,11 +3430,147 @@ static void print_tile_grid_params(WriterContext *w, const AVStreamGroup *stg,
writer_print_section_footer(w);
}
+static void print_iamf_param_definition(WriterContext *w, const char *name,
+ const AVIAMFParamDefinition *param, SectionID section_id)
+{
+ SectionID subsection_id = sections[section_id].children_ids[0];
+ SectionID parameter_section_id = sections[subsection_id].children_ids[0];
+ writer_print_section_header(w, "IAMF Param Definition", section_id);
+ print_str("name", name);
+ print_int("nb_subblocks", param->nb_subblocks);
+ print_int("type", param->type);
+ print_int("parameter_id", param->parameter_id);
+ print_int("parameter_rate", param->parameter_rate);
+ print_int("duration", param->duration);
+ print_int("constant_subblock_duration", param->constant_subblock_duration);
+ if (param->nb_subblocks > 0)
+ writer_print_section_header(w, NULL, subsection_id);
+ for (int i = 0; i < param->nb_subblocks; i++) {
+ const void *subblock = av_iamf_param_definition_get_subblock(param, i);
+ switch(param->type) {
+ case AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN: {
+ const AVIAMFMixGain *mix = subblock;
+ writer_print_section_header(w, "IAMF Mix Gain Parameters", parameter_section_id);
+ print_int("subblock_duration", mix->subblock_duration);
+ print_int("animation_type", mix->animation_type);
+ print_q("start_point_value", mix->start_point_value, '/');
+ print_q("end_point_value", mix->end_point_value, '/');
+ print_q("control_point_value", mix->control_point_value, '/');
+ print_q("control_point_relative_time", mix->control_point_relative_time, '/');
+ writer_print_section_footer(w); // parameter_section_id
+ break;
+ }
+ case AV_IAMF_PARAMETER_DEFINITION_DEMIXING: {
+ const AVIAMFDemixingInfo *demix = subblock;
+ writer_print_section_header(w, "IAMF Demixing Info", parameter_section_id);
+ print_int("subblock_duration", demix->subblock_duration);
+ print_int("dmixp_mode", demix->dmixp_mode);
+ writer_print_section_footer(w); // parameter_section_id
+ break;
+ }
+ case AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN: {
+ const AVIAMFReconGain *recon = subblock;
+ writer_print_section_header(w, "IAMF Recon Gain", parameter_section_id);
+ print_int("subblock_duration", recon->subblock_duration);
+ writer_print_section_footer(w); // parameter_section_id
+ break;
+ }
+ }
+ }
+ if (param->nb_subblocks > 0)
+ writer_print_section_footer(w); // subsection_id
+ writer_print_section_footer(w); // section_id
+}
+
+static void print_iamf_audio_element_params(WriterContext *w, const AVStreamGroup *stg,
+ const AVIAMFAudioElement *audio_element)
+{
+ writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP_COMPONENT);
+ print_int("nb_layers", audio_element->nb_layers);
+ print_int("audio_element_type", audio_element->audio_element_type);
+ print_int("default_w", audio_element->default_w);
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_SUB_COMPONENTS);
+ for (int i = 0; i < audio_element->nb_layers; i++) {
+ const AVIAMFLayer *layer = audio_element->layers[i];
+ char val_str[128];
+ writer_print_section_header(w, "IAMF Audio Layer", SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
+ av_channel_layout_describe(&layer->ch_layout, val_str, sizeof(val_str));
+ print_str("channel_layout", val_str);
+ if (audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL) {
+ print_int("output_gain_flags", layer->output_gain_flags);
+ print_q("output_gain", layer->output_gain, '/');
+ } else if (audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE)
+ print_int("ambisonics_mode", layer->ambisonics_mode);
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_SUB_COMPONENT
+ }
+ if (audio_element->demixing_info)
+ print_iamf_param_definition(w, "demixing_info", audio_element->demixing_info,
+ SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
+ if (audio_element->recon_gain_info)
+ print_iamf_param_definition(w, "recon_gain_info", audio_element->recon_gain_info,
+ SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_SUB_COMPONENTS
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_COMPONENT
+}
+
+static void print_iamf_submix_params(WriterContext *w, const AVIAMFSubmix *submix)
+{
+ writer_print_section_header(w, "IAMF Submix", SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
+ print_int("nb_elements", submix->nb_elements);
+ print_int("nb_layouts", submix->nb_layouts);
+ print_q("default_mix_gain", submix->default_mix_gain, '/');
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_PIECES);
+ for (int i = 0; i < submix->nb_elements; i++) {
+ const AVIAMFSubmixElement *element = submix->elements[i];
+ writer_print_section_header(w, "IAMF Submix Element", SECTION_ID_STREAM_GROUP_PIECE);
+ print_int("stream_id", element->audio_element_id);
+ print_q("default_mix_gain", element->default_mix_gain, '/');
+ print_int("headphones_rendering_mode", element->headphones_rendering_mode);
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_SUB_PIECES);
+ if (element->element_mix_config)
+ print_iamf_param_definition(w, "element_mix_config", element->element_mix_config,
+ SECTION_ID_STREAM_GROUP_SUB_PIECE);
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_SUB_PIECES
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_PIECE
+ }
+ for (int i = 0; i < submix->nb_layouts; i++) {
+ const AVIAMFSubmixLayout *layout = submix->layouts[i];
+ char val_str[128];
+ writer_print_section_header(w, "IAMF Submix Layout", SECTION_ID_STREAM_GROUP_PIECE);
+ av_channel_layout_describe(&layout->sound_system, val_str, sizeof(val_str));
+ print_str("sound_system", val_str);
+ print_q("integrated_loudness", layout->integrated_loudness, '/');
+ print_q("digital_peak", layout->digital_peak, '/');
+ print_q("true_peak", layout->true_peak, '/');
+ print_q("dialogue_anchored_loudness", layout->dialogue_anchored_loudness, '/');
+ print_q("album_anchored_loudness", layout->album_anchored_loudness, '/');
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_PIECE
+ }
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_PIECES
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_SUB_COMPONENT
+}
+
+static void print_iamf_mix_presentation_params(WriterContext *w, const AVStreamGroup *stg,
+ const AVIAMFMixPresentation *mix_presentation)
+{
+ writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP_COMPONENT);
+ print_int("nb_submixes", mix_presentation->nb_submixes);
+ writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_SUB_COMPONENTS);
+ for (int i = 0; i < mix_presentation->nb_submixes; i++)
+ print_iamf_submix_params(w, mix_presentation->submixes[i]);
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_SUB_COMPONENTS
+ writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_COMPONENT
+}
+
static void print_stream_group_params(WriterContext *w, AVStreamGroup *stg)
{
writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_COMPONENTS);
if (stg->type == AV_STREAM_GROUP_PARAMS_TILE_GRID)
print_tile_grid_params(w, stg, stg->params.tile_grid);
+ else if (stg->type == AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT)
+ print_iamf_audio_element_params(w, stg, stg->params.iamf_audio_element);
+ else if (stg->type == AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION)
+ print_iamf_mix_presentation_params(w, stg, stg->params.iamf_mix_presentation);
writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_COMPONENTS
}
diff --git a/tests/fate/iamf.mak b/tests/fate/iamf.mak
index 46d4f41c5f..2dfa29d919 100644
--- a/tests/fate/iamf.mak
+++ b/tests/fate/iamf.mak
@@ -4,7 +4,7 @@ fate-iamf-stereo: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
fate-iamf-stereo: CMD = transcode wav $(SRC) iamf " \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-stereo \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-stereo \
- -streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_stream=index,id:stream_group_stream_disposition"
+ -streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_IAMF += fate-iamf-5_1_4
fate-iamf-5_1_4: tests/data/asynth-44100-10.wav tests/data/filtergraphs/iamf_5_1_4 tests/data/streamgroups/audio_element-5_1_4 tests/data/streamgroups/mix_presentation-5_1_4
@@ -13,7 +13,7 @@ fate-iamf-5_1_4: CMD = transcode wav $(SRC) iamf "-auto_conversion_filters \
-/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_5_1_4 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-5_1_4 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-5_1_4 \
- -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 -streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_stream=index,id:stream_group_stream_disposition"
+ -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 -streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_IAMF += fate-iamf-7_1_4
fate-iamf-7_1_4: tests/data/asynth-44100-12.wav tests/data/filtergraphs/iamf_7_1_4 tests/data/streamgroups/audio_element-7_1_4 tests/data/streamgroups/mix_presentation-7_1_4
@@ -22,7 +22,7 @@ fate-iamf-7_1_4: CMD = transcode wav $(SRC) iamf "-auto_conversion_filters \
-/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_7_1_4 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-7_1_4 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-7_1_4 \
- -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 -streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_stream=index,id:stream_group_stream_disposition"
+ -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 -streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_IAMF += fate-iamf-ambisonic_1
fate-iamf-ambisonic_1: tests/data/asynth-44100-4.wav tests/data/filtergraphs/iamf_ambisonic_1 tests/data/streamgroups/audio_element-ambisonic_1 tests/data/streamgroups/mix_presentation-ambisonic_1
@@ -31,7 +31,7 @@ fate-iamf-ambisonic_1: CMD = transcode wav $(SRC) iamf "-auto_conversion_filters
-/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/iamf_ambisonic_1 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-ambisonic_1 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-ambisonic_1 \
- -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map [MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_stream=index,id:stream_group_stream_disposition"
+ -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map [MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0" "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_IAMF-$(call TRANSCODE, FLAC, IAMF, WAV_DEMUXER PCM_S16LE_DECODER) += $(FATE_IAMF)
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 6dc5b5f5af..51fd5fa2f3 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -223,7 +223,7 @@ fate-mov-mp4-iamf-stereo: CMD = transcode wav $(SRC) mp4 " \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-stereo \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-stereo \
-streamid 0:0 -c:a flac -t 1" "-c:a copy -map 0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_MOV_FFMPEG_FFPROBE-$(call TRANSCODE, FLAC, MOV, WAV_DEMUXER PCM_S16LE_DECODER) += fate-mov-mp4-iamf-5_1_4
fate-mov-mp4-iamf-5_1_4: tests/data/asynth-44100-10.wav tests/data/filtergraphs/iamf_5_1_4 tests/data/streamgroups/audio_element-5_1_4 tests/data/streamgroups/mix_presentation-5_1_4
@@ -233,7 +233,7 @@ fate-mov-mp4-iamf-5_1_4: CMD = transcode wav $(SRC) mp4 "-auto_conversion_filter
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-5_1_4 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-5_1_4 \
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 -streamid 5:5 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_MOV_FFMPEG_FFPROBE-$(call TRANSCODE, FLAC, MOV, WAV_DEMUXER PCM_S16LE_DECODER) += fate-mov-mp4-iamf-7_1_4
fate-mov-mp4-iamf-7_1_4: tests/data/asynth-44100-12.wav tests/data/filtergraphs/iamf_7_1_4 tests/data/streamgroups/audio_element-7_1_4 tests/data/streamgroups/mix_presentation-7_1_4
@@ -243,7 +243,7 @@ fate-mov-mp4-iamf-7_1_4: CMD = transcode wav $(SRC) mp4 "-auto_conversion_filter
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-7_1_4 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-7_1_4 \
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -streamid 4:4 -streamid 5:5 -streamid 6:6 -map [FRONT] -map [BACK] -map [CENTER] -map [LFE] -map [SIDE] -map [TOP_FRONT] -map [TOP_BACK] -c:a flac -t 1" "-c:a copy -map 0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_MOV_FFMPEG_FFPROBE-$(call TRANSCODE, FLAC, MOV, WAV_DEMUXER PCM_S16LE_DECODER) += fate-mov-mp4-iamf-ambisonic_1
fate-mov-mp4-iamf-ambisonic_1: tests/data/asynth-44100-4.wav tests/data/filtergraphs/iamf_ambisonic_1 tests/data/streamgroups/audio_element-ambisonic_1 tests/data/streamgroups/mix_presentation-ambisonic_1
@@ -253,7 +253,7 @@ fate-mov-mp4-iamf-ambisonic_1: CMD = transcode wav $(SRC) mp4 "-auto_conversion_
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/audio_element-ambisonic_1 \
-/stream_group $(TARGET_PATH)/tests/data/streamgroups/mix_presentation-ambisonic_1 \
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 -map [MONO0] -map [MONO1] -map [MONO2] -map [MONO3] -c:a flac -t 1" "-c:a copy -map 0" \
- "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
+ "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
FATE_FFMPEG += $(FATE_MOV_FFMPEG-yes)
FATE_FFMPEG_FFPROBE += $(FATE_MOV_FFMPEG_FFPROBE-yes)
diff --git a/tests/ref/fate/iamf-5_1_4 b/tests/ref/fate/iamf-5_1_4
index a19b49852d..d792c0b9ed 100644
--- a/tests/ref/fate/iamf-5_1_4
+++ b/tests/ref/fate/iamf-5_1_4
@@ -101,6 +101,44 @@ index=0
id=0x1
nb_streams=6
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=4
+audio_element_type=0
+default_w=10
+[SUBCOMPONENT]
+channel_layout=stereo
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=5.1
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=5.1.2
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=5.1.4
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+name=demixing_info
+nb_subblocks=1
+type=1
+parameter_id=998
+parameter_rate=44100
+duration=4608
+constant_subblock_duration=4608
+[PIECE]
+subblock_duration=4608
+dmixp_mode=1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
@@ -239,6 +277,60 @@ index=1
id=0x2
nb_streams=6
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=1
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=4
+default_mix_gain=256/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=256/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=5.1
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=5.1.2
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=5.1.4
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
diff --git a/tests/ref/fate/iamf-7_1_4 b/tests/ref/fate/iamf-7_1_4
index 66e1dd8be4..132b10a9fc 100644
--- a/tests/ref/fate/iamf-7_1_4
+++ b/tests/ref/fate/iamf-7_1_4
@@ -117,6 +117,44 @@ index=0
id=0x1
nb_streams=7
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=4
+audio_element_type=0
+default_w=10
+[SUBCOMPONENT]
+channel_layout=stereo
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=3.1.2
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=7.1.2
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=7.1.4
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+name=demixing_info
+nb_subblocks=1
+type=1
+parameter_id=998
+parameter_rate=44100
+duration=4608
+constant_subblock_duration=4608
+[PIECE]
+subblock_duration=4608
+dmixp_mode=1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
@@ -277,6 +315,60 @@ index=1
id=0x2
nb_streams=7
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=1
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=4
+default_mix_gain=256/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=256/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=3.1.2
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=7.1.2
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=7.1.4
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
diff --git a/tests/ref/fate/iamf-ambisonic_1 b/tests/ref/fate/iamf-ambisonic_1
index b6cdb95d4d..a115934df0 100644
--- a/tests/ref/fate/iamf-ambisonic_1
+++ b/tests/ref/fate/iamf-ambisonic_1
@@ -69,6 +69,15 @@ index=0
id=0x1
nb_streams=4
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=1
+audio_element_type=1
+default_w=0
+[SUBCOMPONENT]
+channel_layout=ambisonic 1
+ambisonics_mode=0
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
@@ -163,6 +172,36 @@ index=1
id=0x2
nb_streams=4
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=1
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=1
+default_mix_gain=0/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
diff --git a/tests/ref/fate/iamf-stereo b/tests/ref/fate/iamf-stereo
index 7e3597fa32..deed948655 100644
--- a/tests/ref/fate/iamf-stereo
+++ b/tests/ref/fate/iamf-stereo
@@ -21,6 +21,16 @@ index=0
id=0x1
nb_streams=1
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=1
+audio_element_type=0
+default_w=0
+[SUBCOMPONENT]
+channel_layout=stereo
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
@@ -49,6 +59,63 @@ index=1
id=0x2
nb_streams=1
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=2
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=1
+default_mix_gain=256/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=256/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=1
+default_mix_gain=0/256
+[PIECE]
+stream_id=1
+default_mix_gain=256/256
+headphones_rendering_mode=1
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=0 channels
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
[STREAM]
index=0
id=0x0
diff --git a/tests/ref/fate/mov-mp4-iamf-5_1_4 b/tests/ref/fate/mov-mp4-iamf-5_1_4
index 750e642984..4a364a8635 100644
--- a/tests/ref/fate/mov-mp4-iamf-5_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-5_1_4
@@ -101,6 +101,44 @@ index=0
id=0x1
nb_streams=6
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=4
+audio_element_type=0
+default_w=10
+[SUBCOMPONENT]
+channel_layout=stereo
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=5.1
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=5.1.2
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=5.1.4
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+name=demixing_info
+nb_subblocks=1
+type=1
+parameter_id=998
+parameter_rate=44100
+duration=4608
+constant_subblock_duration=4608
+[PIECE]
+subblock_duration=4608
+dmixp_mode=1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
@@ -260,6 +298,60 @@ index=1
id=0x2
nb_streams=6
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=1
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=4
+default_mix_gain=256/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=256/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=5.1
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=5.1.2
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=5.1.4
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4 b/tests/ref/fate/mov-mp4-iamf-7_1_4
index 518210eb8c..e9e243a043 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4
@@ -117,6 +117,44 @@ index=0
id=0x1
nb_streams=7
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=4
+audio_element_type=0
+default_w=10
+[SUBCOMPONENT]
+channel_layout=stereo
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=3.1.2
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=7.1.2
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+channel_layout=7.1.4
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+name=demixing_info
+nb_subblocks=1
+type=1
+parameter_id=998
+parameter_rate=44100
+duration=4608
+constant_subblock_duration=4608
+[PIECE]
+subblock_duration=4608
+dmixp_mode=1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
@@ -298,6 +336,60 @@ index=1
id=0x2
nb_streams=7
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=1
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=4
+default_mix_gain=256/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=256/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=3.1.2
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=7.1.2
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[PIECE]
+sound_system=7.1.4
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
diff --git a/tests/ref/fate/mov-mp4-iamf-ambisonic_1 b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
index fd2cf82c4d..483341289e 100644
--- a/tests/ref/fate/mov-mp4-iamf-ambisonic_1
+++ b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
@@ -69,6 +69,15 @@ index=0
id=0x1
nb_streams=4
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=1
+audio_element_type=1
+default_w=0
+[SUBCOMPONENT]
+channel_layout=ambisonic 1
+ambisonics_mode=0
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
@@ -184,6 +193,36 @@ index=1
id=0x2
nb_streams=4
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=1
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=1
+default_mix_gain=0/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
diff --git a/tests/ref/fate/mov-mp4-iamf-stereo b/tests/ref/fate/mov-mp4-iamf-stereo
index 79e7a20b71..bbbe5cb8ed 100644
--- a/tests/ref/fate/mov-mp4-iamf-stereo
+++ b/tests/ref/fate/mov-mp4-iamf-stereo
@@ -21,6 +21,16 @@ index=0
id=0x1
nb_streams=1
type=IAMF Audio Element
+[COMPONENT]
+nb_layers=1
+audio_element_type=0
+default_w=0
+[SUBCOMPONENT]
+channel_layout=stereo
+output_gain_flags=0
+output_gain=0/1
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
@@ -70,6 +80,63 @@ index=1
id=0x2
nb_streams=1
type=IAMF Mix Presentation
+[COMPONENT]
+nb_submixes=2
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=1
+default_mix_gain=256/256
+[PIECE]
+stream_id=1
+default_mix_gain=0/256
+headphones_rendering_mode=0
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=stereo
+integrated_loudness=256/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[SUBCOMPONENT]
+nb_elements=1
+nb_layouts=1
+default_mix_gain=0/256
+[PIECE]
+stream_id=1
+default_mix_gain=256/256
+headphones_rendering_mode=1
+[SUBPIECE]
+name=element_mix_config
+nb_subblocks=0
+type=0
+parameter_id=100
+parameter_rate=48000
+duration=0
+constant_subblock_duration=0
+[/SUBPIECE]
+[/PIECE]
+[PIECE]
+sound_system=0 channels
+integrated_loudness=0/256
+digital_peak=0/256
+true_peak=0/1
+dialogue_anchored_loudness=0/1
+album_anchored_loudness=0/1
+[/PIECE]
+[/SUBCOMPONENT]
+[/COMPONENT]
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
--
2.44.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters
2024-03-07 0:49 [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters James Almer
2024-03-07 0:49 ` [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF " James Almer
@ 2024-03-07 16:17 ` Stefano Sabatini
2024-03-07 16:46 ` Stefano Sabatini
2024-03-07 17:52 ` James Almer
1 sibling, 2 replies; 8+ messages in thread
From: Stefano Sabatini @ 2024-03-07 16:17 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On date Wednesday 2024-03-06 21:49:51 -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> fftools/ffprobe.c | 53 ++++++++++++++++---
> tests/fate/mov.mak | 6 +--
> .../ref/fate/mov-heic-demux-still-image-grid | 29 ++++++++++
> .../ref/fate/mov-heic-demux-still-image-iovl | 19 +++++++
> .../fate/mov-heic-demux-still-image-iovl-2 | 19 +++++++
> 5 files changed, 115 insertions(+), 11 deletions(-)
>
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index 4d4a85b5b0..c2ed8336f9 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -113,6 +113,7 @@ static int do_show_frames = 0;
> static int do_show_packets = 0;
> static int do_show_programs = 0;
> static int do_show_stream_groups = 0;
> +static int do_show_stream_group_components = 0;
> static int do_show_streams = 0;
> static int do_show_stream_disposition = 0;
> static int do_show_stream_group_disposition = 0;
> @@ -209,6 +210,10 @@ typedef enum {
> SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION,
> SECTION_ID_STREAM_GROUP_STREAM_TAGS,
> SECTION_ID_STREAM_GROUP,
> + SECTION_ID_STREAM_GROUP_COMPONENTS,
> + SECTION_ID_STREAM_GROUP_COMPONENT,
> + SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
> + SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
> SECTION_ID_STREAM_GROUP_STREAMS,
> SECTION_ID_STREAM_GROUP_STREAM,
> SECTION_ID_STREAM_GROUP_DISPOSITION,
> @@ -309,7 +314,11 @@ static struct section sections[] = {
> [SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
> [SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION] = { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_stream_disposition" },
> [SECTION_ID_STREAM_GROUP_STREAM_TAGS] = { SECTION_ID_STREAM_GROUP_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "stream_group_stream_tags" },
> - [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAMS, -1 }, .get_type = get_stream_group_type },
> + [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", 0, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_COMPONENTS, SECTION_ID_STREAM_GROUP_STREAMS, -1 } },
> + [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
> + [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
consistency: subcomponent or sub_component (probably I'd go with
SUBCOMPONENT/subcomponent everywhere).
> [SECTION_ID_STREAM_GROUP_STREAMS] = { SECTION_ID_STREAM_GROUP_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_STREAM, -1 }, .unique_name = "stream_group_streams" },
> [SECTION_ID_STREAM_GROUP_STREAM] = { SECTION_ID_STREAM_GROUP_STREAM, "stream", 0, { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAM_TAGS, -1 }, .unique_name = "stream_group_stream" },
> [SECTION_ID_STREAM_GROUP_DISPOSITION] = { SECTION_ID_STREAM_GROUP_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_disposition" },
> @@ -3385,13 +3394,35 @@ static int show_programs(WriterContext *w, InputFile *ifile)
> return ret;
> }
>
> +static void print_tile_grid_params(WriterContext *w, const AVStreamGroup *stg,
> + const AVStreamGroupTileGrid *tile_grid)
> +{
> + writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP_COMPONENT);
> + print_int("nb_tiles", tile_grid->nb_tiles);
> + print_int("coded_width", tile_grid->coded_width);
> + print_int("coded_height", tile_grid->coded_height);
> + print_int("horizontal_offset", tile_grid->horizontal_offset);
> + print_int("vertical_offset", tile_grid->vertical_offset);
> + print_int("width", tile_grid->width);
> + print_int("height", tile_grid->height);
> + writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_SUB_COMPONENTS);
> + for (int i = 0; i < tile_grid->nb_tiles; i++) {
> + writer_print_section_header(w, "tile_offset", SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
> + print_int("stream_index", tile_grid->offsets[i].idx);
> + print_int("tile_horizontal_offset", tile_grid->offsets[i].horizontal);
> + print_int("tile_vertical_offset", tile_grid->offsets[i].vertical);
> + writer_print_section_footer(w);
> + }
> + writer_print_section_footer(w);
> + writer_print_section_footer(w);
> +}
> +
> static void print_stream_group_params(WriterContext *w, AVStreamGroup *stg)
> {
> - const char *unknown = "unknown";
> - if (stg->type != AV_STREAM_GROUP_PARAMS_NONE)
> - print_str("type", av_x_if_null(avformat_stream_group_name(stg->type), unknown));
> - else
> - print_str_opt("type", unknown);
> + writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_COMPONENTS);
> + if (stg->type == AV_STREAM_GROUP_PARAMS_TILE_GRID)
> + print_tile_grid_params(w, stg, stg->params.tile_grid);
> + writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_COMPONENTS
> }
>
> static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *stg)
> @@ -3401,12 +3432,17 @@ static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *
> int i, ret = 0;
>
> av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
> - writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP);
> + writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP);
> print_int("index", stg->index);
> if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS) print_fmt ("id", "0x%"PRIx64, stg->id);
> else print_str_opt("id", "N/A");
> print_int("nb_streams", stg->nb_streams);
> - print_stream_group_params(w, stg);
> + if (stg->type != AV_STREAM_GROUP_PARAMS_NONE)
> + print_str("type", av_x_if_null(avformat_stream_group_name(stg->type), "unknown"));
> + else
> + print_str_opt("type", "unknown");
> + if (do_show_stream_group_components)
> + print_stream_group_params(w, stg);
>
> /* Print disposition information */
> if (do_show_stream_group_disposition)
> @@ -4333,6 +4369,7 @@ int main(int argc, char **argv)
> SET_DO_SHOW(PROGRAMS, programs);
> SET_DO_SHOW(STREAM_GROUP_DISPOSITION, stream_group_disposition);
> SET_DO_SHOW(STREAM_GROUPS, stream_groups);
> + SET_DO_SHOW(STREAM_GROUP_COMPONENTS, stream_group_components);
> SET_DO_SHOW(STREAMS, streams);
> SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
> SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
> diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
> index 49077ecfb3..6dc5b5f5af 100644
> --- a/tests/fate/mov.mak
> +++ b/tests/fate/mov.mak
> @@ -166,19 +166,19 @@ fate-mov-heic-demux-still-image-multiple-items: CMD = framecrc -i $(TARGET_SAMPL
> FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
> += fate-mov-heic-demux-still-image-grid
> fate-mov-heic-demux-still-image-grid: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C007.heic "" "-c:v copy -map 0:g:0" \
> - "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
> + "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>
> # heic demuxing - still image with multiple items in an overlay canvas.
> FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
> += fate-mov-heic-demux-still-image-iovl
> fate-mov-heic-demux-still-image-iovl: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C015.heic "" "-c:v copy -map 0:g:0" \
> - "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
> + "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>
> # heic demuxing - still image where one image item is placed twice on an overlay canvas.
> FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
> += fate-mov-heic-demux-still-image-iovl-2
> fate-mov-heic-demux-still-image-iovl-2: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C021.heic "" "-c:v copy -map 0:g:0" \
> - "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
> + "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
nit++, unrelated: might this be factorized?
>
> # Resulting remux should have:
> # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED
> diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid b/tests/ref/fate/mov-heic-demux-still-image-grid
> index b15ce91e1a..d8dfccea8f 100644
> --- a/tests/ref/fate/mov-heic-demux-still-image-grid
> +++ b/tests/ref/fate/mov-heic-demux-still-image-grid
> @@ -31,6 +31,35 @@ index=0
> id=0x3f1
> nb_streams=4
> type=Tile Grid
> +[COMPONENT]
> +nb_tiles=4
> +coded_width=2560
> +coded_height=1440
> +horizontal_offset=0
> +vertical_offset=0
> +width=2560
> +height=1440
> +[SUBCOMPONENT]
> +stream_index=0
> +tile_horizontal_offset=0
> +tile_vertical_offset=0
> +[/SUBCOMPONENT]
> +[SUBCOMPONENT]
> +stream_index=1
> +tile_horizontal_offset=1280
> +tile_vertical_offset=0
> +[/SUBCOMPONENT]
> +[SUBCOMPONENT]
> +stream_index=2
> +tile_horizontal_offset=0
> +tile_vertical_offset=720
> +[/SUBCOMPONENT]
> +[SUBCOMPONENT]
> +stream_index=3
> +tile_horizontal_offset=1280
> +tile_vertical_offset=720
> +[/SUBCOMPONENT]
> +[/COMPONENT]
> DISPOSITION:default=1
> DISPOSITION:dub=0
> DISPOSITION:original=0
> diff --git a/tests/ref/fate/mov-heic-demux-still-image-iovl b/tests/ref/fate/mov-heic-demux-still-image-iovl
> index 113b251c00..2b211267a4 100644
> --- a/tests/ref/fate/mov-heic-demux-still-image-iovl
> +++ b/tests/ref/fate/mov-heic-demux-still-image-iovl
> @@ -17,6 +17,25 @@ index=0
> id=0x3ee
> nb_streams=2
> type=Tile Grid
> +[COMPONENT]
> +nb_tiles=2
> +coded_width=1440
> +coded_height=960
> +horizontal_offset=0
> +vertical_offset=0
> +width=1440
> +height=960
> +[SUBCOMPONENT]
> +stream_index=0
> +tile_horizontal_offset=0
> +tile_vertical_offset=0
> +[/SUBCOMPONENT]
> +[SUBCOMPONENT]
> +stream_index=1
> +tile_horizontal_offset=160
> +tile_vertical_offset=240
> +[/SUBCOMPONENT]
I wonder if this should also show a type, to simplify
parsing/processing (especially for the JSON/XML output).
[...]
Looks good to me otherwise, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF Stream Group parameters
2024-03-07 0:49 ` [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF " James Almer
@ 2024-03-07 16:45 ` Stefano Sabatini
2024-03-07 17:49 ` James Almer
0 siblings, 1 reply; 8+ messages in thread
From: Stefano Sabatini @ 2024-03-07 16:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On date Wednesday 2024-03-06 21:49:52 -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> fftools/ffprobe.c | 157 +++++++++++++++++++++++-
> tests/fate/iamf.mak | 8 +-
> tests/fate/mov.mak | 8 +-
> tests/ref/fate/iamf-5_1_4 | 92 ++++++++++++++
> tests/ref/fate/iamf-7_1_4 | 92 ++++++++++++++
> tests/ref/fate/iamf-ambisonic_1 | 39 ++++++
> tests/ref/fate/iamf-stereo | 67 ++++++++++
> tests/ref/fate/mov-mp4-iamf-5_1_4 | 92 ++++++++++++++
> tests/ref/fate/mov-mp4-iamf-7_1_4 | 92 ++++++++++++++
> tests/ref/fate/mov-mp4-iamf-ambisonic_1 | 39 ++++++
> tests/ref/fate/mov-mp4-iamf-stereo | 67 ++++++++++
> 11 files changed, 741 insertions(+), 12 deletions(-)
>
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index c2ed8336f9..393f8d2a99 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -41,6 +41,7 @@
> #include "libavutil/display.h"
> #include "libavutil/hash.h"
> #include "libavutil/hdr_dynamic_metadata.h"
> +#include "libavutil/iamf.h"
> #include "libavutil/mastering_display_metadata.h"
> #include "libavutil/hdr_dynamic_vivid_metadata.h"
> #include "libavutil/dovi_meta.h"
> @@ -214,6 +215,12 @@ typedef enum {
> SECTION_ID_STREAM_GROUP_COMPONENT,
> SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
> SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
> + SECTION_ID_STREAM_GROUP_PIECES,
> + SECTION_ID_STREAM_GROUP_PIECE,
> + SECTION_ID_STREAM_GROUP_SUB_PIECES,
> + SECTION_ID_STREAM_GROUP_SUB_PIECE,
> + SECTION_ID_STREAM_GROUP_BLOCKS,
> + SECTION_ID_STREAM_GROUP_BLOCK,
> SECTION_ID_STREAM_GROUP_STREAMS,
> SECTION_ID_STREAM_GROUP_STREAM,
> SECTION_ID_STREAM_GROUP_DISPOSITION,
> @@ -287,8 +294,8 @@ static struct section sections[] = {
> [SECTION_ID_FRAME_SIDE_DATA_TIMECODE] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, "timecode", 0, { -1 } },
> [SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, -1 }, .element_name = "component", .unique_name = "frame_side_data_components" },
> [SECTION_ID_FRAME_SIDE_DATA_COMPONENT] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, -1 }, .unique_name = "frame_side_data_component", .element_name = "component_entry", .get_type = get_raw_string_type },
> - [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece" },
> - [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .get_type = get_raw_string_type },
> + [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece", .unique_name = "frame_side_data_pieces" },
> + [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .unique_name = "frame_side_data_piece", .get_type = get_raw_string_type },
> [SECTION_ID_FRAME_LOGS] = { SECTION_ID_FRAME_LOGS, "logs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_LOG, -1 } },
> [SECTION_ID_FRAME_LOG] = { SECTION_ID_FRAME_LOG, "log", 0, { -1 }, },
> [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
> @@ -318,7 +325,13 @@ static struct section sections[] = {
> [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
> [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
> [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
> - [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_PIECES, -1 }, .element_name = "subcomponent_entry", .get_type = get_raw_string_type },
> + [SECTION_ID_STREAM_GROUP_PIECES] = { SECTION_ID_STREAM_GROUP_PIECES, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_PIECE, -1 }, .element_name = "piece", .unique_name = "stream_group_pieces" },
> + [SECTION_ID_STREAM_GROUP_PIECE] = { SECTION_ID_STREAM_GROUP_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_PIECES, -1 }, .unique_name = "stream_group_piece", .element_name = "piece_entry", .get_type = get_raw_string_type },
> + [SECTION_ID_STREAM_GROUP_SUB_PIECES] = { SECTION_ID_STREAM_GROUP_SUB_PIECES, "subpieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_PIECE, -1 }, .element_name = "subpiece" },
> + [SECTION_ID_STREAM_GROUP_SUB_PIECE] = { SECTION_ID_STREAM_GROUP_SUB_PIECE, "subpiece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_BLOCKS, -1 }, .element_name = "subpiece_entry", .get_type = get_raw_string_type },
consistencty: I'd go with SUBPIECE/subpiece everywhere, also missing
doc/ffprobe.xsd update
> + [SECTION_ID_STREAM_GROUP_BLOCKS] = { SECTION_ID_STREAM_GROUP_BLOCKS, "blocks", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_BLOCK, -1 }, .element_name = "block" },
> + [SECTION_ID_STREAM_GROUP_BLOCK] = { SECTION_ID_STREAM_GROUP_BLOCK, "block", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "block_entry", .get_type = get_raw_string_type },
where are these used?
[...]
Thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters
2024-03-07 16:17 ` [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid " Stefano Sabatini
@ 2024-03-07 16:46 ` Stefano Sabatini
2024-03-07 17:53 ` James Almer
2024-03-07 17:52 ` James Almer
1 sibling, 1 reply; 8+ messages in thread
From: Stefano Sabatini @ 2024-03-07 16:46 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On date Thursday 2024-03-07 17:17:06 +0100, Stefano Sabatini wrote:
> On date Wednesday 2024-03-06 21:49:51 -0300, James Almer wrote:
> > Signed-off-by: James Almer <jamrial@gmail.com>
> > ---
> > fftools/ffprobe.c | 53 ++++++++++++++++---
> > tests/fate/mov.mak | 6 +--
> > .../ref/fate/mov-heic-demux-still-image-grid | 29 ++++++++++
> > .../ref/fate/mov-heic-demux-still-image-iovl | 19 +++++++
> > .../fate/mov-heic-demux-still-image-iovl-2 | 19 +++++++
> > 5 files changed, 115 insertions(+), 11 deletions(-)
> >
> > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> > index 4d4a85b5b0..c2ed8336f9 100644
> > --- a/fftools/ffprobe.c
> > +++ b/fftools/ffprobe.c
> > @@ -113,6 +113,7 @@ static int do_show_frames = 0;
> > static int do_show_packets = 0;
> > static int do_show_programs = 0;
> > static int do_show_stream_groups = 0;
> > +static int do_show_stream_group_components = 0;
> > static int do_show_streams = 0;
> > static int do_show_stream_disposition = 0;
> > static int do_show_stream_group_disposition = 0;
> > @@ -209,6 +210,10 @@ typedef enum {
> > SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION,
> > SECTION_ID_STREAM_GROUP_STREAM_TAGS,
> > SECTION_ID_STREAM_GROUP,
> > + SECTION_ID_STREAM_GROUP_COMPONENTS,
> > + SECTION_ID_STREAM_GROUP_COMPONENT,
> > + SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
> > + SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
> > SECTION_ID_STREAM_GROUP_STREAMS,
> > SECTION_ID_STREAM_GROUP_STREAM,
> > SECTION_ID_STREAM_GROUP_DISPOSITION,
> > @@ -309,7 +314,11 @@ static struct section sections[] = {
> > [SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
> > [SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION] = { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_stream_disposition" },
> > [SECTION_ID_STREAM_GROUP_STREAM_TAGS] = { SECTION_ID_STREAM_GROUP_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "stream_group_stream_tags" },
> > - [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAMS, -1 }, .get_type = get_stream_group_type },
> > + [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", 0, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_COMPONENTS, SECTION_ID_STREAM_GROUP_STREAMS, -1 } },
> > + [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
> > + [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
>
> > + [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
> > + [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
>
> consistency: subcomponent or sub_component (probably I'd go with
> SUBCOMPONENT/subcomponent everywhere).
also, missing ffprobe.xsd update?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF Stream Group parameters
2024-03-07 16:45 ` Stefano Sabatini
@ 2024-03-07 17:49 ` James Almer
0 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2024-03-07 17:49 UTC (permalink / raw)
To: ffmpeg-devel
On 3/7/2024 1:45 PM, Stefano Sabatini wrote:
> On date Wednesday 2024-03-06 21:49:52 -0300, James Almer wrote:
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> fftools/ffprobe.c | 157 +++++++++++++++++++++++-
>> tests/fate/iamf.mak | 8 +-
>> tests/fate/mov.mak | 8 +-
>> tests/ref/fate/iamf-5_1_4 | 92 ++++++++++++++
>> tests/ref/fate/iamf-7_1_4 | 92 ++++++++++++++
>> tests/ref/fate/iamf-ambisonic_1 | 39 ++++++
>> tests/ref/fate/iamf-stereo | 67 ++++++++++
>> tests/ref/fate/mov-mp4-iamf-5_1_4 | 92 ++++++++++++++
>> tests/ref/fate/mov-mp4-iamf-7_1_4 | 92 ++++++++++++++
>> tests/ref/fate/mov-mp4-iamf-ambisonic_1 | 39 ++++++
>> tests/ref/fate/mov-mp4-iamf-stereo | 67 ++++++++++
>> 11 files changed, 741 insertions(+), 12 deletions(-)
>>
>> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
>> index c2ed8336f9..393f8d2a99 100644
>> --- a/fftools/ffprobe.c
>> +++ b/fftools/ffprobe.c
>> @@ -41,6 +41,7 @@
>> #include "libavutil/display.h"
>> #include "libavutil/hash.h"
>> #include "libavutil/hdr_dynamic_metadata.h"
>> +#include "libavutil/iamf.h"
>> #include "libavutil/mastering_display_metadata.h"
>> #include "libavutil/hdr_dynamic_vivid_metadata.h"
>> #include "libavutil/dovi_meta.h"
>> @@ -214,6 +215,12 @@ typedef enum {
>> SECTION_ID_STREAM_GROUP_COMPONENT,
>> SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
>> SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
>> + SECTION_ID_STREAM_GROUP_PIECES,
>> + SECTION_ID_STREAM_GROUP_PIECE,
>> + SECTION_ID_STREAM_GROUP_SUB_PIECES,
>> + SECTION_ID_STREAM_GROUP_SUB_PIECE,
>> + SECTION_ID_STREAM_GROUP_BLOCKS,
>> + SECTION_ID_STREAM_GROUP_BLOCK,
>> SECTION_ID_STREAM_GROUP_STREAMS,
>> SECTION_ID_STREAM_GROUP_STREAM,
>> SECTION_ID_STREAM_GROUP_DISPOSITION,
>> @@ -287,8 +294,8 @@ static struct section sections[] = {
>> [SECTION_ID_FRAME_SIDE_DATA_TIMECODE] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, "timecode", 0, { -1 } },
>> [SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, -1 }, .element_name = "component", .unique_name = "frame_side_data_components" },
>> [SECTION_ID_FRAME_SIDE_DATA_COMPONENT] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, -1 }, .unique_name = "frame_side_data_component", .element_name = "component_entry", .get_type = get_raw_string_type },
>> - [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece" },
>> - [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .get_type = get_raw_string_type },
>> + [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece", .unique_name = "frame_side_data_pieces" },
>> + [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .unique_name = "frame_side_data_piece", .get_type = get_raw_string_type },
>> [SECTION_ID_FRAME_LOGS] = { SECTION_ID_FRAME_LOGS, "logs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_LOG, -1 } },
>> [SECTION_ID_FRAME_LOG] = { SECTION_ID_FRAME_LOG, "log", 0, { -1 }, },
>> [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
>> @@ -318,7 +325,13 @@ static struct section sections[] = {
>> [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
>> [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
>> [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
>> - [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
>
>> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_PIECES, -1 }, .element_name = "subcomponent_entry", .get_type = get_raw_string_type },
>> + [SECTION_ID_STREAM_GROUP_PIECES] = { SECTION_ID_STREAM_GROUP_PIECES, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_PIECE, -1 }, .element_name = "piece", .unique_name = "stream_group_pieces" },
>> + [SECTION_ID_STREAM_GROUP_PIECE] = { SECTION_ID_STREAM_GROUP_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_PIECES, -1 }, .unique_name = "stream_group_piece", .element_name = "piece_entry", .get_type = get_raw_string_type },
>> + [SECTION_ID_STREAM_GROUP_SUB_PIECES] = { SECTION_ID_STREAM_GROUP_SUB_PIECES, "subpieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_PIECE, -1 }, .element_name = "subpiece" },
>> + [SECTION_ID_STREAM_GROUP_SUB_PIECE] = { SECTION_ID_STREAM_GROUP_SUB_PIECE, "subpiece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_BLOCKS, -1 }, .element_name = "subpiece_entry", .get_type = get_raw_string_type },
>
> consistencty: I'd go with SUBPIECE/subpiece everywhere, also missing
> doc/ffprobe.xsd update
>
>> + [SECTION_ID_STREAM_GROUP_BLOCKS] = { SECTION_ID_STREAM_GROUP_BLOCKS, "blocks", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_BLOCK, -1 }, .element_name = "block" },
>> + [SECTION_ID_STREAM_GROUP_BLOCK] = { SECTION_ID_STREAM_GROUP_BLOCK, "block", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "block_entry", .get_type = get_raw_string_type },
>
> where are these used?
In print_iamf_param_definition(), where sections[] is checked for the
child section of the input section_id, they'd be used when called by
print_iamf_submix_params().
Can add a comment so it doesn't look like they are unused, because the
tests currently doesn't cover it.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters
2024-03-07 16:17 ` [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid " Stefano Sabatini
2024-03-07 16:46 ` Stefano Sabatini
@ 2024-03-07 17:52 ` James Almer
1 sibling, 0 replies; 8+ messages in thread
From: James Almer @ 2024-03-07 17:52 UTC (permalink / raw)
To: ffmpeg-devel
On 3/7/2024 1:17 PM, Stefano Sabatini wrote:
> On date Wednesday 2024-03-06 21:49:51 -0300, James Almer wrote:
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> fftools/ffprobe.c | 53 ++++++++++++++++---
>> tests/fate/mov.mak | 6 +--
>> .../ref/fate/mov-heic-demux-still-image-grid | 29 ++++++++++
>> .../ref/fate/mov-heic-demux-still-image-iovl | 19 +++++++
>> .../fate/mov-heic-demux-still-image-iovl-2 | 19 +++++++
>> 5 files changed, 115 insertions(+), 11 deletions(-)
>>
>> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
>> index 4d4a85b5b0..c2ed8336f9 100644
>> --- a/fftools/ffprobe.c
>> +++ b/fftools/ffprobe.c
>> @@ -113,6 +113,7 @@ static int do_show_frames = 0;
>> static int do_show_packets = 0;
>> static int do_show_programs = 0;
>> static int do_show_stream_groups = 0;
>> +static int do_show_stream_group_components = 0;
>> static int do_show_streams = 0;
>> static int do_show_stream_disposition = 0;
>> static int do_show_stream_group_disposition = 0;
>> @@ -209,6 +210,10 @@ typedef enum {
>> SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION,
>> SECTION_ID_STREAM_GROUP_STREAM_TAGS,
>> SECTION_ID_STREAM_GROUP,
>> + SECTION_ID_STREAM_GROUP_COMPONENTS,
>> + SECTION_ID_STREAM_GROUP_COMPONENT,
>> + SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
>> + SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
>> SECTION_ID_STREAM_GROUP_STREAMS,
>> SECTION_ID_STREAM_GROUP_STREAM,
>> SECTION_ID_STREAM_GROUP_DISPOSITION,
>> @@ -309,7 +314,11 @@ static struct section sections[] = {
>> [SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
>> [SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION] = { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_stream_disposition" },
>> [SECTION_ID_STREAM_GROUP_STREAM_TAGS] = { SECTION_ID_STREAM_GROUP_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "stream_group_stream_tags" },
>> - [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAMS, -1 }, .get_type = get_stream_group_type },
>> + [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", 0, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_COMPONENTS, SECTION_ID_STREAM_GROUP_STREAMS, -1 } },
>> + [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
>> + [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
>
>> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
>> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
>
> consistency: subcomponent or sub_component (probably I'd go with
> SUBCOMPONENT/subcomponent everywhere).
Ok.
>
>> [SECTION_ID_STREAM_GROUP_STREAMS] = { SECTION_ID_STREAM_GROUP_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_STREAM, -1 }, .unique_name = "stream_group_streams" },
>> [SECTION_ID_STREAM_GROUP_STREAM] = { SECTION_ID_STREAM_GROUP_STREAM, "stream", 0, { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAM_TAGS, -1 }, .unique_name = "stream_group_stream" },
>> [SECTION_ID_STREAM_GROUP_DISPOSITION] = { SECTION_ID_STREAM_GROUP_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_disposition" },
>> @@ -3385,13 +3394,35 @@ static int show_programs(WriterContext *w, InputFile *ifile)
>> return ret;
>> }
>>
>> +static void print_tile_grid_params(WriterContext *w, const AVStreamGroup *stg,
>> + const AVStreamGroupTileGrid *tile_grid)
>> +{
>> + writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP_COMPONENT);
>> + print_int("nb_tiles", tile_grid->nb_tiles);
>> + print_int("coded_width", tile_grid->coded_width);
>> + print_int("coded_height", tile_grid->coded_height);
>> + print_int("horizontal_offset", tile_grid->horizontal_offset);
>> + print_int("vertical_offset", tile_grid->vertical_offset);
>> + print_int("width", tile_grid->width);
>> + print_int("height", tile_grid->height);
>> + writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_SUB_COMPONENTS);
>> + for (int i = 0; i < tile_grid->nb_tiles; i++) {
>> + writer_print_section_header(w, "tile_offset", SECTION_ID_STREAM_GROUP_SUB_COMPONENT);
>> + print_int("stream_index", tile_grid->offsets[i].idx);
>> + print_int("tile_horizontal_offset", tile_grid->offsets[i].horizontal);
>> + print_int("tile_vertical_offset", tile_grid->offsets[i].vertical);
>> + writer_print_section_footer(w);
>> + }
>> + writer_print_section_footer(w);
>> + writer_print_section_footer(w);
>> +}
>> +
>> static void print_stream_group_params(WriterContext *w, AVStreamGroup *stg)
>> {
>> - const char *unknown = "unknown";
>> - if (stg->type != AV_STREAM_GROUP_PARAMS_NONE)
>> - print_str("type", av_x_if_null(avformat_stream_group_name(stg->type), unknown));
>> - else
>> - print_str_opt("type", unknown);
>> + writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP_COMPONENTS);
>> + if (stg->type == AV_STREAM_GROUP_PARAMS_TILE_GRID)
>> + print_tile_grid_params(w, stg, stg->params.tile_grid);
>> + writer_print_section_footer(w); // SECTION_ID_STREAM_GROUP_COMPONENTS
>> }
>>
>> static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *stg)
>> @@ -3401,12 +3432,17 @@ static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *
>> int i, ret = 0;
>>
>> av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
>> - writer_print_section_header(w, stg, SECTION_ID_STREAM_GROUP);
>> + writer_print_section_header(w, NULL, SECTION_ID_STREAM_GROUP);
>> print_int("index", stg->index);
>> if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS) print_fmt ("id", "0x%"PRIx64, stg->id);
>> else print_str_opt("id", "N/A");
>> print_int("nb_streams", stg->nb_streams);
>> - print_stream_group_params(w, stg);
>> + if (stg->type != AV_STREAM_GROUP_PARAMS_NONE)
>> + print_str("type", av_x_if_null(avformat_stream_group_name(stg->type), "unknown"));
>> + else
>> + print_str_opt("type", "unknown");
>> + if (do_show_stream_group_components)
>> + print_stream_group_params(w, stg);
>>
>> /* Print disposition information */
>> if (do_show_stream_group_disposition)
>> @@ -4333,6 +4369,7 @@ int main(int argc, char **argv)
>> SET_DO_SHOW(PROGRAMS, programs);
>> SET_DO_SHOW(STREAM_GROUP_DISPOSITION, stream_group_disposition);
>> SET_DO_SHOW(STREAM_GROUPS, stream_groups);
>> + SET_DO_SHOW(STREAM_GROUP_COMPONENTS, stream_group_components);
>> SET_DO_SHOW(STREAMS, streams);
>> SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
>> SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
>> diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
>> index 49077ecfb3..6dc5b5f5af 100644
>> --- a/tests/fate/mov.mak
>> +++ b/tests/fate/mov.mak
>> @@ -166,19 +166,19 @@ fate-mov-heic-demux-still-image-multiple-items: CMD = framecrc -i $(TARGET_SAMPL
>> FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
>> += fate-mov-heic-demux-still-image-grid
>> fate-mov-heic-demux-still-image-grid: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C007.heic "" "-c:v copy -map 0:g:0" \
>> - "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>> + "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>>
>> # heic demuxing - still image with multiple items in an overlay canvas.
>> FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
>> += fate-mov-heic-demux-still-image-iovl
>> fate-mov-heic-demux-still-image-iovl: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C015.heic "" "-c:v copy -map 0:g:0" \
>> - "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>> + "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>>
>> # heic demuxing - still image where one image item is placed twice on an overlay canvas.
>> FATE_MOV_FFMPEG_FFPROBE_SAMPLES-$(call DEMMUX, MOV, FRAMECRC, HEVC_DECODER HEVC_PARSER) \
>> += fate-mov-heic-demux-still-image-iovl-2
>> fate-mov-heic-demux-still-image-iovl-2: CMD = stream_demux mov $(TARGET_SAMPLES)/heif-conformance/C021.heic "" "-c:v copy -map 0:g:0" \
>> - "-show_entries stream_group=index,id,nb_streams,type:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>
>> + "-show_entries stream_group=index,id,nb_streams,type:stream_group_components:stream_group_disposition:stream_group_tags:stream_group_stream=index,id:stream_group_stream_disposition"
>
> nit++, unrelated: might this be factorized?
Sure.
>
>>
>> # Resulting remux should have:
>> # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED
>> diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid b/tests/ref/fate/mov-heic-demux-still-image-grid
>> index b15ce91e1a..d8dfccea8f 100644
>> --- a/tests/ref/fate/mov-heic-demux-still-image-grid
>> +++ b/tests/ref/fate/mov-heic-demux-still-image-grid
>> @@ -31,6 +31,35 @@ index=0
>> id=0x3f1
>> nb_streams=4
>> type=Tile Grid
>> +[COMPONENT]
>> +nb_tiles=4
>> +coded_width=2560
>> +coded_height=1440
>> +horizontal_offset=0
>> +vertical_offset=0
>> +width=2560
>> +height=1440
>> +[SUBCOMPONENT]
>> +stream_index=0
>> +tile_horizontal_offset=0
>> +tile_vertical_offset=0
>> +[/SUBCOMPONENT]
>> +[SUBCOMPONENT]
>> +stream_index=1
>> +tile_horizontal_offset=1280
>> +tile_vertical_offset=0
>> +[/SUBCOMPONENT]
>> +[SUBCOMPONENT]
>> +stream_index=2
>> +tile_horizontal_offset=0
>> +tile_vertical_offset=720
>> +[/SUBCOMPONENT]
>> +[SUBCOMPONENT]
>> +stream_index=3
>> +tile_horizontal_offset=1280
>> +tile_vertical_offset=720
>> +[/SUBCOMPONENT]
>> +[/COMPONENT]
>> DISPOSITION:default=1
>> DISPOSITION:dub=0
>> DISPOSITION:original=0
>> diff --git a/tests/ref/fate/mov-heic-demux-still-image-iovl b/tests/ref/fate/mov-heic-demux-still-image-iovl
>> index 113b251c00..2b211267a4 100644
>> --- a/tests/ref/fate/mov-heic-demux-still-image-iovl
>> +++ b/tests/ref/fate/mov-heic-demux-still-image-iovl
>> @@ -17,6 +17,25 @@ index=0
>> id=0x3ee
>> nb_streams=2
>> type=Tile Grid
>> +[COMPONENT]
>> +nb_tiles=2
>> +coded_width=1440
>> +coded_height=960
>> +horizontal_offset=0
>> +vertical_offset=0
>> +width=1440
>> +height=960
>
>> +[SUBCOMPONENT]
>> +stream_index=0
>> +tile_horizontal_offset=0
>> +tile_vertical_offset=0
>> +[/SUBCOMPONENT]
>> +[SUBCOMPONENT]
>> +stream_index=1
>> +tile_horizontal_offset=160
>> +tile_vertical_offset=240
>> +[/SUBCOMPONENT]
>
> I wonder if this should also show a type, to simplify
> parsing/processing (especially for the JSON/XML output).
It does, just not as an item but as a property of the section, so it's
not reflected in the default output, only xml/json and such like you
said, e.g <component type="IAMF Mix Presentation">, <subcomponent
type="IAMF Submix">, <piece type="IAMF Submix Element">.
>
> [...]
>
> Looks good to me otherwise, thanks.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters
2024-03-07 16:46 ` Stefano Sabatini
@ 2024-03-07 17:53 ` James Almer
0 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2024-03-07 17:53 UTC (permalink / raw)
To: ffmpeg-devel
On 3/7/2024 1:46 PM, Stefano Sabatini wrote:
> On date Thursday 2024-03-07 17:17:06 +0100, Stefano Sabatini wrote:
>> On date Wednesday 2024-03-06 21:49:51 -0300, James Almer wrote:
>>> Signed-off-by: James Almer <jamrial@gmail.com>
>>> ---
>>> fftools/ffprobe.c | 53 ++++++++++++++++---
>>> tests/fate/mov.mak | 6 +--
>>> .../ref/fate/mov-heic-demux-still-image-grid | 29 ++++++++++
>>> .../ref/fate/mov-heic-demux-still-image-iovl | 19 +++++++
>>> .../fate/mov-heic-demux-still-image-iovl-2 | 19 +++++++
>>> 5 files changed, 115 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
>>> index 4d4a85b5b0..c2ed8336f9 100644
>>> --- a/fftools/ffprobe.c
>>> +++ b/fftools/ffprobe.c
>>> @@ -113,6 +113,7 @@ static int do_show_frames = 0;
>>> static int do_show_packets = 0;
>>> static int do_show_programs = 0;
>>> static int do_show_stream_groups = 0;
>>> +static int do_show_stream_group_components = 0;
>>> static int do_show_streams = 0;
>>> static int do_show_stream_disposition = 0;
>>> static int do_show_stream_group_disposition = 0;
>>> @@ -209,6 +210,10 @@ typedef enum {
>>> SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION,
>>> SECTION_ID_STREAM_GROUP_STREAM_TAGS,
>>> SECTION_ID_STREAM_GROUP,
>>> + SECTION_ID_STREAM_GROUP_COMPONENTS,
>>> + SECTION_ID_STREAM_GROUP_COMPONENT,
>>> + SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
>>> + SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
>>> SECTION_ID_STREAM_GROUP_STREAMS,
>>> SECTION_ID_STREAM_GROUP_STREAM,
>>> SECTION_ID_STREAM_GROUP_DISPOSITION,
>>> @@ -309,7 +314,11 @@ static struct section sections[] = {
>>> [SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
>>> [SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION] = { SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_group_stream_disposition" },
>>> [SECTION_ID_STREAM_GROUP_STREAM_TAGS] = { SECTION_ID_STREAM_GROUP_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "stream_group_stream_tags" },
>>> - [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_STREAMS, -1 }, .get_type = get_stream_group_type },
>>> + [SECTION_ID_STREAM_GROUP] = { SECTION_ID_STREAM_GROUP, "stream_group", 0, { SECTION_ID_STREAM_GROUP_TAGS, SECTION_ID_STREAM_GROUP_DISPOSITION, SECTION_ID_STREAM_GROUP_COMPONENTS, SECTION_ID_STREAM_GROUP_STREAMS, -1 } },
>>> + [SECTION_ID_STREAM_GROUP_COMPONENTS] = { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
>>> + [SECTION_ID_STREAM_GROUP_COMPONENT] = { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
>>
>>> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
>>> + [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] = { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
>>
>> consistency: subcomponent or sub_component (probably I'd go with
>> SUBCOMPONENT/subcomponent everywhere).
>
> also, missing ffprobe.xsd update?
Ok.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-03-07 17:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07 0:49 [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid Stream Group parameters James Almer
2024-03-07 0:49 ` [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF " James Almer
2024-03-07 16:45 ` Stefano Sabatini
2024-03-07 17:49 ` James Almer
2024-03-07 16:17 ` [FFmpeg-devel] [PATCH 1/2 v2] fftools/ffprobe: export Tile Grid " Stefano Sabatini
2024-03-07 16:46 ` Stefano Sabatini
2024-03-07 17:53 ` James Almer
2024-03-07 17:52 ` James Almer
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