Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-12 Thread Tristan Matthews
On Tue, Apr 12, 2022 at 2:05 PM Paul B Mahol  wrote:

> On Tue, Apr 12, 2022 at 7:43 PM Tristan Matthews 
> wrote:
>
> > Hi,
> >
> > On Mon, Apr 11, 2022 at 2:02 PM Paul B Mahol  wrote:
> >
> > > On Sat, Apr 9, 2022 at 9:21 PM Paul B Mahol  wrote:
> > >
> > > >
> > > > will apply soon
> > > >
> > >
> > >
> > > Forgot to apply, will apply in next 24h.
> > >
> >
> > Am I missing something obvious or is there a default that's maybe not
> set?
> > Getting:
> > ./ffmpeg_g -loglevel debug -y -t 5 -hide_banner -f lavfi -i avsynctest -f
> > mp4 avsync.mp4
> >  [lavfi @ 0x55e4454c37c0] Output pad "video" with type video of the
> filter
> > instance "Parsed_avsynctest_0" of avsynctest not connected to any
> > destination
> > avsynctest: Invalid argument
> >
> > whereas the equivalent works with e.g., testsrc
> >
>
> Filter have 2 outputs, unlike other filters with single output.
>
> Need to specify that 2nd output is also output with [out1]
>
>
Oh cheers, this worked:
avsynctest=[out0][out1]


> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-12 Thread Paul B Mahol
On Tue, Apr 12, 2022 at 7:43 PM Tristan Matthews 
wrote:

> Hi,
>
> On Mon, Apr 11, 2022 at 2:02 PM Paul B Mahol  wrote:
>
> > On Sat, Apr 9, 2022 at 9:21 PM Paul B Mahol  wrote:
> >
> > >
> > > will apply soon
> > >
> >
> >
> > Forgot to apply, will apply in next 24h.
> >
>
> Am I missing something obvious or is there a default that's maybe not set?
> Getting:
> ./ffmpeg_g -loglevel debug -y -t 5 -hide_banner -f lavfi -i avsynctest -f
> mp4 avsync.mp4
>  [lavfi @ 0x55e4454c37c0] Output pad "video" with type video of the filter
> instance "Parsed_avsynctest_0" of avsynctest not connected to any
> destination
> avsynctest: Invalid argument
>
> whereas the equivalent works with e.g., testsrc
>

Filter have 2 outputs, unlike other filters with single output.

Need to specify that 2nd output is also output with [out1]


>
> Best,
> Tristan
>
> ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-12 Thread Tristan Matthews
Hi,

On Mon, Apr 11, 2022 at 2:02 PM Paul B Mahol  wrote:

> On Sat, Apr 9, 2022 at 9:21 PM Paul B Mahol  wrote:
>
> >
> > will apply soon
> >
>
>
> Forgot to apply, will apply in next 24h.
>

Am I missing something obvious or is there a default that's maybe not set?
Getting:
./ffmpeg_g -loglevel debug -y -t 5 -hide_banner -f lavfi -i avsynctest -f
mp4 avsync.mp4
 [lavfi @ 0x55e4454c37c0] Output pad "video" with type video of the filter
instance "Parsed_avsynctest_0" of avsynctest not connected to any
destination
avsynctest: Invalid argument

whereas the equivalent works with e.g., testsrc

Best,
Tristan

___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-11 Thread Paul B Mahol
On Sat, Apr 9, 2022 at 9:21 PM Paul B Mahol  wrote:

>
> will apply soon
>


Forgot to apply, will apply in next 24h.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-09 Thread Paul B Mahol
will apply soon
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-09 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  37 
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/src_avsynctest.c | 401 +++
 4 files changed, 440 insertions(+)
 create mode 100644 libavfilter/src_avsynctest.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 6a66b0ed11..79f210046e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -29275,6 +29275,43 @@ Below is a description of the currently available 
multimedia sources.
 This is the same as @ref{movie} source, except it selects an audio
 stream by default.
 
