Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Stefano Sabatini
On date Friday 2014-12-19 16:46:40 +0530, arwa arif encoded:
[...]
> From c1c3255203226663fc382a0994182df3d558afe6 Mon Sep 17 00:00:00 2001
> From: Arwa Arif 
> Date: Sun, 14 Dec 2014 12:03:31 +0530
> Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter
> 
> ---
>  LICENSE.md|1 +
>  configure |1 +
>  doc/filters.texi  |   30 +
>  libavfilter/Makefile  |1 +
>  libavfilter/allfilters.c  |1 +
>  libavfilter/libmpcodecs/vf_fspp.c |4 +-
>  libavfilter/version.h |4 +-
>  libavfilter/vf_fspp.c |  669 ++
>  libavfilter/vf_fspp.h |   96 +++
>  libavfilter/x86/Makefile  |1 +
>  libavfilter/x86/vf_fspp.c | 1405 
> +
>  11 files changed, 2209 insertions(+), 4 deletions(-)
>  create mode 100644 libavfilter/vf_fspp.c
>  create mode 100644 libavfilter/vf_fspp.h
>  create mode 100644 libavfilter/x86/vf_fspp.c
> 
> diff --git a/LICENSE.md b/LICENSE.md
> index cf9955f..188d060 100644
> --- a/LICENSE.md
> +++ b/LICENSE.md
> @@ -31,6 +31,7 @@ Specifically, the GPL parts of FFmpeg are:
>  - vf_cropdetect.c
>  - vf_decimate.c
>  - vf_delogo.c
> +- vf_fspp.c
>  - vf_geq.c
>  - vf_histeq.c
>  - vf_hqdn3d.c
> diff --git a/configure b/configure
> index e37285a..29f5534 100755
> --- a/configure
> +++ b/configure
> @@ -2575,6 +2575,7 @@ ebur128_filter_deps="gpl"
>  flite_filter_deps="libflite"
>  frei0r_filter_deps="frei0r dlopen"
>  frei0r_src_filter_deps="frei0r dlopen"
> +fspp_filter_deps="gpl"
>  geq_filter_deps="gpl"
>  histeq_filter_deps="gpl"
>  hqdn3d_filter_deps="gpl"
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 882caa0..2c84ad0 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -4997,6 +4997,35 @@ frei0r=perspective:0.2/0.2|0.8/0.2
>  For more information, see
>  @url{http://frei0r.dyne.org}
>  
> +@section fspp
> +
> +Apply fast and simple postprocessing. It is a faster version of the simple
> +postprocessing filter - @ref{spp}.
> +
> +It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
> +processing filter, one of them is performed once per block, not per pixel.
> +This allows for much better speed.

This allows for higher speed?

> +
> +The filter accepts the following options:
> +
> +@table @option
> +@item quality
> +Set quality. This option defines the number of levels for averaging. It 
> accepts
> +an integer in the range 0-5. If set to @code{0}, the filter will have no
> +effect. A value of @code{5} means the higher quality. For each increment of
> +that value the speed drops by a factor of approximately 2.  Default value is
> +@code{4}.
> +
> +@item qp
> +Force a constant quantization parameter. It accepts an integer in range 0-63.
> +If not set, the filter will use the QP from the video stream (if available).
> +
> +@item use_bframe_qp
> +Enable the use of the QP from the B-Frames if set to @code{1}. Using this
> +option may cause flicker since the B-Frames have often larger QP. Default is
> +@code{0} (not enabled).
> +@end table
> +
>  @section geq
>  
>  The filter accepts the following options:
> @@ -8292,6 +8321,7 @@ stereo3d=abl:sbsr
>  @end example
>  @end itemize
>  
> +@anchor{spp}
>  @section spp
>  
>  Apply a simple postprocessing filter that compresses and decompresses the 
> image
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 6b7291e..8c523b4 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -125,6 +125,7 @@ OBJS-$(CONFIG_FRAMESTEP_FILTER)  += 
> vf_framestep.o
>  OBJS-$(CONFIG_FPS_FILTER)+= vf_fps.o
>  OBJS-$(CONFIG_FRAMEPACK_FILTER)  += vf_framepack.o
>  OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
> +OBJS-$(CONFIG_FSPP_FILTER)   += vf_fspp.o
>  OBJS-$(CONFIG_GEQ_FILTER)+= vf_geq.o
>  OBJS-$(CONFIG_GRADFUN_FILTER)+= vf_gradfun.o
>  OBJS-$(CONFIG_HALDCLUT_FILTER)   += vf_lut3d.o dualinput.o 
> framesync.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index adb86be..4a915c7 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -141,6 +141,7 @@ void avfilter_register_all(void)
>  REGISTER_FILTER(FRAMEPACK,  framepack,  vf);
>  REGISTER_FILTER(FRAMESTEP,  framestep,  vf);
>  REGISTER_FILTER(FREI0R, frei0r, vf);
> +REGISTER_FILTER(FSPP,   fspp,   vf);
>  REGISTER_FILTER(GEQ,geq,vf);
>  REGISTER_FILTER(GRADFUN,gradfun,vf);
>  REGISTER_FILTER(HALDCLUT,   haldclut,   vf);
> diff --git a/libavfilter/libmpcodecs/vf_fspp.c 
> b/libavfilter/libmpcodecs/vf_fspp.c
> index d457859..3a80dc2 100644
> --- a/libavfilter/libmpcodecs/vf_fspp.c
> +++ b/libavfilter/libmpcodecs/vf_fspp.c
> @@ 

[FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Lars Kiesow
Hi everyone,
I'm an FFmpeg user for quite a while now and though I might as well
switch to dev at some point...

Please find attached to this mail a simple audio filter which makes it
possible to extract and print volume information from audio streams. It
works more or less like the showinfo filters only that it returns the
pcm value information for each audio sample.

This output can then be used to easily plot a waveform image like this:
  http://larskiesow.de/waveform.png


Example:
./ffmpeg -nostats -i ... -filter:a aresample=100,showvolume -f null -
  [...]
  [Parsed_showvolume_1 @ 0x1bcc300] n: 0, channel: 0, volume: -239
  [Parsed_showvolume_1 @ 0x1bcc300] n: 1, channel: 0, volume: 126
  [Parsed_showvolume_1 @ 0x1bcc300] n: 2, channel: 0, volume: -74
  [Parsed_showvolume_1 @ 0x1bcc300] n: 3, channel: 0, volume: 29
  [...]

Example (Generate waveform using gnuplot):
./ffmpeg -nostats -i ... -ac 1 -filter:a aresample=100,showvolume \
  -f null - 2>&1 | grep '^\[Parsed_showvolume_1' | \
  gnuplot -p -e 'plot "-" using 9 with lines'


The code can be found at
https://github.com/lkiesow/FFmpeg/tree/libavfilter-audio-showvolume
and is also attached to this mail split into three separate patches.

The first patch contains the filter itself, the necessary changes to
allfilters.c and the build files. The second patch contains the
documentation. Finally, the third patch contains a small script added
to the tools section utilizing the showvolume filter for generating
waveform images with gnuplot.

Please let me know if you think it makes sense to add this code to
ffmpeg and/or if anything is still missing.

Regards,
Lars>From c7bd248165f1e331b3e205bff681e567d826c317 Mon Sep 17 00:00:00 2001
From: Lars Kiesow 
Date: Mon, 22 Dec 2014 00:01:46 +0100
Subject: [PATCH 1/3] Added showvolume audio filter

This commit adds the showvolume audio filter which can be used to show a
line containing volume information for each input audio sample like
this:

  [Parsed_showvolume_1 @ 0x34a5220] n: 47784, channel: 0, volume: 364

This output can for example easily be used to generate waveform plots
using gnuplot or any other kind of plotting engine.

Signed-off-by: Lars Kiesow 
---
 MAINTAINERS |  1 +
 libavfilter/Makefile|  1 +
 libavfilter/af_showvolume.c | 99 +
 libavfilter/allfilters.c|  1 +
 4 files changed, 102 insertions(+)
 create mode 100644 libavfilter/af_showvolume.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 6e46280..ce966a9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -345,6 +345,7 @@ Filters:
   af_compand.c  Paul B Mahol
   af_ladspa.c   Paul B Mahol
   af_pan.c  Nicolas George
+  af_showvolume.c   Lars Kiesow
   af_silenceremove.cPaul B Mahol
   avf_avectorscope.cPaul B Mahol
   avf_showcqt.c Muhammad Faiz
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 67a7e4b..c360181 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -81,6 +81,7 @@ OBJS-$(CONFIG_SILENCEREMOVE_FILTER)  += af_silenceremove.o
 OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o
 OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o
 OBJS-$(CONFIG_VOLUMEDETECT_FILTER)   += af_volumedetect.o
+OBJS-$(CONFIG_SHOWVOLUME_FILTER) += af_showvolume.o
 
 OBJS-$(CONFIG_AEVALSRC_FILTER)   += aeval.o
 OBJS-$(CONFIG_ANULLSRC_FILTER)   += asrc_anullsrc.o
diff --git a/libavfilter/af_showvolume.c b/libavfilter/af_showvolume.c
new file mode 100644
index 000..ef93aa5
--- /dev/null
+++ b/libavfilter/af_showvolume.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014 Lars Kiesow 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/channel_layout.h"
+#include "avfilter.h"
+#include "internal.h"
+
+static int query_formats(AVFilterContext *ctx)
+{
+static const enum AVSampleFormat sample_fmts[] = {
+AV_SAMPLE_FMT_S16,
+AV_SAMPLE_FMT_S16P,
+AV_SAMPLE_FMT_NONE
+};
+AVFilterFormats *formats;
+
+if (!(formats = ff_make_format_list(sample_fmts)))
+return AVERROR(ENOMEM

Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Stefano Sabatini
On date Monday 2014-12-22 13:07:03 +0100, Stefano Sabatini encoded:
> On date Friday 2014-12-19 16:46:40 +0530, arwa arif encoded:
> [...]
> > From c1c3255203226663fc382a0994182df3d558afe6 Mon Sep 17 00:00:00 2001
> > From: Arwa Arif 
> > Date: Sun, 14 Dec 2014 12:03:31 +0530
> > Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter
[...]
> > +if (fspp->log2_count && !ctx->is_disabled) {
> > +if (!fspp->use_bframe_qp && fspp->non_b_qp_table)
> > +qp_table = fspp->non_b_qp_table;
> > +
> > +if (qp_table || fspp->qp) {
> > +const int cw = FF_CEIL_RSHIFT(inlink->w, fspp->hsub);
> > +const int ch = FF_CEIL_RSHIFT(inlink->h, fspp->vsub);
> > +
> > +/* get a new frame if in-place is not possible or if the 
> > dimensions
> > + * are not multiple of 8 */
> > +if (!av_frame_is_writable(in) || (inlink->w & 7) || (inlink->h 
> > & 7)) {
> > +const int aligned_w = FFALIGN(inlink->w, 8);
> > +const int aligned_h = FFALIGN(inlink->h, 8);
> > +
> > +out = ff_get_video_buffer(outlink, aligned_w, aligned_h);
> > +if (!out) {
> > +av_frame_free(&in);
> > +return AVERROR(ENOMEM);
> > +}
> > +av_frame_copy_props(out, in);
> 
> > +out->width  = in->width;
> > +out->height = in->height;
> 
> is this required?
> 
> [...]
> 
> LGTM otherwise. I'm going to test and see if it works on this machine.
> 
> What about adding a FATE test?

Note: I had to rebase the patch because of a conflict in version.h,
please always rebase against latest master.

@all

I'm testing with:
ffmpeg -i matrixbench_mpeg2.mpg -b:v 200k matrixbench_mpeg2-lq.mpg

ffplay -f lavfi -i "nullsrc=s=720x576 [bg]; 
movie=matrixbench_mpeg2-lq.mpg:s=dv+da [v][out1]; [v]split[v1][v2]; 
[v1]crop=in_w/2:in_h:0:0 [v1pp]; [v2]crop=in_w/2:in_h:in_w/2:0,fspp [v2pp]; 
[bg][v1pp] overlay[bg+v1pp]; [bg+v1pp][v2pp] overlay=W/2 [out0]"

I'm unable to see significant differences in terms of quality between
left and right part of the output (same with mp=fspp, so it doesn't
depend on the port).

Is this expected?

What's the use case of fspp?
-- 
FFmpeg = Fanciful & Fast Martial Puristic Elaborated Game
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Michael Niedermayer
On Mon, Dec 22, 2014 at 09:51:25PM +0530, arwa arif wrote:
[...]

> +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> +{
> +AVFilterContext *ctx = inlink->dst;
> +FSPPContext *fspp = ctx->priv;
> +AVFilterLink *outlink = ctx->outputs[0];
> +AVFrame *out = in;
> +
> +int qp_stride = 0;
> +uint8_t *qp_table = NULL;
> +int i, bias;
> +int custom_threshold_m[64];
> +
> +bias = (1 << 4) + fspp->strength;
> +
> +for (i = 0; i < 64; i++) //FIXME: tune custom_threshold[] and remove 
> this !

> + custom_threshold_m[i] = (uint64_t)(custom_threshold[i] * (bias / 71) + 
> 0.5);

it needs to be 71.
which is a lazy way to write 71.0 that is a floating point value
while 71 is integer and the result of the division differs

also there are some tabs in there that should be spaces

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Reimar Döffinger
On 22.12.2014, at 17:23, Stefano Sabatini  wrote:
> On date Monday 2014-12-22 13:07:03 +0100, Stefano Sabatini encoded:
>> On date Friday 2014-12-19 16:46:40 +0530, arwa arif encoded:
>> [...]
>>> From c1c3255203226663fc382a0994182df3d558afe6 Mon Sep 17 00:00:00 2001
>>> From: Arwa Arif 
>>> Date: Sun, 14 Dec 2014 12:03:31 +0530
>>> Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter
> [...]
>>> +if (fspp->log2_count && !ctx->is_disabled) {
>>> +if (!fspp->use_bframe_qp && fspp->non_b_qp_table)
>>> +qp_table = fspp->non_b_qp_table;
>>> +
>>> +if (qp_table || fspp->qp) {
>>> +const int cw = FF_CEIL_RSHIFT(inlink->w, fspp->hsub);
>>> +const int ch = FF_CEIL_RSHIFT(inlink->h, fspp->vsub);
>>> +
>>> +/* get a new frame if in-place is not possible or if the 
>>> dimensions
>>> + * are not multiple of 8 */
>>> +if (!av_frame_is_writable(in) || (inlink->w & 7) || (inlink->h 
>>> & 7)) {
>>> +const int aligned_w = FFALIGN(inlink->w, 8);
>>> +const int aligned_h = FFALIGN(inlink->h, 8);
>>> +
>>> +out = ff_get_video_buffer(outlink, aligned_w, aligned_h);
>>> +if (!out) {
>>> +av_frame_free(&in);
>>> +return AVERROR(ENOMEM);
>>> +}
>>> +av_frame_copy_props(out, in);
>> 
>>> +out->width  = in->width;
>>> +out->height = in->height;
>> 
>> is this required?
>> 
>> [...]
>> 
>> LGTM otherwise. I'm going to test and see if it works on this machine.
>> 
>> What about adding a FATE test?
> 
> Note: I had to rebase the patch because of a conflict in version.h,
> please always rebase against latest master.
> 
> @all
> 
> I'm testing with:
> ffmpeg -i matrixbench_mpeg2.mpg -b:v 200k matrixbench_mpeg2-lq.mpg
> 
> ffplay -f lavfi -i "nullsrc=s=720x576 [bg]; 
> movie=matrixbench_mpeg2-lq.mpg:s=dv+da [v][out1]; [v]split[v1][v2]; 
> [v1]crop=in_w/2:in_h:0:0 [v1pp]; [v2]crop=in_w/2:in_h:in_w/2:0,fspp [v2pp]; 
> [bg][v1pp] overlay[bg+v1pp]; [bg+v1pp][v2pp] overlay=W/2 [out0]"
> 
> I'm unable to see significant differences in terms of quality between
> left and right part of the output (same with mp=fspp, so it doesn't
> depend on the port).
> 
> Is this expected?
> 
> What's the use case of fspp?

What codec did your lq version end up using? I suspect fspp is most tested and 
works best with MPEG-4 ASP.
It should significantly reduce blocking - obviously only if your video has 
significant blocking.
It used to work fairly well on early flv streaming videos.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Timothy Gu
On Mon Dec 22 2014 at 7:51:10 AM Lars Kiesow  wrote:

> Hi everyone,
> I'm an FFmpeg user for quite a while now and though I might as well
> switch to dev at some point...
>
> Please find attached to this mail a simple audio filter which makes it
> possible to extract and print volume information from audio streams. It
> works more or less like the showinfo filters only that it returns the
> pcm value information for each audio sample.
>
> This output can then be used to easily plot a waveform image like this:
>   http://larskiesow.de/waveform.png
>
>
> Example:
> ./ffmpeg -nostats -i ... -filter:a aresample=100,showvolume -f null -
>   [...]
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 0, channel: 0, volume: -239
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 1, channel: 0, volume: 126
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 2, channel: 0, volume: -74
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 3, channel: 0, volume: 29
>   [...]
>
> Example (Generate waveform using gnuplot):
> ./ffmpeg -nostats -i ... -ac 1 -filter:a aresample=100,showvolume \
>   -f null - 2>&1 | grep '^\[Parsed_showvolume_1' | \
>   gnuplot -p -e 'plot "-" using 9 with lines'
>
>
> The code can be found at
> https://github.com/lkiesow/FFmpeg/tree/libavfilter-audio-showvolume
> and is also attached to this mail split into three separate patches.
>
> The first patch contains the filter itself, the necessary changes to
> allfilters.c and the build files. The second patch contains the
> documentation. Finally, the third patch contains a small script added
> to the tools section utilizing the showvolume filter for generating
> waveform images with gnuplot.
>
> Please let me know if you think it makes sense to add this code to
> ffmpeg and/or if anything is still missing.
>
> Regards,
> Lars___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Timothy Gu
On Mon Dec 22 2014 at 7:51:10 AM Lars Kiesow  wrote:

> Hi everyone,
> I'm an FFmpeg user for quite a while now and though I might as well
> switch to dev at some point...
>
> Please find attached to this mail a simple audio filter which makes it
> possible to extract and print volume information from audio streams. It
> works more or less like the showinfo filters only that it returns the
> pcm value information for each audio sample.
>

https://ffmpeg.org/ffmpeg-filters.html#volumedetect ?

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


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Michael Niedermayer
On Mon, Dec 22, 2014 at 09:51:25PM +0530, arwa arif wrote:
> On Mon, Dec 22, 2014 at 5:37 PM, Stefano Sabatini 
> wrote:
[...]

> +typedef struct fsppContext {
> +uint64_t threshold_mtx_noq[8 * 2];

The first field must be a AVClass pointer like
typedef struct fsppContext {
AVClass *class;
uint64_t threshold_mtx_noq[8 * 2];

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Lars Kiesow
Hi Timothy,
volumedetect will give you statistics about the overall volume of the
audio stream like mean value, maxumim value, ... That's interesting for
tasks like audio normalization but does not help if you want to have
information about volumes at given points. For example, I don't think
you could use volumedetect for generating waveform images.
Regards,
Lars


On Mon, 22 Dec 2014 17:08:01 +
Timothy Gu  wrote:

> On Mon Dec 22 2014 at 7:51:10 AM Lars Kiesow  wrote:
> 
> > Hi everyone,
> > I'm an FFmpeg user for quite a while now and though I might as well
> > switch to dev at some point...
> >
> > Please find attached to this mail a simple audio filter which makes
> > it possible to extract and print volume information from audio
> > streams. It works more or less like the showinfo filters only that
> > it returns the pcm value information for each audio sample.
> >
> 
> https://ffmpeg.org/ffmpeg-filters.html#volumedetect ?
> 
> Timothy
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Clément Bœsch
On Mon, Dec 22, 2014 at 04:50:57PM +0100, Lars Kiesow wrote:
> Hi everyone,
> I'm an FFmpeg user for quite a while now and though I might as well
> switch to dev at some point...
> 
> Please find attached to this mail a simple audio filter which makes it
> possible to extract and print volume information from audio streams. It
> works more or less like the showinfo filters only that it returns the
> pcm value information for each audio sample.
> 
> This output can then be used to easily plot a waveform image like this:
>   http://larskiesow.de/waveform.png
> 

You might want to look at ebur128, volumedetect and showwaves filters...

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Lars Kiesow
Hi Clément,
thanks for the hints, volumedetect and showwaves are doing something
different and won't help. I sent an explanation for volumedetect already
and showwaves will convert the input audio to a video output
representing the samples waves at that point and won't allow to store
that information in any way. At least not as static image or datafile.
So it's again something different.

I need to have a look at ebur128 though. I never had a look at that
filter, but will try it later. A first glance at the docs revealed that
it might do something similar. Let me get back after some testing.
Regards,
Lars


On Mon, 22 Dec 2014 18:13:06 +0100
Clément Bœsch  wrote:

> On Mon, Dec 22, 2014 at 04:50:57PM +0100, Lars Kiesow wrote:
> > Hi everyone,
> > I'm an FFmpeg user for quite a while now and though I might as well
> > switch to dev at some point...
> > 
> > Please find attached to this mail a simple audio filter which makes
> > it possible to extract and print volume information from audio
> > streams. It works more or less like the showinfo filters only that
> > it returns the pcm value information for each audio sample.
> > 
> > This output can then be used to easily plot a waveform image like
> > this: http://larskiesow.de/waveform.png
> > 
> 
> You might want to look at ebur128, volumedetect and showwaves
> filters...
> 
> [...]
> 

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


Re: [FFmpeg-devel] [PATCH] cdxl: fix duration

2014-12-22 Thread Michael Niedermayer
On Mon, Dec 17, 2012 at 09:06:25PM +0100, Piotr Bandurski wrote:
> Hi
> 
> > Better way to set duration is via bitrate.
> > Chunk size do not need to be constant.
> > None of current demuxers sets duration using file size.
> 
> Yes but I couldn't make it to work :(

neither could i, i also dont see a bitrate field in the header
nor has anyone replied in the ticket to my question from where the
bitrate could be found

Thus applied as this seems to be the best that can be done

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/hlsenc: added HLS encryption

2014-12-22 Thread Christian Suloway
Added HLS encryption with -hls_key_info_file  option.
The first line of key_info_file specifies the key URI for the playlist.
The second line specifies the path to the file containing the encryption
key. An optional third line specifies an IV to use instead of the
segment number. Changes to key_info_file will be reflected in segment
encryption along with an entry in the playlist for the new key URI and
IV.

Signed-off-by: Christian Suloway 
---
 doc/muxers.texi  |   9 ++
 libavformat/hlsenc.c | 235 +--
 2 files changed, 238 insertions(+), 6 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index a1264d2..f2ecf8b 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -263,6 +263,15 @@ ffmpeg in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
 This example will produce the playlist, @file{out.m3u8}, and segment files:
 @file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
 
+@item hls_key_info_file @var{file}
+Use in the information in @var{file} for segment encryption. The first line of
+@var{file} specifies the key URI for the playlist. The second line specifies
+the path to the file containing the encryption key as a single packed array of
+16 octets in binary format. The optional third line specifies a hexidecimal
+string for the initialization vector (IV) to be used instead of the segment
+number. Changes to @var{file} will result in segment encryption with the new
+key/IV and an entry in the playlist for the new key URI/IV.
+
 @item hls_flags single_file
 If this flag is set, the muxer will store all segments in a single MPEG-TS
 file, and will use byte ranges in the playlist. HLS playlists generated with
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f46e8d4..1dba60c 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -37,12 +37,18 @@
 #include "internal.h"
 #include "os_support.h"
 
+#define BLOCKSIZE 16
+
 typedef struct HLSSegment {
 char filename[1024];
 double duration; /* in seconds */
 int64_t pos;
 int64_t size;
 
+char *key_uri;
+char *iv_string;
+int attribute_iv;
+
 struct HLSSegment *next;
 } HLSSegment;
 
@@ -86,9 +92,23 @@ typedef struct HLSContext {
 char *format_options_str;
 AVDictionary *format_options;
 
+char *key_info_file;
+char *key_file;
+char *key_uri;
+char *key_string;
+char *iv_string;
+int attribute_iv;
+
 AVIOContext *pb;
 } HLSContext;
 
+static void hls_free_segment(HLSSegment *en)
+{
+   av_freep(&en->key_uri);
+   av_freep(&en->iv_string);
+   av_freep(&en);
+}
+
 static int hls_delete_old_segments(HLSContext *hls) {
 
 HLSSegment *segment, *previous_segment = NULL;
@@ -145,7 +165,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
 av_free(path);
 previous_segment = segment;
 segment = previous_segment->next;
-av_free(previous_segment);
+hls_free_segment(previous_segment);
 }
 
 fail:
@@ -154,6 +174,134 @@ fail:
 return ret;
 }
 
+static int hls_encryption_start(HLSContext *hls)
+{
+
+int ret = 0, i;
+AVIOContext *pb = NULL, *dyn_buf = NULL;
+uint8_t buf[1024], *tmp = NULL, *key = NULL, *iv = NULL;
+char *p, *tstr, *saveptr = NULL, *key_string = NULL, *iv_string = NULL;
+
+if ((ret = avio_open(&pb, hls->key_info_file, AVIO_FLAG_READ)) < 0) {
+av_log(hls, AV_LOG_ERROR, "error opening key info file %s\n",
+  hls->key_info_file);
+goto fail;
+}
+
+ret = avio_open_dyn_buf(&dyn_buf);
+if (ret < 0) {
+avio_closep(&pb);
+goto fail;
+}
+
+while ((ret = avio_read(pb, buf, sizeof(buf))) > 0)
+avio_write(dyn_buf, buf, ret);
+avio_closep(&pb);
+if (ret != AVERROR_EOF && ret < 0) {
+avio_close_dyn_buf(dyn_buf, &tmp);
+goto fail;
+}
+
+avio_w8(dyn_buf, 0);
+if ((ret = avio_close_dyn_buf(dyn_buf, &tmp)) < 0)
+goto fail;
+
+p = tmp;
+if (!(tstr = av_strtok(p, "\n", &saveptr)) || !*tstr) {
+av_log(hls, AV_LOG_ERROR, "no key URI specified in key info file %s\n",
+  hls->key_info_file);
+ret = AVERROR(EINVAL);
+goto fail;
+}
+av_free(hls->key_uri);
+hls->key_uri = av_strdup(tstr);
+if (!hls->key_uri) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+
+if (!(tstr = av_strtok(NULL, "\n", &saveptr)) || !*tstr) {
+av_log(hls, AV_LOG_ERROR, "no key file specified in key info file 
%s\n",
+  hls->key_info_file);
+ret = AVERROR(EINVAL);
+goto fail;
+}
+av_free(hls->key_file);
+hls->key_file = av_strdup(tstr);
+if (!hls->key_file) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+
+if (tstr = av_strtok(NULL, "\n", &saveptr)) {
+if (ff_hex_to_data(NULL, tstr) != BLOCKSIZE) {
+av_log(hls, AV_LOG_ERROR, "invalid length fo

Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread wm4
On Mon, 22 Dec 2014 16:50:57 +0100
Lars Kiesow  wrote:

> Hi everyone,
> I'm an FFmpeg user for quite a while now and though I might as well
> switch to dev at some point...
> 
> Please find attached to this mail a simple audio filter which makes it
> possible to extract and print volume information from audio streams. It
> works more or less like the showinfo filters only that it returns the
> pcm value information for each audio sample.
> 
> This output can then be used to easily plot a waveform image like this:
>   http://larskiesow.de/waveform.png
> 
> 
> Example:
> ./ffmpeg -nostats -i ... -filter:a aresample=100,showvolume -f null -
>   [...]
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 0, channel: 0, volume: -239
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 1, channel: 0, volume: 126
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 2, channel: 0, volume: -74
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 3, channel: 0, volume: 29
>   [...]
> 
> Example (Generate waveform using gnuplot):
> ./ffmpeg -nostats -i ... -ac 1 -filter:a aresample=100,showvolume \
>   -f null - 2>&1 | grep '^\[Parsed_showvolume_1' | \
>   gnuplot -p -e 'plot "-" using 9 with lines'
> 
> 
> The code can be found at
> https://github.com/lkiesow/FFmpeg/tree/libavfilter-audio-showvolume
> and is also attached to this mail split into three separate patches.
> 
> The first patch contains the filter itself, the necessary changes to
> allfilters.c and the build files. The second patch contains the
> documentation. Finally, the third patch contains a small script added
> to the tools section utilizing the showvolume filter for generating
> waveform images with gnuplot.
> 
> Please let me know if you think it makes sense to add this code to
> ffmpeg and/or if anything is still missing.
> 
> Regards,
> Lars

So it just dumps each sample to the terminal?

Wouldn't it be better to let gnu plot or whatever directly read data
from a raw file (which the raw encoder/muxer could produce)?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Wanted: Consultant/Developer for Real-time Video Streaming, Broadcast Sports Television

2014-12-22 Thread Fuad Khan
I am looking for some help with a minimum latency HD video streaming project.  
Our application is the FingerWorks Telestrator  which 
is currently in wide use by major television networks, predominantly in North 
America  (e.g. NBC, FOW, TSN, Sportsnet) but also world-wide.

We currently ingest real-time HD video via SDI cards from BlackMagic Design and 
AJA.  Our application renders 3D graphics using the Unity 3D engine and native 
plugins and sends out annotations, either as video or to be rendered by a 
central hub with video output capabilities.  We do no currently support network 
video in because of issues with latency.  However, I believe we are at a good 
point to do this and I am looking to build in that capability in the first 
quarter of 2015 (i.e. ASAP).  This will allow us to have commentators 
collaborating from thin clients on Surface 3 Pros. We use Unity with native 
C++, C# and our Telestrator runs in Windows.  No Unity development experience 
is required.

We are open to licensing current tools, if available, or paying development 
costs for customization or (if need be) development of a API to get us where we 
need to be.  Our requirements are for smooth HD video (720p and 1080i) over 
ethernet.

You would work directly with me and my team, based in Vancouver Canada.  This 
would be a contract project and working from anywhere is absolutely fine.

Cheers,
Fuad.

Fuad Khan
FingerWorks Telestrators
Office  +1-604-628-1791
Mobile +1-604-346-8511

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


[FFmpeg-devel] Parallelization of FFmpeg

2014-12-22 Thread Dtison.net

Hello

Would there be any interest in additional work on parallelization of the 
library?


It is mentioned the Changelog and in multithreading.txt.




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


Re: [FFmpeg-devel] Parallelization of FFmpeg

2014-12-22 Thread Kieran Kunhya
On 22 December 2014 at 01:43, Dtison.net  wrote:
> Hello
>
> Would there be any interest in additional work on parallelization of the
> library?
>
> It is mentioned the Changelog and in multithreading.txt.

What part of FFmpeg are you interested in Parallelising?

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


[FFmpeg-devel] Frame threaded encoders

2014-12-22 Thread Kieran Kunhya
Hi,

Does the CODEC_CAP_FRAME_THREADS API support frame threaded encoding?

Regards,

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


Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: added HLS encryption

2014-12-22 Thread Michael Niedermayer
On Mon, Dec 22, 2014 at 01:54:17PM -0600, Christian Suloway wrote:
> Added HLS encryption with -hls_key_info_file  option.
> The first line of key_info_file specifies the key URI for the playlist.
> The second line specifies the path to the file containing the encryption
> key. An optional third line specifies an IV to use instead of the
> segment number. Changes to key_info_file will be reflected in segment
> encryption along with an entry in the playlist for the new key URI and
> IV.
> 
> Signed-off-by: Christian Suloway 
> ---
>  doc/muxers.texi  |   9 ++
>  libavformat/hlsenc.c | 235 
> +--
>  2 files changed, 238 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/muxers.texi b/doc/muxers.texi
> index a1264d2..f2ecf8b 100644
> --- a/doc/muxers.texi
> +++ b/doc/muxers.texi
> @@ -263,6 +263,15 @@ ffmpeg in.nut -hls_segment_filename 'file%03d.ts' 
> out.m3u8
>  This example will produce the playlist, @file{out.m3u8}, and segment files:
>  @file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
>  
> +@item hls_key_info_file @var{file}
> +Use in the information in @var{file} for segment encryption. The first line 
> of
> +@var{file} specifies the key URI for the playlist. The second line specifies
> +the path to the file containing the encryption key as a single packed array 
> of
> +16 octets in binary format. The optional third line specifies a hexidecimal
> +string for the initialization vector (IV) to be used instead of the segment
> +number. Changes to @var{file} will result in segment encryption with the new
> +key/IV and an entry in the playlist for the new key URI/IV.
> +
>  @item hls_flags single_file
>  If this flag is set, the muxer will store all segments in a single MPEG-TS
>  file, and will use byte ranges in the playlist. HLS playlists generated with
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index f46e8d4..1dba60c 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -37,12 +37,18 @@
>  #include "internal.h"
>  #include "os_support.h"
>  
> +#define BLOCKSIZE 16
> +
>  typedef struct HLSSegment {
>  char filename[1024];
>  double duration; /* in seconds */
>  int64_t pos;
>  int64_t size;
>  
> +char *key_uri;
> +char *iv_string;
> +int attribute_iv;
> +
>  struct HLSSegment *next;
>  } HLSSegment;
>  
> @@ -86,9 +92,23 @@ typedef struct HLSContext {
>  char *format_options_str;
>  AVDictionary *format_options;
>  
> +char *key_info_file;
> +char *key_file;
> +char *key_uri;
> +char *key_string;
> +char *iv_string;
> +int attribute_iv;
> +
>  AVIOContext *pb;
>  } HLSContext;
>  
> +static void hls_free_segment(HLSSegment *en)
> +{
> +   av_freep(&en->key_uri);
> +   av_freep(&en->iv_string);
> +   av_freep(&en);
> +}
> +
>  static int hls_delete_old_segments(HLSContext *hls) {
>  
>  HLSSegment *segment, *previous_segment = NULL;
> @@ -145,7 +165,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
>  av_free(path);
>  previous_segment = segment;
>  segment = previous_segment->next;
> -av_free(previous_segment);
> +hls_free_segment(previous_segment);
>  }
>  
>  fail:

> @@ -154,6 +174,134 @@ fail:
>  return ret;
>  }
>  
> +static int hls_encryption_start(HLSContext *hls)
> +{
> +
> +int ret = 0, i;
> +AVIOContext *pb = NULL, *dyn_buf = NULL;
> +uint8_t buf[1024], *tmp = NULL, *key = NULL, *iv = NULL;
> +char *p, *tstr, *saveptr = NULL, *key_string = NULL, *iv_string = NULL;
> +
> +if ((ret = avio_open(&pb, hls->key_info_file, AVIO_FLAG_READ)) < 0) {
> +av_log(hls, AV_LOG_ERROR, "error opening key info file %s\n",
> +  hls->key_info_file);
> +goto fail;
> +}
> +
> +ret = avio_open_dyn_buf(&dyn_buf);
> +if (ret < 0) {
> +avio_closep(&pb);
> +goto fail;
> +}
> +
> +while ((ret = avio_read(pb, buf, sizeof(buf))) > 0)
> +avio_write(dyn_buf, buf, ret);
> +avio_closep(&pb);
> +if (ret != AVERROR_EOF && ret < 0) {
> +avio_close_dyn_buf(dyn_buf, &tmp);
> +goto fail;
> +}
> +
> +avio_w8(dyn_buf, 0);
> +if ((ret = avio_close_dyn_buf(dyn_buf, &tmp)) < 0)
> +goto fail;
> +
> +p = tmp;
> +if (!(tstr = av_strtok(p, "\n", &saveptr)) || !*tstr) {
> +av_log(hls, AV_LOG_ERROR, "no key URI specified in key info file 
> %s\n",
> +  hls->key_info_file);
> +ret = AVERROR(EINVAL);
> +goto fail;
> +}

this looks a bit odd,
see ff_get_line(), it probably allows to simplify this alot

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


signature.asc
Description: Digital signature
___

[FFmpeg-devel] [PATCH] avcodec/frame_thread_encoder: remove buffer_mutex

2014-12-22 Thread Michael Niedermayer
It was used for protecting calls to get/release_buffer()
there are no such calls anymore

Signed-off-by: Michael Niedermayer 
---
 libavcodec/frame_thread_encoder.c |7 ---
 1 file changed, 7 deletions(-)

diff --git a/libavcodec/frame_thread_encoder.c 
b/libavcodec/frame_thread_encoder.c
index 9a49fea..e10845e 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -47,7 +47,6 @@ typedef struct{
 
 typedef struct{
 AVCodecContext *parent_avctx;
-pthread_mutex_t buffer_mutex;
 
 AVFifoBuffer *task_fifo;
 pthread_mutex_t task_fifo_mutex;
@@ -91,9 +90,7 @@ static void * attribute_align_arg worker(void *v){
 frame = task.indata;
 
 ret = avcodec_encode_video2(avctx, pkt, frame, &got_packet);
-pthread_mutex_lock(&c->buffer_mutex);
 av_frame_unref(frame);
-pthread_mutex_unlock(&c->buffer_mutex);
 av_frame_free(&frame);
 if(got_packet) {
 av_dup_packet(pkt);
@@ -109,9 +106,7 @@ static void * attribute_align_arg worker(void *v){
 }
 end:
 av_free(pkt);
-pthread_mutex_lock(&c->buffer_mutex);
 avcodec_close(avctx);
-pthread_mutex_unlock(&c->buffer_mutex);
 av_freep(&avctx);
 return NULL;
 }
@@ -182,7 +177,6 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, 
AVDictionary *options){
 
 pthread_mutex_init(&c->task_fifo_mutex, NULL);
 pthread_mutex_init(&c->finished_task_mutex, NULL);
-pthread_mutex_init(&c->buffer_mutex, NULL);
 pthread_cond_init(&c->task_fifo_cond, NULL);
 pthread_cond_init(&c->finished_task_cond, NULL);
 
@@ -239,7 +233,6 @@ void ff_frame_thread_encoder_free(AVCodecContext *avctx){
 
 pthread_mutex_destroy(&c->task_fifo_mutex);
 pthread_mutex_destroy(&c->finished_task_mutex);
-pthread_mutex_destroy(&c->buffer_mutex);
 pthread_cond_destroy(&c->task_fifo_cond);
 pthread_cond_destroy(&c->finished_task_cond);
 av_fifo_freep(&c->task_fifo);
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] tests/regression-funcs: Remove hardcoded therads 1

2014-12-22 Thread Michael Niedermayer
The tests which use encoders which either use slices or store the encoder 
thread count
keep a hardcoded value of 1

Found-by: ubitux
Signed-off-by: Michael Niedermayer 
---
 tests/lavf-regression.sh  |   28 ++--
 tests/regression-funcs.sh |2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index 7e6ad06..947e0f9 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -64,7 +64,7 @@ do_audio_only()
 }
 
 if [ -n "$do_avi" ] ; then
-do_lavf avi "" "-acodec mp2 -ar 44100 -ab 64k"
+do_lavf avi "" "-acodec mp2 -ar 44100 -ab 64k -threads 1"
 fi
 
 if [ -n "$do_asf" ] ; then
@@ -79,11 +79,11 @@ do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i 
$raw_src $DEC_OPTS -ar 441
 fi
 
 if [ -n "$do_mpg" ] ; then
-do_lavf_timecode mpg "-ab 64k -ar 44100"
+do_lavf_timecode mpg "-ab 64k -ar 44100 -threads 1"
 fi
 
 if [ -n "$do_mxf" ] ; then
-do_lavf_timecode mxf "-ar 48000 -bf 2"
+do_lavf_timecode mxf "-ar 48000 -bf 2 -threads 1"
 fi
 
 if [ -n "$do_mxf_d10" ]; then
@@ -91,7 +91,7 @@ do_lavf mxf_d10 "-ar 48000 -ac 2" "-r 25 -vf 
scale=720:576,pad=720:608:0:32 -vco
 fi
 
 if [ -n "$do_ts" ] ; then
-do_lavf ts "" "-ab 64k -mpegts_transport_stream_id 42 -ar 44100"
+do_lavf ts "" "-ab 64k -mpegts_transport_stream_id 42 -ar 44100 -threads 1"
 fi
 
 if [ -n "$do_swf" ] ; then
@@ -99,7 +99,7 @@ do_lavf swf "" "-an"
 fi
 
 if [ -n "$do_ffm" ] ; then
-do_lavf ffm "" "-ar 44100"
+do_lavf ffm "" "-ar 44100 -threads 1"
 fi
 
 if [ -n "$do_flm" ] ; then
@@ -111,13 +111,13 @@ do_lavf flv "" "-an"
 fi
 
 if [ -n "$do_mov" ] ; then
-mov_common_opt="-acodec pcm_alaw -vcodec mpeg4"
+mov_common_opt="-acodec pcm_alaw -vcodec mpeg4 -threads 1"
 do_lavf mov "" "-movflags +rtphint $mov_common_opt"
 do_lavf_timecode mov "-movflags +faststart $mov_common_opt"
 fi
 
 if [ -n "$do_ismv" ] ; then
-do_lavf_timecode ismv "-an -vcodec mpeg4"
+do_lavf_timecode ismv "-an -vcodec mpeg4 -threads 1"
 fi
 
 if [ -n "$do_dv_fmt" ] ; then
@@ -127,19 +127,19 @@ do_lavf dv "-ar 48000 -channel_layout stereo" "-r 25 -s 
pal"
 fi
 
 if [ -n "$do_gxf" ] ; then
-do_lavf_timecode_nodrop gxf "-ar 48000 -r 25 -s pal -ac 1"
-do_lavf_timecode_drop   gxf "-ar 48000 -s ntsc -ac 1"
-do_lavf gxf "-ar 48000" "-r 25 -s pal -ac 1"
+do_lavf_timecode_nodrop gxf "-ar 48000 -r 25 -s pal -ac 1 -threads 1"
+do_lavf_timecode_drop   gxf "-ar 48000 -s ntsc -ac 1 -threads 1"
+do_lavf gxf "-ar 48000" "-r 25 -s pal -ac 1 -threads 1"
 fi
 
 if [ -n "$do_nut" ] ; then
-do_lavf nut "" "-acodec mp2 -ab 64k -ar 44100"
+do_lavf nut "" "-acodec mp2 -ab 64k -ar 44100 -threads 1"
 fi
 
 if [ -n "$do_mkv" ] ; then
 do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 \
- -attach ${raw_src%/*}/00.pgm -metadata:s:t mimetype=image/x-portable-greymap"
-do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 -ar 44100"
+ -attach ${raw_src%/*}/00.pgm -metadata:s:t mimetype=image/x-portable-greymap 
-threads 1"
+do_lavf mkv "" "-acodec mp2 -ab 64k -vcodec mpeg4 -ar 44100 -threads 1"
 fi
 
 if [ -n "$do_mp3" ] ; then
@@ -157,7 +157,7 @@ do_lavf_fate ogg "vp3/coeff_level64.mkv"
 fi
 
 if [ -n "$do_wtv" ] ; then
-do_lavf wtv "" "-acodec mp2"
+do_lavf wtv "" "-acodec mp2 -threads 1"
 fi
 
 
diff --git a/tests/regression-funcs.sh b/tests/regression-funcs.sh
index 86bc446..c8e7c1b 100755
--- a/tests/regression-funcs.sh
+++ b/tests/regression-funcs.sh
@@ -46,7 +46,7 @@ echov(){
 AVCONV_OPTS="-nostats -y -cpuflags $cpuflags"
 COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact 
-fflags +bitexact"
 DEC_OPTS="$COMMON_OPTS -threads $threads"
-ENC_OPTS="$COMMON_OPTS -threads 1 -dct fastint"
+ENC_OPTS="$COMMON_OPTS -threads $threads -dct fastint"
 
 run_avconv()
 {
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] tools/probetest: support testing a single specified input format

2014-12-22 Thread Michael Niedermayer
On Mon, Dec 22, 2014 at 12:45:43AM +0100, Michael Niedermayer wrote:
> This reduces the time the test takes significantly when only one
> formats needs to be tested
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/probetest.c |   37 +++--
>  1 file changed, 31 insertions(+), 6 deletions(-)

applied

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread arwa arif
On Mon, Dec 22, 2014 at 10:27 PM, Michael Niedermayer 
wrote:

> On Mon, Dec 22, 2014 at 09:51:25PM +0530, arwa arif wrote:
> [...]
>
> > +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> > +{
> > +AVFilterContext *ctx = inlink->dst;
> > +FSPPContext *fspp = ctx->priv;
> > +AVFilterLink *outlink = ctx->outputs[0];
> > +AVFrame *out = in;
> > +
> > +int qp_stride = 0;
> > +uint8_t *qp_table = NULL;
> > +int i, bias;
> > +int custom_threshold_m[64];
> > +
> > +bias = (1 << 4) + fspp->strength;
> > +
> > +for (i = 0; i < 64; i++) //FIXME: tune custom_threshold[] and
> remove this !
>
> > + custom_threshold_m[i] = (uint64_t)(custom_threshold[i] * (bias /
> 71) + 0.5);
>
> it needs to be 71.
> which is a lazy way to write 71.0 that is a floating point value
> while 71 is integer and the result of the division differs
>

When using 71. , there is a segfault. I tried using float bias instead of
int bias also, but it still gives segfault.
How do I resolve it?


>
> also there are some tabs in there that should be spaces


> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>

Updated the patch.
From 8196a4153284f2d9ac1ab7cbf098fb3bb7028d2e Mon Sep 17 00:00:00 2001
From: Arwa Arif 
Date: Sun, 14 Dec 2014 12:03:31 +0530
Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter

---
 LICENSE.md|1 +
 configure |1 +
 doc/filters.texi  |   33 +
 libavfilter/Makefile  |1 +
 libavfilter/allfilters.c  |1 +
 libavfilter/libmpcodecs/vf_fspp.c |4 +-
 libavfilter/version.h |4 +-
 libavfilter/vf_fspp.c |  699 ++
 libavfilter/vf_fspp.h |   97 +++
 libavfilter/x86/Makefile  |1 +
 libavfilter/x86/vf_fspp.c | 1405 +
 11 files changed, 2243 insertions(+), 4 deletions(-)
 create mode 100644 libavfilter/vf_fspp.c
 create mode 100644 libavfilter/vf_fspp.h
 create mode 100644 libavfilter/x86/vf_fspp.c

diff --git a/LICENSE.md b/LICENSE.md
index cf9955f..188d060 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -31,6 +31,7 @@ Specifically, the GPL parts of FFmpeg are:
 - vf_cropdetect.c
 - vf_decimate.c
 - vf_delogo.c
+- vf_fspp.c
 - vf_geq.c
 - vf_histeq.c
 - vf_hqdn3d.c
diff --git a/configure b/configure
index e37285a..29f5534 100755
--- a/configure
+++ b/configure
@@ -2575,6 +2575,7 @@ ebur128_filter_deps="gpl"
 flite_filter_deps="libflite"
 frei0r_filter_deps="frei0r dlopen"
 frei0r_src_filter_deps="frei0r dlopen"
+fspp_filter_deps="gpl"
 geq_filter_deps="gpl"
 histeq_filter_deps="gpl"
 hqdn3d_filter_deps="gpl"
diff --git a/doc/filters.texi b/doc/filters.texi
index 882caa0..d23575e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4997,6 +4997,38 @@ frei0r=perspective:0.2/0.2|0.8/0.2
 For more information, see
 @url{http://frei0r.dyne.org}
 
+@section fspp
+
+Apply fast and simple postprocessing. It is a faster version of the simple
+postprocessing filter - @ref{spp}.
+
+It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
+processing filter, one of them is performed once per block, not per pixel.
+This allows for much better speed.
+
+The filter accepts the following options:
+
+@table @option
+@item quality
+Set quality. This option defines the number of levels for averaging. It accepts
+an integer in the range 4-5. Default value is @code{4}.
+
+@item qp
+Force a constant quantization parameter. It accepts an integer in range 0-63.
+If not set, the filter will use the QP from the video stream (if available).
+
+@item strength
+Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
+more details but also more artifacts, while higher values make the image smoother
+but also blurrier. Default value is @code{0} − PSNR optimal.
+
+@item use_bframe_qp
+Enable the use of the QP from the B-Frames if set to @code{1}. Using this
+option may cause flicker since the B-Frames have often larger QP. Default is
+@code{0} (not enabled).
+
+@end table
+
 @section geq
 
 The filter accepts the following options:
@@ -8292,6 +8324,7 @@ stereo3d=abl:sbsr
 @end example
 @end itemize
 
+@anchor{spp}
 @section spp
 
 Apply a simple postprocessing filter that compresses and decompresses the image
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6b7291e..8c523b4 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -125,6 +125,7 @@ OBJS-$(CONFIG_FRAMESTEP_FILTER)  += vf_framestep.o
 OBJS-$(CONFIG_FPS_FILTER)+= vf_fps.o
 OBJS-$(CONFIG_FRAMEPACK_FILTER)  += vf_framepack.o
 O

[FFmpeg-devel] LibRaw inclusion request

2014-12-22 Thread Dev Guy

LibRaw is a library for reading RAW files obtained from digital photo cameras 
(CRW/CR2, NEF, RAF, DNG, and others)

libraw inclusion in ffmpeg would allow time laps video to be made directly from 
the RAW output of  the following cameras and also from cameras that produce RAW 
video frames:

http://www.libraw.org

LibRaw 0.16-Release changes (since 0.15.x):
Support for new cameras:
Baumer TXG14
Blackmagic Cinema
Canon EOS 70D, C500, S120, G16
Fujifilm X-M1, X-A1, XE2, XQ1
Hasselblad Lunar, Stellar
Leica C, X VARIO
Nikon D5200, P7800, D5300, D610, Df, 1 AW1
Nokia Lumia 1020, 1520
Olympus E-P5,E-M1, STYLUS1
OmniVision OV5647 (Raspberry Pi)
Panasonic LF1, GX7, GF6, GM1
Pentax K-50, K-500, Q7,K-3
Richon GR
Samsung NX300, NX1100, NX2000, Galaxy NX (EK-GN120)


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


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Stefano Sabatini
On date Monday 2014-12-22 21:51:25 +0530, arwa arif encoded:
> On Mon, Dec 22, 2014 at 5:37 PM, Stefano Sabatini 
> wrote:
> 
> > On date Friday 2014-12-19 16:46:40 +0530, arwa arif encoded:
> > [...]
> > > From c1c3255203226663fc382a0994182df3d558afe6 Mon Sep 17 00:00:00 2001
> > > From: Arwa Arif 
> > > Date: Sun, 14 Dec 2014 12:03:31 +0530
> > > Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter
> > >
> > > ---
> > >  LICENSE.md|1 +
> > >  configure |1 +
> > >  doc/filters.texi  |   30 +
> > >  libavfilter/Makefile  |1 +
> > >  libavfilter/allfilters.c  |1 +
> > >  libavfilter/libmpcodecs/vf_fspp.c |4 +-
> > >  libavfilter/version.h |4 +-
> > >  libavfilter/vf_fspp.c |  669 ++
> > >  libavfilter/vf_fspp.h |   96 +++
> > >  libavfilter/x86/Makefile  |1 +
> > >  libavfilter/x86/vf_fspp.c | 1405
> > +
> > >  11 files changed, 2209 insertions(+), 4 deletions(-)
> > >  create mode 100644 libavfilter/vf_fspp.c
> > >  create mode 100644 libavfilter/vf_fspp.h
> > >  create mode 100644 libavfilter/x86/vf_fspp.c
> > >
> > > diff --git a/LICENSE.md b/LICENSE.md
> > > index cf9955f..188d060 100644
> > > --- a/LICENSE.md
> > > +++ b/LICENSE.md
> > > @@ -31,6 +31,7 @@ Specifically, the GPL parts of FFmpeg are:
> > >  - vf_cropdetect.c
> > >  - vf_decimate.c
> > >  - vf_delogo.c
> > > +- vf_fspp.c
> > >  - vf_geq.c
> > >  - vf_histeq.c
> > >  - vf_hqdn3d.c
> > > diff --git a/configure b/configure
> > > index e37285a..29f5534 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -2575,6 +2575,7 @@ ebur128_filter_deps="gpl"
> > >  flite_filter_deps="libflite"
> > >  frei0r_filter_deps="frei0r dlopen"
> > >  frei0r_src_filter_deps="frei0r dlopen"
> > > +fspp_filter_deps="gpl"
> > >  geq_filter_deps="gpl"
> > >  histeq_filter_deps="gpl"
> > >  hqdn3d_filter_deps="gpl"
> > > diff --git a/doc/filters.texi b/doc/filters.texi
> > > index 882caa0..2c84ad0 100644
> > > --- a/doc/filters.texi
> > > +++ b/doc/filters.texi
> > > @@ -4997,6 +4997,35 @@ frei0r=perspective:0.2/0.2|0.8/0.2
> > >  For more information, see
> > >  @url{http://frei0r.dyne.org}
> > >
> > > +@section fspp
> > > +
> > > +Apply fast and simple postprocessing. It is a faster version of the
> > simple
> > > +postprocessing filter - @ref{spp}.
> > > +
> > > +It splits (I)DCT into horizontal/vertical passes. Unlike the simple
> > post-
> > > +processing filter, one of them is performed once per block, not per
> > pixel.
> > > +This allows for much better speed.
> >
> > This allows for higher speed?
> >
> >
> Yes, it does.

I meant that "higher speed" reads more semantically correct than
"better speed".

[...] 
> I have added one more option of filter strength. I compared the ouput of
> this filter with mp=fspp, for different values of qp, and the ouput is not
> same. I have been looking into the code, but I am not able to figure out
> the mistake.

> From d4be07bb81f3d7ef03f65eaf3403da0bbe0b5391 Mon Sep 17 00:00:00 2001
> From: Arwa Arif 
> Date: Sun, 14 Dec 2014 12:03:31 +0530
> Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter
> 
> ---
>  LICENSE.md|1 +
>  configure |1 +
>  doc/filters.texi  |   33 +
>  libavfilter/Makefile  |1 +
>  libavfilter/allfilters.c  |1 +
>  libavfilter/libmpcodecs/vf_fspp.c |4 +-
>  libavfilter/version.h |4 +-
>  libavfilter/vf_fspp.c |  699 ++
>  libavfilter/vf_fspp.h |   96 +++
>  libavfilter/x86/Makefile  |1 +
>  libavfilter/x86/vf_fspp.c | 1405 
> +
>  11 files changed, 2242 insertions(+), 4 deletions(-)
>  create mode 100644 libavfilter/vf_fspp.c
>  create mode 100644 libavfilter/vf_fspp.h
>  create mode 100644 libavfilter/x86/vf_fspp.c
> 
> diff --git a/LICENSE.md b/LICENSE.md
> index cf9955f..188d060 100644
> --- a/LICENSE.md
> +++ b/LICENSE.md
> @@ -31,6 +31,7 @@ Specifically, the GPL parts of FFmpeg are:
>  - vf_cropdetect.c
>  - vf_decimate.c
>  - vf_delogo.c
> +- vf_fspp.c
>  - vf_geq.c
>  - vf_histeq.c
>  - vf_hqdn3d.c
> diff --git a/configure b/configure
> index e37285a..29f5534 100755
> --- a/configure
> +++ b/configure
> @@ -2575,6 +2575,7 @@ ebur128_filter_deps="gpl"
>  flite_filter_deps="libflite"
>  frei0r_filter_deps="frei0r dlopen"
>  frei0r_src_filter_deps="frei0r dlopen"
> +fspp_filter_deps="gpl"
>  geq_filter_deps="gpl"
>  histeq_filter_deps="gpl"
>  hqdn3d_filter_deps="gpl"
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 882caa0..d23575e 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -4997,6 +4997,38 @@ frei0r=perspective:0.2/0.2|0.8/0.2
>  For more information, see

Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-22 Thread Stefano Sabatini
On date Monday 2014-12-22 17:57:34 +0100, Reimar Döffinger encoded:
> On 22.12.2014, at 17:23, Stefano Sabatini  wrote:
[...]
> > I'm testing with:
> > ffmpeg -i matrixbench_mpeg2.mpg -b:v 200k matrixbench_mpeg2-lq.mpg
> > 
> > ffplay -f lavfi -i "nullsrc=s=720x576 [bg]; 
> > movie=matrixbench_mpeg2-lq.mpg:s=dv+da [v][out1]; [v]split[v1][v2]; 
> > [v1]crop=in_w/2:in_h:0:0 [v1pp]; [v2]crop=in_w/2:in_h:in_w/2:0,fspp [v2pp]; 
> > [bg][v1pp] overlay[bg+v1pp]; [bg+v1pp][v2pp] overlay=W/2 [out0]"
> > 
> > I'm unable to see significant differences in terms of quality between
> > left and right part of the output (same with mp=fspp, so it doesn't
> > depend on the port).
> > 
> > Is this expected?
> > 
> > What's the use case of fspp?
> 
> What codec did your lq version end up using? I suspect fspp is most
> tested and works best with MPEG-4 ASP.  It should significantly
> reduce blocking - obviously only if your video has significant
> blocking.  It used to work fairly well on early flv streaming
> videos.

Output #0, mpeg, to 'matrixbench_mpeg2-lq.mpg':
  Metadata:
encoder : Lavf56.16.101
Stream #0:0: Video: mpeg1video, yuv420p, 720x576 [SAR 16:15 DAR 4:3], 
q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
Metadata:
  encoder : Lavc56.16.100 mpeg1video
Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
Metadata:
  encoder : Lavc56.16.100 mp2
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> mpeg1video (native))
  Stream #0:2 -> #0:1 (mp2 (native) -> mp2 (native))
-- 
FFmpeg = Free and Freak Magnificient Programmable Egregious Generator
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/frame_thread_encoder: remove buffer_mutex

2014-12-22 Thread Benoit Fouet
Hi,

On December 23, 2014 1:44:03 AM GMT+01:00, Michael Niedermayer 
 wrote:
>It was used for protecting calls to get/release_buffer()
>there are no such calls anymore
>
>Signed-off-by: Michael Niedermayer 
>---
> libavcodec/frame_thread_encoder.c |7 ---
> 1 file changed, 7 deletions(-)
>
>diff --git a/libavcodec/frame_thread_encoder.c
>b/libavcodec/frame_thread_encoder.c
>index 9a49fea..e10845e 100644
>--- a/libavcodec/frame_thread_encoder.c
>+++ b/libavcodec/frame_thread_encoder.c
>@@ -47,7 +47,6 @@ typedef struct{
> 
> typedef struct{
> AVCodecContext *parent_avctx;
>-pthread_mutex_t buffer_mutex;
> 
> AVFifoBuffer *task_fifo;
> pthread_mutex_t task_fifo_mutex;
>@@ -91,9 +90,7 @@ static void * attribute_align_arg worker(void *v){
> frame = task.indata;
> 
> ret = avcodec_encode_video2(avctx, pkt, frame, &got_packet);
>-pthread_mutex_lock(&c->buffer_mutex);
> av_frame_unref(frame);
>-pthread_mutex_unlock(&c->buffer_mutex);
> av_frame_free(&frame);
> if(got_packet) {
> av_dup_packet(pkt);
>@@ -109,9 +106,7 @@ static void * attribute_align_arg worker(void *v){
> }
> end:
> av_free(pkt);
>-pthread_mutex_lock(&c->buffer_mutex);
> avcodec_close(avctx);
>-pthread_mutex_unlock(&c->buffer_mutex);
> av_freep(&avctx);
> return NULL;
> }
>@@ -182,7 +177,6 @@ int ff_frame_thread_encoder_init(AVCodecContext
>*avctx, AVDictionary *options){
> 
> pthread_mutex_init(&c->task_fifo_mutex, NULL);
> pthread_mutex_init(&c->finished_task_mutex, NULL);
>-pthread_mutex_init(&c->buffer_mutex, NULL);
> pthread_cond_init(&c->task_fifo_cond, NULL);
> pthread_cond_init(&c->finished_task_cond, NULL);
> 
>@@ -239,7 +233,6 @@ void ff_frame_thread_encoder_free(AVCodecContext
>*avctx){
> 
> pthread_mutex_destroy(&c->task_fifo_mutex);
> pthread_mutex_destroy(&c->finished_task_mutex);
>-pthread_mutex_destroy(&c->buffer_mutex);
> pthread_cond_destroy(&c->task_fifo_cond);
> pthread_cond_destroy(&c->finished_task_cond);
> av_fifo_freep(&c->task_fifo);
 
LGTM

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


Re: [FFmpeg-devel] [PATCH] libavfilter/af_showvolume: A Simple Audio Filter for Extracting Volume Information

2014-12-22 Thread Stefano Sabatini
On date Monday 2014-12-22 16:50:57 +0100, Lars Kiesow encoded:
> Hi everyone,
> I'm an FFmpeg user for quite a while now and though I might as well
> switch to dev at some point...
> 
> Please find attached to this mail a simple audio filter which makes it
> possible to extract and print volume information from audio streams. It
> works more or less like the showinfo filters only that it returns the
> pcm value information for each audio sample.
> 
> This output can then be used to easily plot a waveform image like this:
>   http://larskiesow.de/waveform.png
> 
> 
> Example:
> ./ffmpeg -nostats -i ... -filter:a aresample=100,showvolume -f null -
>   [...]
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 0, channel: 0, volume: -239
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 1, channel: 0, volume: 126
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 2, channel: 0, volume: -74
>   [Parsed_showvolume_1 @ 0x1bcc300] n: 3, channel: 0, volume: 29
>   [...]
> 
> Example (Generate waveform using gnuplot):
> ./ffmpeg -nostats -i ... -ac 1 -filter:a aresample=100,showvolume \
>   -f null - 2>&1 | grep '^\[Parsed_showvolume_1' | \
>   gnuplot -p -e 'plot "-" using 9 with lines'

I think a better approach would be to export the average per-frame
volume to the metadata. Then you can use ffprobe to show such values
and process them. Parsing the log is not robust.

Also you could extend one of the existing filters to do that, or
design a new audio filter based on signalstats (it could be
named 'asignalstats').

Also, I think ideally we should be able to generate an output showing
as an image directly from ffmpeg (but could be more tricky due to the
undefined length of an audio track).

[...]
-- 
FFmpeg = Fast & Faithless Mean Powered Enlightening Generator
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel