Re: [FFmpeg-devel] [PATCH 1/2] lavfi/ebur128: add support for smaller video sizes

2014-11-26 Thread Clément Bœsch
On Sat, Nov 22, 2014 at 03:28:06PM +0100, Marton Balint wrote:
> 
> 
> On Fri, 21 Nov 2014, Clément Bœsch wrote:
> 
> >(sorry for the delay)
> >
> >On Sun, Nov 16, 2014 at 10:53:15PM +0100, Marton Balint wrote:
> >>Signed-off-by: Marton Balint 
> >>---
> >> doc/filters.texi|  4 ++--
> >> libavfilter/f_ebur128.c | 11 ---
> >> 2 files changed, 10 insertions(+), 5 deletions(-)
> >>
> >>diff --git a/doc/filters.texi b/doc/filters.texi
> >>index 53f4cb2..713989c 100644
> >>--- a/doc/filters.texi
> >>+++ b/doc/filters.texi
> >>@@ -10146,8 +10146,8 @@ activated. Default is @code{0}.
> >>
> >> @item size
> >> Set the video size. This option is for video only. For the syntax of this
> >>-option, check the "Video size" section in the ffmpeg-utils manual. Default
> >>-and minimum resolution is @code{640x480}.
> >>+option, check the "Video size" section in the ffmpeg-utils manual. The 
> >>default
> >>+resolution is @code{640x480}, the minimum is @code{480x102}.
> >>
> >
> >Quoting the EBU 3341:
> > An ‘EBU Mode’ meter shall offer two scales, for when a scale is shown,
> > selectable by the user:
> > 1. range -18.0 LU to +9.0 LU (-41.0 LUFS to -14.0 LUFS), named ‘EBU +9
> > scale’
> > 2. range -36.0 LU to +18.0 LU (-59.0 LUFS to -5.0 LUFS), named ‘EBU +18
> > scale’
> >
> >When you go down to 480x102, the printed range becomes [-16;+8] LU for +9
> >scale and [-32;+16] LU for +18 scale (see meter option). I think these
> >range boundaries should be preserved in the output.
> >
> 
> The proper range is still shown in the graph, only the legend lacks the
> value for the up and the bottom of the graph.
> 
> If you insist on showing the values for the top and the bottom of the graph,
> then in order for the lines to remain simmetrical, you will have to start
> showing rounded or non-whole values. Or if you insist on whole values, you
> may will not be able to show the lines with the same distance from each
> other.
> 
> What would be the approach you prefer in order to be able to show smaller
> graphs?

I think the boundaries are important, so what about printing a warning if
the grain of the legend can't be kept?

(note: sorry about the delay between my replies)

-- 
Clément B.


pgpltjQI0RvtQ.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] lavfi/ebur128: add support for smaller video sizes

2014-11-22 Thread Marton Balint



On Fri, 21 Nov 2014, Clément Bœsch wrote:


(sorry for the delay)

On Sun, Nov 16, 2014 at 10:53:15PM +0100, Marton Balint wrote:

Signed-off-by: Marton Balint 
---
 doc/filters.texi|  4 ++--
 libavfilter/f_ebur128.c | 11 ---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 53f4cb2..713989c 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10146,8 +10146,8 @@ activated. Default is @code{0}.

 @item size
 Set the video size. This option is for video only. For the syntax of this
-option, check the "Video size" section in the ffmpeg-utils manual. Default
-and minimum resolution is @code{640x480}.
+option, check the "Video size" section in the ffmpeg-utils manual. The default
+resolution is @code{640x480}, the minimum is @code{480x102}.



Quoting the EBU 3341:
 An ‘EBU Mode’ meter shall offer two scales, for when a scale is shown,
 selectable by the user:
 1. range -18.0 LU to +9.0 LU (-41.0 LUFS to -14.0 LUFS), named ‘EBU +9
 scale’
 2. range -36.0 LU to +18.0 LU (-59.0 LUFS to -5.0 LUFS), named ‘EBU +18
 scale’

When you go down to 480x102, the printed range becomes [-16;+8] LU for +9
scale and [-32;+16] LU for +18 scale (see meter option). I think these
range boundaries should be preserved in the output.



The proper range is still shown in the graph, only the legend lacks the 
value for the up and the bottom of the graph.


If you insist on showing the values for the top and the bottom of the 
graph, then in order for the lines to remain simmetrical, you will have to 
start showing rounded or non-whole values. Or if you insist on whole 
values, you may will not be able to show the lines with the same distance 
from each other.


What would be the approach you prefer in order to be able to show smaller 
graphs?