+@section avsynctest
+Generate an Audio/Video Sync Test.
+
+Generated stream periodically shows flash video frame and emits beep in audio.
+Useful to inspect A/V sync issues.
+
+It accepts the following options:
+
+@table @option
+@item size, s
+Set output video size. Default value is @code{hd720}.
+
+@item framerate, fr
+Set output video frame rate. Default value is @code{30}.
+
+@item samplerate, sr
+Set output audio sample rate. Default value is @code{44100}.
+
+@item amplitude, a
+Set output audio beep amplitude. Default value is @code{0.7}.
+
+@item period, p
+Set output audio beep period in seconds. Default value is @code{3}.
+
+@item delay, dl
+Set output video flash delay in number of frames. Default value is @code{0}.
+
+@item cycle, c
+Enable cycling of video delays, by default is disabled.
+
+@item duration, d
+Set stream output duratioin. By default duration is unlimited.
+
+@item fg, bg, ag
+Set foreground/background/additional color.
+@end table
+
 @anchor{movie}
 @section movie
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index c4c946a988..2c2a5b8d83 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -579,6 +579,7 @@ OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)   += 
avf_showwaves.o
 OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER)  += vaf_spectrumsynth.o
 
 # multimedia sources
+OBJS-$(CONFIG_AVSYNCTEST_FILTER) += src_avsynctest.o
 OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o
 OBJS-$(CONFIG_MOVIE_FILTER)  += src_movie.o
 
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 9fbaaacf47..aecad5a2b0 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -550,6 +550,7 @@ extern const AVFilter ff_avf_showwavespic;
 extern const AVFilter ff_vaf_spectrumsynth;
 
 /* multimedia sources */
+extern const AVFilter ff_avsrc_avsynctest;
 extern const AVFilter ff_avsrc_amovie;
 extern const AVFilter ff_avsrc_movie;
 
diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
new file mode 100644
index 00..916128c69d
--- /dev/null
+++ b/libavfilter/src_avsynctest.c
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 2017-2022 Paul B Mahol
+ *
+ * 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/avassert.h"
+#include "libavutil/common.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/ffmath.h"
+#include "libavutil/opt.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/timestamp.h"
+#include "libavutil/xga_font_data.h"
+#include "avfilter.h"
+#include "drawutils.h"
+#include "filters.h"
+#include "formats.h"
+#include "internal.h"
+#include "audio.h"
+#include "video.h"
+
+typedef struct AVSyncTestContext {
+const AVClass *class;
+
+int w, h;
+AVRational frame_rate;
+int sample_rate;
+int64_t duration;
+int64_t apts, vpts;
+float amplitude;
+int period;
+int delay;
+int cycle;
+
+int beep;
+int beep_duration;
+int flash;
+int dir;
+AVRational vdelay, delay_max, delay_min;
+AVRational delay_range;
+int64_t prev_intpart;
+
+uint8_t rgba[3][4];
+FFDrawContext draw;
+FFDrawColor fg;
+FFDrawColor bg;
+FFDrawColor ag;
+} AVSyncTestContext;
+
+#define OFFSET(x) offsetof(AVSyncTestContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption avsynctest_options[] = {
+{"size",   "set frame size",  OFFSET(w),
AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
+

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-03-16 Thread Paul B Mahol
On Wed, Mar 16, 2022 at 9:08 PM Nicolas George  wrote:

> Paul B Mahol (12022-03-09):
> > Signed-off-by: Paul B Mahol 
> > ---
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/src_avsynctest.c | 399 +++
> >  3 files changed, 401 insertions(+)
> >  create mode 100644 libavfilter/src_avsynctest.c
>
> I opposed to this patch the first time, on the basis that our existing
> sources (testsrc and sine) would do the job just as well, and you never
> bothered to explain what this particular version would bring. I have
> found out on my own and therefore withdraw my objection.
> >
> > +static int32_t sin32(int32_t x, int shift)
> > +{
> > +const double pi = M_PI;
> > +const int32_t a = ((2.0 * pi) * (1 << 24));
> > +const int32_t b = (1 << 7) * (12.0 / pi - 1.0 - pi) * (1 << 24);
> > +const int32_t c = (1 << 9) * 3.0 * (2.0 + pi - 16.0 / pi) * (1 <<
> 24);
> > +int64_t x2, result;
> > +int32_t t1, t2;
>
> Can you consider reuse the code from asrc_sine to generate a bit-exact
> sin table?
>

This one uses s32 instead of s16. and should be already bitexact, no? (That
constants should always be same fixed precision number...)
I think that using limited size table will make sine less precise when
viewed in spectrum analyser, it will have side lobes, extra sinusoids but
with small gain.
Also sine filter does not allow volume adjustment at all (unless one use
volume filter, but that have drawbacks). This one allow at least some
limited signal
amplitude adjustments in power of 2 and is very compact.


>
> Regards,
>
> --
>   Nicolas George
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-03-16 Thread Nicolas George
Paul B Mahol (12022-03-09):
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/src_avsynctest.c | 399 +++
>  3 files changed, 401 insertions(+)
>  create mode 100644 libavfilter/src_avsynctest.c

I opposed to this patch the first time, on the basis that our existing
sources (testsrc and sine) would do the job just as well, and you never
bothered to explain what this particular version would bring. I have
found out on my own and therefore withdraw my objection.
> 
> +static int32_t sin32(int32_t x, int shift)
> +{
> +const double pi = M_PI;
> +const int32_t a = ((2.0 * pi) * (1 << 24));
> +const int32_t b = (1 << 7) * (12.0 / pi - 1.0 - pi) * (1 << 24);
> +const int32_t c = (1 << 9) * 3.0 * (2.0 + pi - 16.0 / pi) * (1 << 24);
> +int64_t x2, result;
> +int32_t t1, t2;

Can you consider reuse the code from asrc_sine to generate a bit-exact
sin table?

Regards,

-- 
  Nicolas George


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-03-09 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/src_avsynctest.c | 399 +++
 3 files changed, 401 insertions(+)
 create mode 100644 libavfilter/src_avsynctest.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 35e7977741..0b66d54742 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -579,6 +579,7 @@ OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)   += 
avf_showwaves.o
 OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER)  += vaf_spectrumsynth.o
 
 # multimedia sources
+OBJS-$(CONFIG_AVSYNCTEST_FILTER) += src_avsynctest.o
 OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o
 OBJS-$(CONFIG_MOVIE_FILTER)  += src_movie.o
 
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 73df2dc51a..1b4f3b5db8 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -551,6 +551,7 @@ extern const AVFilter ff_avf_showwavespic;
 extern const AVFilter ff_vaf_spectrumsynth;
 
 /* multimedia sources */
+extern const AVFilter ff_avsrc_avsynctest;
 extern const AVFilter ff_avsrc_amovie;
 extern const AVFilter ff_avsrc_movie;
 
diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
new file mode 100644
index 00..3d8b326181
--- /dev/null
+++ b/libavfilter/src_avsynctest.c
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2017-2022 Paul B Mahol
+ *
+ * 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/avassert.h"
+#include "libavutil/common.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/ffmath.h"
+#include "libavutil/opt.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/timestamp.h"
+#include "libavutil/xga_font_data.h"
+#include "avfilter.h"
+#include "drawutils.h"
+#include "filters.h"
+#include "formats.h"
+#include "internal.h"
+#include "audio.h"
+#include "video.h"
+
+typedef struct AVSyncTestContext {
+const AVClass *class;
+
+int w, h;
+AVRational frame_rate;
+int sample_rate;
+int64_t duration;
+int64_t apts, vpts;
+float amplitude;
+int period;
+int delay;
+int cycle;
+
+int beep;
+int beep_duration;
+int flash;
+int dir;
+AVRational vdelay, delay_max, delay_min;
+AVRational delay_range;
+int64_t prev_intpart;
+
+uint8_t rgba[3][4];
+FFDrawContext draw;
+FFDrawColor fg;
+FFDrawColor bg;
+FFDrawColor ag;
+} AVSyncTestContext;
+
+#define OFFSET(x) offsetof(AVSyncTestContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption avsynctest_options[] = {
+{"size",   "set frame size",  OFFSET(w),
AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
+{"s",  "set frame size",  OFFSET(w),
AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
+{"framerate",  "set frame rate",  OFFSET(frame_rate),   
AV_OPT_TYPE_VIDEO_RATE, {.str="30"},   0,INT_MAX, V },
+{"fr", "set frame rate",  OFFSET(frame_rate),   
AV_OPT_TYPE_VIDEO_RATE, {.str="30"},   0,INT_MAX, V },
+{"samplerate", "set sample rate", OFFSET(sample_rate),  AV_OPT_TYPE_INT,   
 {.i64=44100},8000,384000, A },
+{"sr", "set sample rate", OFFSET(sample_rate),  AV_OPT_TYPE_INT,   
 {.i64=44100},8000,384000, A },
+{"amplitude",  "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, 
 {.dbl=.7},   0.,  1., A },
+{"a",  "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, 
 {.dbl=.7},   0.,  1., A },
+{"period", "set beep period", OFFSET(period),   AV_OPT_TYPE_INT,   
 {.i64=3}, 1, 99., A },
+{"p",  "set beep period", OFFSET(period),   AV_OPT_TYPE_INT,   
 {.i64=3}, 1, 99., A },
+{"delay",  "set flash delay", OFFSET(delay),AV_OPT_TYPE_INT,   
 {.i64=0},   -30,  30, V },
+{"dl", "set flash delay", OFFSET(delay),AV_OPT_TYPE_INT,   
 {.i64=0},   -30,  30, V },
+{"cycle",  "set delay cycle", OFFSET(cycle),AV_OPT_TYPE_BOOL,  
 

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2020-03-12 Thread Nicolas George
Paul B Mahol (12020-03-12):
> I changed my mind, I will not follow Nicolas advice at all.
> Will  apply this filter ASAP.
> 
> I kindly ask Nicolas to stay away from my code for ever.

This is not how it works. Re-send the patch for consideration by the
whole project.

-- 
  Nicolas George
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2020-03-12 Thread Paul B Mahol
On 8/23/17, Nicolas George  wrote:
> Le sextidi 6 fructidor, an CCXXV, Paul B Mahol a écrit :
>> I was asked multiple times to implement this filter.
>
> I was not referring to the advice of single users with a tunnel vision
> of their own use case.
>
>> What framework? There is only framework for video source filter which
>> outputs static frames.
>
> You are mistaken: testsrc and testsrc2 use that framework and output
> variable frames.
>
>> I could make use of sine filter code.
>
> Exactly.
>
> Regards,

I changed my mind, I will not follow Nicolas advice at all.
Will  apply this filter ASAP.

I kindly ask Nicolas to stay away from my code for ever.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-23 Thread Nicolas George
Le sextidi 6 fructidor, an CCXXV, Paul B Mahol a écrit :
> I was asked multiple times to implement this filter.

I was not referring to the advice of single users with a tunnel vision
of their own use case.

> What framework? There is only framework for video source filter which
> outputs static frames.

You are mistaken: testsrc and testsrc2 use that framework and output
variable frames.

> I could make use of sine filter code.

Exactly.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-23 Thread Paul B Mahol
On 8/23/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> You completely ignored and removed other aspects of my reply.
>
> You still are being vague.
>
>> Something special, like one can control both audio and video aspect at
>> once and provide same info to output.
>
> On the usability / convenience question, we obviously disagree. I
> consider that multiplying the test source filters is a more serious
> source of annoyance and confusion for the users, but it is a matter of
> appreciation and you obviously disagree. For that kind of question the
> normal policy would be to ask for the appreciation of other people,
> especially the ones who deal with users on a regular basis, before
> committing.

I was asked multiple times to implement this filter.

>
> As for the technical issues, there are two, and the answer must be
> technical:
>
> This filter includes some amount of boilerplate code, which is a
> maintenance burden. Please make more efforts to reduce that. In this
> particular instance, I believe using the framework that Stefano designed
> for test sources would reduce the boilerplate code.

What framework? There is only framework for video source filter which
outputs static frames.

>
> This filter is not bit-exact. A test source needs very strongly to be
> bit-exact. There is in the code base all that is needed to make it so,
> and that would make it faster as well.

I could make use of sine filter code.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-23 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> You completely ignored and removed other aspects of my reply.

You still are being vague.

> Something special, like one can control both audio and video aspect at
> once and provide same info to output.

On the usability / convenience question, we obviously disagree. I
consider that multiplying the test source filters is a more serious
source of annoyance and confusion for the users, but it is a matter of
appreciation and you obviously disagree. For that kind of question the
normal policy would be to ask for the appreciation of other people,
especially the ones who deal with users on a regular basis, before
committing.

As for the technical issues, there are two, and the answer must be
technical:

This filter includes some amount of boilerplate code, which is a
maintenance burden. Please make more efforts to reduce that. In this
particular instance, I believe using the framework that Stefano designed
for test sources would reduce the boilerplate code.

This filter is not bit-exact. A test source needs very strongly to be
bit-exact. There is in the code base all that is needed to make it so,
and that would make it faster as well.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> I like idea of having single A/V filter to do this job, not combinations
>> where
>> users might become confused.
>
> I do not agree. Adding yet another filter causes confusion in itself.
> Not counting the extra boilerplate code (I suggest you permanently
> disable the copy-paste feature of your development editor ;-).
> Documenting the combination would have the same result.

You completely ignored and removed other aspects of my reply.

>
> Furthermore, having this in a single filter would possibly cause the
> misapprehension that something special happens there, while in truth it
> is no different from two individual filters.

Something special, like one can control both audio and video aspect at
once and provide same info to output.

>
> Also, two individual filters would be able to run in separate threads
> when filter-level threading will be implemented.

*when*

Also that matter less.

>
> Regards,
>
> --
>   Nicolas George
> ___
> 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] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> I like idea of having single A/V filter to do this job, not combinations where
> users might become confused.

I do not agree. Adding yet another filter causes confusion in itself.
Not counting the extra boilerplate code (I suggest you permanently
disable the copy-paste feature of your development editor ;-).
Documenting the combination would have the same result.

Furthermore, having this in a single filter would possibly cause the
misapprehension that something special happens there, while in truth it
is no different from two individual filters.

Also, two individual filters would be able to run in separate threads
when filter-level threading will be implemented.

Regards,

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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> That is not delay between blink and beep. But video timestamps.
>
> Since the beeps happen every second, the delay is the fractional part,
> or the remainder of the frame count divided by the frame rate. But if
> you think this arithmetic is too complex for our users, feel free to
> propose an option to add it on testsrc2.
>
>> For lipsync one would need to alter so blinks happens at exact same
>> time as beeps.
>
> They do.
>
>> Say delay is 10 frames, you modify filter to produce delayed blinks.
>
> I think it should be a job for setpts, but if you consider that too
> complex, again, I am not against a time delay option to testsrc2.
>
>> > The beep is when the cross is fully contracted.
>> That is far for being user friendly and obvious.
>
> It looks as obvious as the bumping dot on the videos you showed, in my
> opinion.
>
> Anyway, I am not against you wasting your time adding yet another test
> pattern, but not as proposed in this patch: use the framework of all the
> test patterns and make it bit-exact.

I like idea of having single A/V filter to do this job, not combinations where
users might become confused.
Also this filter displays audio parameters in video output, which would become
pain to do in combination of filters.

>
> Regards,
>
> --
>   Nicolas George
> ___
> 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] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> That is not delay between blink and beep. But video timestamps.

Since the beeps happen every second, the delay is the fractional part,
or the remainder of the frame count divided by the frame rate. But if
you think this arithmetic is too complex for our users, feel free to
propose an option to add it on testsrc2.

> For lipsync one would need to alter so blinks happens at exact same
> time as beeps.

They do.

> Say delay is 10 frames, you modify filter to produce delayed blinks.

I think it should be a job for setpts, but if you consider that too
complex, again, I am not against a time delay option to testsrc2.

> > The beep is when the cross is fully contracted.
> That is far for being user friendly and obvious.

It looks as obvious as the bumping dot on the videos you showed, in my
opinion.

Anyway, I am not against you wasting your time adding yet another test
pattern, but not as proposed in this patch: use the framework of all the
test patterns and make it bit-exact.

Regards,

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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> Sorry but where is that present? I nowhere can determine exact delay
>> in number of frames versus sine beep.
>
> In the upper-left corner, you have a microsecond timestamp and a frame
> counter.

That is not delay between blink and beep. But video timestamps.

>
>> It is not sine but testsrc2 one that would need modification.
>
> Care to explain? The beep is produced by sine. Why would you want to
> modify testsrc2?

For lipsync one would need to alter so blinks happens at exact same
time as beeps.
Say delay is 10 frames, you modify filter to produce delayed blinks.

>
>> Why you do not agree? When is actual beep when beating cross appears?
>
> The beep is when the cross is fully contracted.

That is far for being user friendly and obvious.

>
> Regards,
>
> --
>   Nicolas George
> ___
> 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] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> Sorry but where is that present? I nowhere can determine exact delay
> in number of frames versus sine beep.

In the upper-left corner, you have a microsecond timestamp and a frame
counter.

> It is not sine but testsrc2 one that would need modification.

Care to explain? The beep is produced by sine. Why would you want to
modify testsrc2?

> Why you do not agree? When is actual beep when beating cross appears?

The beep is when the cross is fully contracted.

Regards,

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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> Exact delay in number of frames and that converted to milliseconds.
>
> Already present. I asked you if you tested, obviously you did not.

Sorry but where is that present? I nowhere can determine exact delay
in number of frames versus sine beep.

>
>> Also one can not set custom delay between beep and blink.
>
> I already mentioned that. You can propose a patch to sine to add that
> option.

It is not sine but testsrc2 one that would need modification.

>
>> Also beating cross is far from being easily noticed like blink.
>
> I do not agree.

Why you do not agree? When is actual beep when beating cross appears?

>
> Regards,
>
> --
>   Nicolas George
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> Exact delay in number of frames and that converted to milliseconds.

Already present. I asked you if you tested, obviously you did not.

> Also one can not set custom delay between beep and blink.

I already mentioned that. You can propose a patch to sine to add that
option.

> Also beating cross is far from being easily noticed like blink.

I do not agree.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> How do you know when beep and blink should happen in your example?
>>
>> What is blink for testsrc2? Where in testsrc2 you can see delay in numeric
>> form?
>
> Have you tried? You have a numeric timestamp and frame counter in the
> upper left corner and a beating cross, both in sync with the beeps.
> Please tell me what you are missing here. With more than two lines
> please.

Exact delay in number of frames and that converted to milliseconds.
Also one can not set custom delay between beep and blink.
Also beating cross is far from being easily noticed like blink.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> How do you know when beep and blink should happen in your example?
> 
> What is blink for testsrc2? Where in testsrc2 you can see delay in numeric 
> form?

Have you tried? You have a numeric timestamp and frame counter in the
upper left corner and a beating cross, both in sync with the beeps.
Please tell me what you are missing here. With more than two lines
please.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> And how would you show delay introduced with video source filter?
>> testsrc(2) does not show anything resembling that.
>
> I do not understand what you mean. The output of "ffmpeg -lavfi
> 'testsrc2;sine'" looks functionally identical to the video you point.
> Please be more specific, with more than two short lines of answer.

How do you know when beep and blink should happen in your example?

What is blink for testsrc2? Where in testsrc2 you can see delay in numeric form?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> And how would you show delay introduced with video source filter?
> testsrc(2) does not show anything resembling that.

I do not understand what you mean. The output of "ffmpeg -lavfi
'testsrc2;sine'" looks functionally identical to the video you point.
Please be more specific, with more than two short lines of answer.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> So it is. So unless you tell what exactly you mean I can not help you.
>
> My bad.
>
>> testsrc(2) are useless for lipsync testing, when one needs to know
>> exact time something is played in wrong time.
>
> Yes, testsrc alone is not enough. But you did not read carefully enough:
> I mentioned testsrc2+sine. The sine source can optionally generate a
> periodic beep, just like your proposal. I grant you, the duration and
> period of the beep cannot be configured, but that would be easy to add.
> And sine is bit-exact and faster.

And how would you show delay introduced with video source filter?
testsrc(2) does not show anything resembling that.

Look at those youtube videos:
https://www.youtube.com/results?search_query=video+sync
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> So it is. So unless you tell what exactly you mean I can not help you.

My bad.

> testsrc(2) are useless for lipsync testing, when one needs to know
> exact time something is played in wrong time.

Yes, testsrc alone is not enough. But you did not read carefully enough:
I mentioned testsrc2+sine. The sine source can optionally generate a
periodic beep, just like your proposal. I grant you, the duration and
period of the beep cannot be configured, but that would be easy to add.
And sine is bit-exact and faster.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
>> Try harder to explain what you think.
>
> This "filter" has no input. All similar "filters" are called sources and
> implemented in files named accordingly.

So it is. So unless you tell what exactly you mean I can not help you.

>
>> If you actually tried you would know.
>
> I am sorry, but I do not accept that as an answer. Please explain why
> all this extra code is useful compared to what already exists.

testsrc(2) are useless for lipsync testing, when one needs to know
exact time something is played in wrong time.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXV, Paul B Mahol a écrit :
> Try harder to explain what you think.

This "filter" has no input. All similar "filters" are called sources and
implemented in files named accordingly.

> If you actually tried you would know.

I am sorry, but I do not accept that as an answer. Please explain why
all this extra code is useful compared to what already exists.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Paul B Mahol
On 8/19/17, Nicolas George  wrote:
> Le nonidi 29 thermidor, an CCXXV, Paul B Mahol a écrit :
>> Hi,
>>
>> patch attached.
>
>> From 8d3876499b93e61ec1aec39adfc3c3be8d622464 Mon Sep 17 00:00:00 2001
>> From: Paul B Mahol 
>> Date: Fri, 28 Apr 2017 20:18:38 +0200
>> Subject: [PATCH] avfilter: add Audio Video Sync Test filter
>>
>> Signed-off-by: Paul B Mahol 
>> ---
>>  libavfilter/Makefile |   1 +
>>  libavfilter/allfilters.c |   1 +
>>  libavfilter/src_avsynctest.c | 314
>> +++
>>  3 files changed, 316 insertions(+)
>>  create mode 100644 libavfilter/src_avsynctest.c
>
> Documentation missing.
>
>>
>> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
>> index 545b871cd7..aaf7375303 100644
>> --- a/libavfilter/Makefile
>> +++ b/libavfilter/Makefile
>> @@ -373,6 +373,7 @@ OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)   +=
>> avf_showwaves.o
>>  OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER)  += vaf_spectrumsynth.o
>> window_func.o
>>
>>  # multimedia sources
>
>> +OBJS-$(CONFIG_AVSYNCTEST_FILTER) += src_avsynctest.o
>
> It is a source, not a filter.

