Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] ffprobe: always print all Stereo3D fields
@ 2024-06-18 19:03 James Almer
  2024-06-20 15:54 ` James Almer
  2024-06-25  9:17 ` Anton Khirnov
  0 siblings, 2 replies; 3+ messages in thread
From: James Almer @ 2024-06-18 19:03 UTC (permalink / raw)
  To: ffmpeg-devel

ffprobe is meant to generate parseable output, and if a field is present, it
should be printed even if it has a default value.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffprobe.c                            |  9 +++------
 tests/ref/fate/matroska-spherical-mono       |  3 +++
 tests/ref/fate/matroska-spherical-mono-remux |  6 ++++++
 tests/ref/fate/matroska-stereo_mode          | 12 ++++++++++++
 tests/ref/fate/matroska-vp8-alpha-remux      |  3 +++
 5 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index a814cb5ade..d7ba980ff9 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2546,12 +2546,9 @@ static void print_pkt_side_data(WriterContext *w,
             print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
             print_str("view", av_stereo3d_view_name(stereo->view));
             print_str("primary_eye", av_stereo3d_primary_eye_name(stereo->primary_eye));
-            if (stereo->baseline)
-                print_int("baseline", stereo->baseline);
-            if (stereo->horizontal_disparity_adjustment.num && stereo->horizontal_disparity_adjustment.den)
-                print_q("horizontal_disparity_adjustment", stereo->horizontal_disparity_adjustment, '/');
-            if (stereo->horizontal_field_of_view)
-                print_int("horizontal_field_of_view", stereo->horizontal_field_of_view);
+            print_int("baseline", stereo->baseline);
+            print_q("horizontal_disparity_adjustment", stereo->horizontal_disparity_adjustment, '/');
+            print_int("horizontal_field_of_view", stereo->horizontal_field_of_view);
         } else if (sd->type == AV_PKT_DATA_SPHERICAL) {
             const AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
             print_str("projection", av_spherical_projection_name(spherical->projection));
diff --git a/tests/ref/fate/matroska-spherical-mono b/tests/ref/fate/matroska-spherical-mono
index 08b94e455b..c52ca8e7ee 100644
--- a/tests/ref/fate/matroska-spherical-mono
+++ b/tests/ref/fate/matroska-spherical-mono
@@ -5,6 +5,9 @@ type=2D
 inverted=0
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [SIDE_DATA]
 side_data_type=Spherical Mapping
diff --git a/tests/ref/fate/matroska-spherical-mono-remux b/tests/ref/fate/matroska-spherical-mono-remux
index 0ca77c8074..10b92d5f2e 100644
--- a/tests/ref/fate/matroska-spherical-mono-remux
+++ b/tests/ref/fate/matroska-spherical-mono-remux
@@ -29,6 +29,9 @@ type=2D
 inverted=0
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [SIDE_DATA]
 side_data_type=Spherical Mapping
@@ -55,6 +58,9 @@ type=2D
 inverted=0
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [SIDE_DATA]
 side_data_type=Spherical Mapping
diff --git a/tests/ref/fate/matroska-stereo_mode b/tests/ref/fate/matroska-stereo_mode
index 13bce13cb8..a1aab1e38e 100644
--- a/tests/ref/fate/matroska-stereo_mode
+++ b/tests/ref/fate/matroska-stereo_mode
@@ -134,6 +134,9 @@ type=side by side
 inverted=0
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [/STREAM]
 [STREAM]
@@ -151,6 +154,9 @@ type=top and bottom
 inverted=1
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [/STREAM]
 [STREAM]
@@ -166,6 +172,9 @@ type=interleaved lines
 inverted=1
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [/STREAM]
 [STREAM]
@@ -182,6 +191,9 @@ type=interleaved columns
 inverted=1
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [/STREAM]
 [STREAM]
diff --git a/tests/ref/fate/matroska-vp8-alpha-remux b/tests/ref/fate/matroska-vp8-alpha-remux
index e54304cafd..ea8a089cec 100644
--- a/tests/ref/fate/matroska-vp8-alpha-remux
+++ b/tests/ref/fate/matroska-vp8-alpha-remux
@@ -37,5 +37,8 @@ type=2D
 inverted=0
 view=packed
 primary_eye=none
+baseline=0
+horizontal_disparity_adjustment=0/0
+horizontal_field_of_view=0
 [/SIDE_DATA]
 [/STREAM]
-- 
2.45.2

_______________________________________________
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] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffprobe: always print all Stereo3D fields
  2024-06-18 19:03 [FFmpeg-devel] [PATCH] ffprobe: always print all Stereo3D fields James Almer
@ 2024-06-20 15:54 ` James Almer
  2024-06-25  9:17 ` Anton Khirnov
  1 sibling, 0 replies; 3+ messages in thread
From: James Almer @ 2024-06-20 15:54 UTC (permalink / raw)
  To: ffmpeg-devel