Thanks,
Marton___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] lavfi/ebur128: add support for smaller video sizes

2014-11-20 Thread Clément Bœsch
(sorry for the delay)

On Sun, Nov 16, 2014 at 10:53:15PM +0100, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  doc/filters.texi|  4 ++--
>  libavfilter/f_ebur128.c | 11 ---
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 53f4cb2..713989c 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -10146,8 +10146,8 @@ activated. Default is @code{0}.
>  
>  @item size
>  Set the video size. This option is for video only. For the syntax of this
> -option, check the "Video size" section in the ffmpeg-utils manual. Default
> -and minimum resolution is @code{640x480}.
> +option, check the "Video size" section in the ffmpeg-utils manual. The 
> default
> +resolution is @code{640x480}, the minimum is @code{480x102}.
>  

Quoting the EBU 3341:
  An ‘EBU Mode’ meter shall offer two scales, for when a scale is shown,
  selectable by the user:
  1. range -18.0 LU to +9.0 LU (-41.0 LUFS to -14.0 LUFS), named ‘EBU +9
  scale’
  2. range -36.0 LU to +18.0 LU (-59.0 LUFS to -5.0 LUFS), named ‘EBU +18
  scale’

When you go down to 480x102, the printed range becomes [-16;+8] LU for +9
scale and [-32;+16] LU for +18 scale (see meter option). I think these
range boundaries should be preserved in the output.

[...]

-- 
Clément B.


pgpc24UC8Z2Py.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] lavfi/ebur128: add support for smaller video sizes

2014-11-16 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 doc/filters.texi|  4 ++--
 libavfilter/f_ebur128.c | 11 ---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 53f4cb2..713989c 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10146,8 +10146,8 @@ activated. Default is @code{0}.
 
 @item size
 Set the video size. This option is for video only. For the syntax of this
-option, check the "Video size" section in the ffmpeg-utils manual. Default
-and minimum resolution is @code{640x480}.
+option, check the "Video size" section in the ffmpeg-utils manual. The default
+resolution is @code{640x480}, the minimum is @code{480x102}.
 
 @item meter
 Set the EBU scale meter. Default is @code{9}. Common values are @code{9} and
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index c18ae79..8780062 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -114,6 +114,7 @@ typedef struct {
 int scale_range;///< the range of LU values according to 
the meter
 int y_zero_lu;  ///< the y value (pixel position) for 0 LU
 int *y_line_ref;///< y reference values for drawing the LU 
lines in the graph and the gauge
+int line_step;  ///< LU steps for drawn lines
 
 /* audio */
 int nb_channels;///< number of channels in the input
@@ -257,9 +258,9 @@ static int config_video_output(AVFilterLink *outlink)
 AVFrame *outpicref;
 
 /* check if there is enough space to represent everything decently */
-if (ebur128->w < 640 || ebur128->h < 480) {
+if (ebur128->w < 480 || ebur128->h < 102) {
 av_log(ctx, AV_LOG_ERROR, "Video size %dx%d is too small, "
-   "minimum size is 640x480\n", ebur128->w, ebur128->h);
+   "minimum size is 480x102\n", ebur128->w, ebur128->h);
 return AVERROR(EINVAL);
 }
 outlink->w = ebur128->w;
@@ -285,6 +286,9 @@ static int config_video_output(AVFilterLink *outlink)
 ebur128->graph.w = ebur128->gauge.x - ebur128->graph.x - PAD;
 ebur128->graph.h = ebur128->gauge.h;
 
+/* compute line step based on graph height and needed lines */
+ebur128->line_step = (ebur128->scale_range * 8 - 1) / (ebur128->graph.h) + 
1;
+
 /* graph and gauge share the LU-to-pixel code */
 av_assert0(ebur128->graph.h == ebur128->gauge.h);
 
@@ -309,8 +313,9 @@ static int config_video_output(AVFilterLink *outlink)
 for (i = ebur128->meter; i >= -ebur128->meter * 2; i--) {
 y = lu_to_y(ebur128, i);
 x = PAD + (i < 10 && i > -10) * 8;
-ebur128->y_line_ref[y] = i;
+ebur128->y_line_ref[y] = ((i % ebur128->line_step == 0) ? i : 0);
 y -= 4; // -4 to center vertically
+if (i % ebur128->line_step == 0)
 drawtext(outpicref, x, y + ebur128->graph.y, FONT8, font_colors+3,
  "%c%d", i < 0 ? '-' : i > 0 ? '+' : ' ', FFABS(i));
 }
-- 
2.1.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel