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 6236449253 for ; Thu, 7 Mar 2024 17:52:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7D5BC68CB46; Thu, 7 Mar 2024 19:52:33 +0200 (EET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5C5C68B22E for ; Thu, 7 Mar 2024 19:52:26 +0200 (EET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1dc1ff3ba1aso9775305ad.3 for ; Thu, 07 Mar 2024 09:52:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709833944; x=1710438744; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PWdzyu5Ri4swxnYFPCN7rAiiE9Hkwk98z1hdE2SfsJE=; b=On9ApBwvTMuGigWZsQSeUhRbiuUj0Z/9vIqQU+po0QSbHSC4++UKOuJW3B3+xAstI3 lmKVsFrWOYefUuMCHs4ygrT8S8CqUikJ5o2e4GB2vKbAPTIECo4Dtyl9gF6V1+Sr+Jo3 h5i6kI0c+w8dK6SajUbGoQNl58m9+bgjKxfj+HKsfIpF0AB/RlSytnuqfXbWd0SvCKIw QoAbZ7WawyjiZ8FKx0Jq5jLvOooHSqYpwrH0CJrhk9UCGct7DjNi3QXHcY07WEl3Lv5O 3y1WdUGaeYvFoKooDrrnO6YJNjokj+gVJveig2b4pHKVxy/ZspYHb0bvhrlq1fHqYPYV WxtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709833944; x=1710438744; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PWdzyu5Ri4swxnYFPCN7rAiiE9Hkwk98z1hdE2SfsJE=; b=gL2mI+huXHDnV/5sZDn4NqN4GVHn2mQGw29qnvBPbMpYjhcGXzz0mKqhFsyXNwotrM rtgOT0ppOWd2Sez9mhchLw/9yLrTZCWcAHHok1CcsswlJubXcK5lkbd5Xb+cprx54Vz0 j8qw1wggmZGrfZ2SOccmaaJowHE2Z/Eoib3jlPsnYw4Vv+/duGFV3bU9NWeze3KzsWFw hJDMfZuZgjYt/GL2IVFR0S1HNHnIGmfrVD36Df6Kkt4yonRvAQ9K5K/nZz1JIvNAHivb mT/6NdxPaEz2kkifcOt/EQ+KF9un+3KRF5cyo8YlL6KXtdw5zmXhZhL0oz/CAesQ+3LR 5j1Q== X-Gm-Message-State: AOJu0Yw1Anf0fMmWH1+O9C76XVcSSOYL1SyzYcOTBdfsmV6PemOxsEBv to/VwG+RngVRmF7ZJJn2juiCEZ78jgsAXmkf0vWhuBlHFKgDioizJbj4P9i2 X-Google-Smtp-Source: AGHT+IHAgiREeG5roowirNZlMYhkDYtSuZuFtVU6NwMS7Rpb75KhQw/vOOH18+lKUMxn9IUZwduNww== X-Received: by 2002:a17:902:a717:b0:1dd:f36:2574 with SMTP id w23-20020a170902a71700b001dd0f362574mr7988687plq.69.1709833943727; Thu, 07 Mar 2024 09:52:23 -0800 (PST) Received: from [192.168.0.14] ([190.194.169.124]) by smtp.gmail.com with ESMTPSA id d15-20020a170902654f00b001dd63f05c20sm218882pln.230.2024.03.07.09.52.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Mar 2024 09:52:23 -0800 (PST) Message-ID: <3890db73-71cc-43b4-97f4-c50b8a2036bf@gmail.com> Date: Thu, 7 Mar 2024 14:52:38 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20240307004952.9417-1-jamrial@gmail.com> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/2 v2] 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 >> --- >> 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 , , . > > [...] > > 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".