Try harder to explain what you think.

>
>>  OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o
>>  OBJS-$(CONFIG_MOVIE_FILTER)  += src_movie.o
>>
>> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
>> index f1dacaffa8..32f4049b30 100644
>> --- a/libavfilter/allfilters.c
>> +++ b/libavfilter/allfilters.c
>> @@ -384,6 +384,7 @@ static void register_all(void)
>>  REGISTER_FILTER(SPECTRUMSYNTH,  spectrumsynth,  vaf);
>>
>>  /* multimedia sources */
>> +REGISTER_FILTER(AVSYNCTEST, avsynctest, avsrc);
>>  REGISTER_FILTER(AMOVIE, amovie, avsrc);
>>  REGISTER_FILTER(MOVIE,  movie,  avsrc);
>>
>> diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
>> new file mode 100644
>> index 00..2f95976cbb
>> --- /dev/null
>> +++ b/libavfilter/src_avsynctest.c
>> @@ -0,0 +1,314 @@
>> +/*
>> + * Copyright (c) 2017 Paul B Mahol
>> + *
>> + * 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/avassert.h"
>> +#include "libavutil/common.h"
>> +#include "libavutil/ffmath.h"
>> +#include "libavutil/opt.h"
>> +#include "libavutil/imgutils.h"
>> +#include "libavutil/intreadwrite.h"
>> +#include "libavutil/parseutils.h"
>> +#include "libavutil/timestamp.h"
>> +#include "libavutil/xga_font_data.h"
>> +#include "avfilter.h"
>> +#include "drawutils.h"
>> +#include "formats.h"
>> +#include "internal.h"
>> +#include "audio.h"
>> +#include "video.h"
>> +
>> +typedef struct AVSyncTestContext {
>> +const AVClass *class;
>> +
>> +int w, h;
>> +AVRational frame_rate;
>> +int sample_rate;
>> +int64_t apts, vpts, prev_vpts;
>> +float amplitude;
>> +int period;
>> +int delay;
>> +int cycle;
>> +
>> +int previ;
>> +int beep;
>> +int beep_duration;
>> +int flash;
>> +int dir;
>> +float vdelay, delay_max, delay_min;
>> +float delay_range;
>> +
>> +FFDrawContext draw;
>> +FFDrawColor white;
>> +FFDrawColor black;
>> +FFDrawColor gray;
>> +} AVSyncTestContext;
>> +
>> +#define OFFSET(x) offsetof(AVSyncTestContext, x)
>> +#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
>> +#define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
>> +
>> +static const AVOption avsynctest_options[] = {
>> +{"size",   "set frame size",  OFFSET(w),
>> AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
>> +{"s",  "set frame size",  OFFSET(w),
>> AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
>> +{"framerate",  "set frame rate",  OFFSET(frame_rate),
>> AV_OPT_TYPE_VIDEO_RATE, {.str="30"},   0,INT_MAX, V },
>> +{"fr", "set frame rate",  OFFSET(frame_rate),
>> AV_OPT_TYPE_VIDEO_RATE, {.str="30"},   0,INT_MAX, V },
>> +{"samplerate", "set sample rate", OFFSET(sample_rate),
>> AV_OPT_TYPE_INT,{.i64=44100},8000,192000, A },
>> +{"sr", "set sample rate", OFFSET(sample_rate),
>> AV_OPT_TYPE_INT,{.i64=44100},8000,192000, A },
>> +

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-19 Thread Nicolas George
Le nonidi 29 thermidor, an CCXXV, Paul B Mahol a écrit :
> Hi,
> 
> patch attached.

> From 8d3876499b93e61ec1aec39adfc3c3be8d622464 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol 
> Date: Fri, 28 Apr 2017 20:18:38 +0200
> Subject: [PATCH] avfilter: add Audio Video Sync Test filter
> 
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/src_avsynctest.c | 314 
> +++
>  3 files changed, 316 insertions(+)
>  create mode 100644 libavfilter/src_avsynctest.c

Documentation missing.

> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 545b871cd7..aaf7375303 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -373,6 +373,7 @@ OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)   += 
> avf_showwaves.o
>  OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER)  += vaf_spectrumsynth.o 
> window_func.o
>  
>  # multimedia sources

> +OBJS-$(CONFIG_AVSYNCTEST_FILTER) += src_avsynctest.o

It is a source, not a filter.

>  OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o
>  OBJS-$(CONFIG_MOVIE_FILTER)  += src_movie.o
>  
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index f1dacaffa8..32f4049b30 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -384,6 +384,7 @@ static void register_all(void)
>  REGISTER_FILTER(SPECTRUMSYNTH,  spectrumsynth,  vaf);
>  
>  /* multimedia sources */
> +REGISTER_FILTER(AVSYNCTEST, avsynctest, avsrc);
>  REGISTER_FILTER(AMOVIE, amovie, avsrc);
>  REGISTER_FILTER(MOVIE,  movie,  avsrc);
>  
> diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
> new file mode 100644
> index 00..2f95976cbb
> --- /dev/null
> +++ b/libavfilter/src_avsynctest.c
> @@ -0,0 +1,314 @@
> +/*
> + * Copyright (c) 2017 Paul B Mahol
> + *
> + * 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/avassert.h"
> +#include "libavutil/common.h"
> +#include "libavutil/ffmath.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/imgutils.h"
> +#include "libavutil/intreadwrite.h"
> +#include "libavutil/parseutils.h"
> +#include "libavutil/timestamp.h"
> +#include "libavutil/xga_font_data.h"
> +#include "avfilter.h"
> +#include "drawutils.h"
> +#include "formats.h"
> +#include "internal.h"
> +#include "audio.h"
> +#include "video.h"
> +
> +typedef struct AVSyncTestContext {
> +const AVClass *class;
> +
> +int w, h;
> +AVRational frame_rate;
> +int sample_rate;
> +int64_t apts, vpts, prev_vpts;
> +float amplitude;
> +int period;
> +int delay;
> +int cycle;
> +
> +int previ;
> +int beep;
> +int beep_duration;
> +int flash;
> +int dir;
> +float vdelay, delay_max, delay_min;
> +float delay_range;
> +
> +FFDrawContext draw;
> +FFDrawColor white;
> +FFDrawColor black;
> +FFDrawColor gray;
> +} AVSyncTestContext;
> +
> +#define OFFSET(x) offsetof(AVSyncTestContext, x)
> +#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
> +#define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
> +
> +static const AVOption avsynctest_options[] = {
> +{"size",   "set frame size",  OFFSET(w),   
> AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
> +{"s",  "set frame size",  OFFSET(w),   
> AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
> +{"framerate",  "set frame rate",  OFFSET(frame_rate),  
> AV_OPT_TYPE_VIDEO_RATE, {.str="30"},   0,INT_MAX, V },
> +{"fr", "set frame rate",  OFFSET(frame_rate),  
> AV_OPT_TYPE_VIDEO_RATE, {.str="30"},   0,INT_MAX, V },
> +{"samplerate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT,  
>   {.i64=44100},8000,192000, A },
> +{"sr", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT,  
>   {.i64=44100},8000,192000, A },
> +{"amplitude",  "set amplitude",   OFFSET(amplitude),   
> AV_OPT_TYPE_FLOAT,  {.dbl=.5},   0.,  1., A },
> +{"a",  "set amplitude",   OFFSET(amplitude),   
> 

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-17 Thread Paul B Mahol
On 8/17/17, Alex Giladi  wrote:
> Hi Paul,
> Can you please point me to some information how this filter works?
> Best,
> Alex.

How to run:

mpv avdevice://lavfi:avsynctest[out1]

Are you interested in something else?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-16 Thread Alex Giladi
Hi Paul,
Can you please point me to some information how this filter works?
Best,
Alex.

On Wed, Aug 16, 2017 at 12:08 PM, Paul B Mahol  wrote:

> Hi,
>
> patch attached.
>
> ___
> 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


[FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2017-08-16 Thread Paul B Mahol
Hi,

patch attached.


0001-avfilter-add-Audio-Video-Sync-Test-filter.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel