From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4975F492FF for ; Fri, 8 Mar 2024 20:24:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BDA7C68CF78; Fri, 8 Mar 2024 22:24:52 +0200 (EET) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51A9668CEE7 for ; Fri, 8 Mar 2024 22:24:46 +0200 (EET) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e62c65865cso2119158b3a.2 for ; Fri, 08 Mar 2024 12:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709929483; x=1710534283; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=x6Imlmspm/mlsSuX9OOtmdLHT1IE9yHYxZzrNvWLGd0=; b=nQE8v14y+uaoVF9RQrNoBsjbA65I72wEaLGtZt5z3QvBIi0IEnzV7dgOTp35sEGMRS dD0+7ujGLMzPRfmVd9gRMtlmzwcvExps1jdwv8PRYEmDs7pkuV4chYVtcFiUulA8LBcf j38oJ0SJl9aTRRjbWB/cAn4VF11XQayVvUCDjzPn914OVyOcQdtQHK92hH6gkNTJma3x nyN97kW4LxIAmdOFdn8t50JsHuo+qeEXRhuY3RKoGLI5FSSRnZ9BIPlHBdxVBlmt93db FY9kQMhPUJEm2u5CWJhtzBvcbnmLB0jW02rIdJmQoj3q4F+IPloqmrH4fyYtn3TtsXnK sc0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709929483; x=1710534283; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=x6Imlmspm/mlsSuX9OOtmdLHT1IE9yHYxZzrNvWLGd0=; b=QnhiPYBBrxr6GaL/577wN7J/sLiySkqSqDFuHBGVRCmxcozy9YxneTYR8izEq2tzsv RRf0x4xr/op0+NHRYhYUfghIaXgZhtjSHygDjOozk6eRuZ1b7Tyrpl3twpbza1OeE93o LwT7DgcOe+5q8Z4+g8b5qNABdruPWl7jlZ7o9/DzbefwPVW92wIxBRM4c8Ua503TC1do JRpFJdVL7yL2MtDz6KyqNfNHGc90F9oHYSh9dst1OsRWjuZwBL5fl15oSq9LZziWEUp6 H4wzfrFwu/zp8nxBPoid8lIQtcp+nVuqiSb2OTD3pVak9VuPo6PZi2jIhWjpKsQZF50N I3Rw== X-Gm-Message-State: AOJu0YxcCZq9OmSIKYC5xRCudg7wSnKUwXruOh8G+fmwT2te+ZJVkmo/ FUVkTCMeFzXyZEfjEMXgUJxgtnPS8QlxjXJkHWW+JQd5a1XNxRmrqYGh5DWI X-Google-Smtp-Source: AGHT+IFM4LCxoxdouxGJqtwPpGBQVJf8uGOdAiZX4xxIr+h/X44qBFUqVVcDLMl0b4N5qRjEfRgVvw== X-Received: by 2002:a05:6a20:a10d:b0:1a1:847f:8e8c with SMTP id q13-20020a056a20a10d00b001a1847f8e8cmr128396pzk.20.1709929483088; Fri, 08 Mar 2024 12:24:43 -0800 (PST) Received: from localhost.localdomain ([190.194.169.124]) by smtp.gmail.com with ESMTPSA id p18-20020aa79e92000000b006e55016966fsm100253pfq.81.2024.03.08.12.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 12:24:42 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Mar 2024 17:24:47 -0300 Message-ID: <20240308202448.62576-1-jamrial@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2 v3] fftools/ffprobe: export Tile Grid Stream Group parameters X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- doc/ffprobe.xsd | 50 +++++++++++++++++ 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 +++++++ 6 files changed, 165 insertions(+), 11 deletions(-) I'll factorize the tests arguments later. diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd index 5010c5a45f..bd52000725 100644 --- a/doc/ffprobe.xsd +++ b/doc/ffprobe.xsd @@ -15,6 +15,7 @@ + @@ -229,6 +230,12 @@ + + + + + + @@ -325,6 +332,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index e003ac6cfd..bf635ffbd6 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -114,6 +114,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; @@ -210,6 +211,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_SUBCOMPONENTS, + SECTION_ID_STREAM_GROUP_SUBCOMPONENT, SECTION_ID_STREAM_GROUP_STREAMS, SECTION_ID_STREAM_GROUP_STREAM, SECTION_ID_STREAM_GROUP_DISPOSITION, @@ -310,7 +315,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_SUBCOMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type }, + [SECTION_ID_STREAM_GROUP_SUBCOMPONENTS] = { SECTION_ID_STREAM_GROUP_SUBCOMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUBCOMPONENT, -1 }, .element_name = "component" }, + [SECTION_ID_STREAM_GROUP_SUBCOMPONENT] = { SECTION_ID_STREAM_GROUP_SUBCOMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "subcomponent_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" }, @@ -3491,13 +3500,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_SUBCOMPONENTS); + for (int i = 0; i < tile_grid->nb_tiles; i++) { + writer_print_section_header(w, "tile_offset", SECTION_ID_STREAM_GROUP_SUBCOMPONENT); + 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) @@ -3507,12 +3538,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) @@ -4439,6 +4475,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".