On 6/18/2024 4:03 PM, James Almer wrote:
> ffprobe is meant to generate parseable output, and if a field is present, it
> should be printed even if it has a default value.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   fftools/ffprobe.c                            |  9 +++------
>   tests/ref/fate/matroska-spherical-mono       |  3 +++
>   tests/ref/fate/matroska-spherical-mono-remux |  6 ++++++
>   tests/ref/fate/matroska-stereo_mode          | 12 ++++++++++++
>   tests/ref/fate/matroska-vp8-alpha-remux      |  3 +++
>   5 files changed, 27 insertions(+), 6 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index a814cb5ade..d7ba980ff9 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -2546,12 +2546,9 @@ static void print_pkt_side_data(WriterContext *w,
>               print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
>               print_str("view", av_stereo3d_view_name(stereo->view));
>               print_str("primary_eye", av_stereo3d_primary_eye_name(stereo->primary_eye));
> -            if (stereo->baseline)
> -                print_int("baseline", stereo->baseline);
> -            if (stereo->horizontal_disparity_adjustment.num && stereo->horizontal_disparity_adjustment.den)
> -                print_q("horizontal_disparity_adjustment", stereo->horizontal_disparity_adjustment, '/');
> -            if (stereo->horizontal_field_of_view)
> -                print_int("horizontal_field_of_view", stereo->horizontal_field_of_view);
> +            print_int("baseline", stereo->baseline);
> +            print_q("horizontal_disparity_adjustment", stereo->horizontal_disparity_adjustment, '/');
> +            print_int("horizontal_field_of_view", stereo->horizontal_field_of_view);
>           } else if (sd->type == AV_PKT_DATA_SPHERICAL) {
>               const AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
>               print_str("projection", av_spherical_projection_name(spherical->projection));
> diff --git a/tests/ref/fate/matroska-spherical-mono b/tests/ref/fate/matroska-spherical-mono
> index 08b94e455b..c52ca8e7ee 100644
> --- a/tests/ref/fate/matroska-spherical-mono
> +++ b/tests/ref/fate/matroska-spherical-mono
> @@ -5,6 +5,9 @@ type=2D
>   inverted=0
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [SIDE_DATA]
>   side_data_type=Spherical Mapping
> diff --git a/tests/ref/fate/matroska-spherical-mono-remux b/tests/ref/fate/matroska-spherical-mono-remux
> index 0ca77c8074..10b92d5f2e 100644
> --- a/tests/ref/fate/matroska-spherical-mono-remux
> +++ b/tests/ref/fate/matroska-spherical-mono-remux
> @@ -29,6 +29,9 @@ type=2D
>   inverted=0
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [SIDE_DATA]
>   side_data_type=Spherical Mapping
> @@ -55,6 +58,9 @@ type=2D
>   inverted=0
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [SIDE_DATA]
>   side_data_type=Spherical Mapping
> diff --git a/tests/ref/fate/matroska-stereo_mode b/tests/ref/fate/matroska-stereo_mode
> index 13bce13cb8..a1aab1e38e 100644
> --- a/tests/ref/fate/matroska-stereo_mode
> +++ b/tests/ref/fate/matroska-stereo_mode
> @@ -134,6 +134,9 @@ type=side by side
>   inverted=0
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [/STREAM]
>   [STREAM]
> @@ -151,6 +154,9 @@ type=top and bottom
>   inverted=1
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [/STREAM]
>   [STREAM]
> @@ -166,6 +172,9 @@ type=interleaved lines
>   inverted=1
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [/STREAM]
>   [STREAM]
> @@ -182,6 +191,9 @@ type=interleaved columns
>   inverted=1
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [/STREAM]
>   [STREAM]
> diff --git a/tests/ref/fate/matroska-vp8-alpha-remux b/tests/ref/fate/matroska-vp8-alpha-remux
> index e54304cafd..ea8a089cec 100644
> --- a/tests/ref/fate/matroska-vp8-alpha-remux
> +++ b/tests/ref/fate/matroska-vp8-alpha-remux
> @@ -37,5 +37,8 @@ type=2D
>   inverted=0
>   view=packed
>   primary_eye=none
> +baseline=0
> +horizontal_disparity_adjustment=0/0
> +horizontal_field_of_view=0
>   [/SIDE_DATA]
>   [/STREAM]

Will apply soon if nobody objects.
_______________________________________________
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] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffprobe: always print all Stereo3D fields
  2024-06-18 19:03 [FFmpeg-devel] [PATCH] ffprobe: always print all Stereo3D fields James Almer
  2024-06-20 15:54 ` James Almer
@ 2024-06-25  9:17 ` Anton Khirnov
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Khirnov @ 2024-06-25  9:17 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Quoting James Almer (2024-06-18 21:03:12)
> ffprobe is meant to generate parseable output, and if a field is present, it
> should be printed even if it has a default value.

This approach implies that adding new fields will change existing
output, possibly just by updating the libraries without any changes in
ffprobe itself. I was recently bitten by it when adding a new
disposition, which suddenly breaks a number of completely unrelated FATE
tests.

I don't have strong opinions on how ffprobe Should Work(tm), but this
result seems annoying in practice at least.

-- 
Anton Khirnov
_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2024-06-25  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18 19:03 [FFmpeg-devel] [PATCH] ffprobe: always print all Stereo3D fields James Almer
2024-06-20 15:54 ` James Almer
2024-06-25  9:17 ` Anton Khirnov

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