[FFmpeg-devel] [PATCH][libavfilter] codecview: improved options
Michael Niedermayer
michael at niedermayer.cc
Sat May 14 21:53:24 CEST 2016
On Fri, May 13, 2016 at 06:05:26PM +0000, Davinder Singh wrote:
> should fix fate :)
>
> On Wed, May 11, 2016 at 6:32 PM Michael Niedermayer <michael at niedermayer.cc>
> wrote:
>
> > On Wed, May 11, 2016 at 12:41:43PM +0000, Davinder Singh wrote:
> > > single patch
> > >
> > > On Sun, May 8, 2016 at 1:18 AM Davinder Singh <ds.mudhar at gmail.com>
> > wrote:
> > >
> > > > separated motion vector types (forward or backward) from frame picture
> > > > types as MVs are associated with picture types only in video coding.
> > > >
> > > > option `mv` can have two values:
> > > > forward predicted or backward predicted.
> > > >
> > > > option `frames` can have three values:
> > > > p-frames, i-frames and b-frames.
> > > >
> > > > ex:
> > > > only forward predicted mvs of all frames:
> > > > -vf codecview=mv=fp
> > > >
> > > > mvs (both forward or backward predicted) of P or B-frames:
> > > > -vf codecview=mv=fp+bp:frames=pf+bf
> > > >
> > > > Regards,
> > > > DSM_
> > > >
> >
> > > doc/filters.texi | 30 ++++++++++++++++++++++++------
> > > libavfilter/vf_codecview.c | 36 ++++++++++++++++++++++++++----------
> > > 2 files changed, 50 insertions(+), 16 deletions(-)
> > > 6168c73a45d4b183a4478909e4f8f3b0e47d1738
> > 0001-vf_codecview-improved-filter-options.patch
> > > From 0c2c258bd14d5dd58351271cc8c8859cd5edbf26 Mon Sep 17 00:00:00 2001
> > > From: dsmudhar <ds.mudhar at gmail.com>
> > > Date: Wed, 11 May 2016 17:57:39 +0530
> > > Subject: [PATCH] vf_codecview: improved filter options
> >
> > this breaks make fate
> >
> > make fate-filter-codecview-mvs
> > TEST filter-codecview-mvs
> > --- ./tests/ref/fate/filter-codecview-mvs 2016-05-11
> > 04:21:34.187662201 +0200
> > +++ tests/data/fate/filter-codecview-mvs 2016-05-11
> > 14:58:43.732467592 +0200
> > @@ -1,65 +0,0 @@
> > -#tb 0: 32768/785647
> > -#media_type 0: video
> > -#codec_id 0: rawvideo
> > -#dimensions 0: 576x320
> > -#sar 0: 0/1
> > -0, 0, 0, 1, 276480, 0x5f7a0d4f
> > -0, 1, 1, 1, 276480, 0x5f7a0d4f
> > -0, 2, 2, 1, 276480, 0x5f7a0d4f
> > -0, 3, 3, 1, 276480, 0x5f7a0d4f
> > -0, 4, 4, 1, 276480, 0x5f7a0d4f
> > -0, 5, 5, 1, 276480, 0x5f7a0d4f
> > -0, 6, 6, 1, 276480, 0x5f7a0d4f
> > -0, 7, 7, 1, 276480, 0x5f7a0d4f
> > -0, 8, 8, 1, 276480, 0x5f7a0d4f
> > -0, 9, 9, 1, 276480, 0x5f7a0d4f
> > -0, 10, 10, 1, 276480, 0x5f7a0d4f
> > -0, 11, 11, 1, 276480, 0x5f7a0d4f
> > -0, 12, 12, 1, 276480, 0x5f7a0d4f
> > -0, 13, 13, 1, 276480, 0x5f7a0d4f
> > -0, 14, 14, 1, 276480, 0x5f7a0d4f
> > -0, 15, 15, 1, 276480, 0x5f7a0d4f
> > -0, 16, 16, 1, 276480, 0xc3b80edf
> > -0, 17, 17, 1, 276480, 0x5f7a0d4f
> > -0, 18, 18, 1, 276480, 0x5f7a0d4f
> > -0, 19, 19, 1, 276480, 0x5f7a0d4f
> > -0, 20, 20, 1, 276480, 0xc3b80edf
> > -0, 21, 21, 1, 276480, 0x5f7a0d4f
> > -0, 22, 22, 1, 276480, 0x5f7a0d4f
> > -0, 23, 23, 1, 276480, 0x5f7a0d4f
> > -0, 24, 24, 1, 276480, 0xc3b80edf
> > -0, 25, 25, 1, 276480, 0x5f7a0d4f
> > -0, 26, 26, 1, 276480, 0x5f7a0d4f
> > -0, 27, 27, 1, 276480, 0x5f7a0d4f
> > -0, 28, 28, 1, 276480, 0xc3b80edf
> > -0, 29, 29, 1, 276480, 0x5f7a0d4f
> > -0, 30, 30, 1, 276480, 0x5f7a0d4f
> > -0, 31, 31, 1, 276480, 0x5f7a0d4f
> > -0, 32, 32, 1, 276480, 0xc3b80edf
> > -0, 33, 33, 1, 276480, 0x75641594
> > -0, 34, 34, 1, 276480, 0x32ee3526
> > -0, 35, 35, 1, 276480, 0xcb53479a
> > -0, 36, 36, 1, 276480, 0xe1be6e26
> > -0, 37, 37, 1, 276480, 0x5ce39368
> > -0, 38, 38, 1, 276480, 0x4ec1e418
> > -0, 39, 39, 1, 276480, 0x23c418ae
> > -0, 40, 40, 1, 276480, 0x036a5515
> > -0, 41, 41, 1, 276480, 0x7946efbd
> > -0, 42, 42, 1, 276480, 0xd9aa1382
> > -0, 43, 43, 1, 276480, 0x3863f9c8
> > -0, 44, 44, 1, 276480, 0x33e47330
> > -0, 45, 45, 1, 276480, 0xff6e8038
> > -0, 46, 46, 1, 276480, 0xed3ff087
> > -0, 47, 47, 1, 276480, 0xe7834514
> > -0, 48, 48, 1, 276480, 0x4d5d909d
> > -0, 49, 49, 1, 276480, 0x82eea962
> > -0, 50, 50, 1, 276480, 0x8075bca3
> > -0, 51, 51, 1, 276480, 0xd5dc3185
> > -0, 52, 52, 1, 276480, 0x859e0490
> > -0, 53, 53, 1, 276480, 0x6ceebf3e
> > -0, 54, 54, 1, 276480, 0xada5d62d
> > -0, 55, 55, 1, 276480, 0x991a7628
> > -0, 56, 56, 1, 276480, 0xe169042a
> > -0, 57, 57, 1, 276480, 0x226e52c4
> > -0, 58, 58, 1, 276480, 0xa3fe775c
> > -0, 59, 59, 1, 276480, 0x6b80e99f
> > Test filter-codecview-mvs failed. Look at
> > tests/data/fate/filter-codecview-mvs.err for details.
> > make: *** [fate-filter-codecview-mvs] Error 1
> >
> > (note with V=2 as in make V=2 fate-filter-codecview-mvs) it shows
> > more details of what is executed and what fails
> >
> >
> > [...]
> >
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > In a rich man's house there is no place to spit but his face.
> > -- Diogenes of Sinope
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> doc/filters.texi | 30 ++++++++++++++++++++++++------
> libavfilter/vf_codecview.c | 36 ++++++++++++++++++++++++++----------
> tests/fate/filter-video.mak | 2 +-
> 3 files changed, 51 insertions(+), 17 deletions(-)
> 7c79e05ac854cfbe0f05d2e561358d8ebe317a6d 0001-vf_codecview-improved-filter-options.patch
> From 58b2545797c6d61cb5a200f800835b84dc105cfa Mon Sep 17 00:00:00 2001
> From: dsmudhar <ds.mudhar at gmail.com>
> Date: Fri, 13 May 2016 23:27:41 +0530
> Subject: [PATCH] vf_codecview: improved filter options
>
> ---
> doc/filters.texi | 30 ++++++++++++++++++++++++------
> libavfilter/vf_codecview.c | 36 ++++++++++++++++++++++++++----------
> tests/fate/filter-video.mak | 2 +-
> 3 files changed, 51 insertions(+), 17 deletions(-)
>
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 8fca52d..6204b5d 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -4715,12 +4715,24 @@ Set motion vectors to visualize.
> Available flags for @var{mv} are:
>
> @table @samp
> + at item fp
> +forward predicted MVs
> + at item bp
> +backward predicted MVs
> + at end table
> +
> + at item frames
> +Set frame types to display motion vectors of.
> +
> +Available flags for @var{frames} are:
> +
> + at table @samp
> + at item if
> +intra-coded frames (I-frames)
> @item pf
> -forward predicted MVs of P-frames
> +predicted frames (P-frames)
> @item bf
> -forward predicted MVs of B-frames
> - at item bb
> -backward predicted MVs of B-frames
> +bi-directionally predicted frames (B-frames)
> @end table
>
> @item qp
> @@ -4731,9 +4743,15 @@ Display quantization parameters using the chroma planes
>
> @itemize
> @item
> -Visualizes multi-directionals MVs from P and B-Frames using @command{ffplay}:
> +Visualize forward predicted MVs of all frames using @command{ffplay}:
> + at example
> +ffplay -flags2 +export_mvs input.mpg -vf codecview=mv=fp
> + at end example
> +
> + at item
> +Visualize multi-directional MVs of P and B-frames:
> @example
> -ffplay -flags2 +export_mvs input.mpg -vf codecview=mv=pf+bf+bb
> +ffplay -flags2 +export_mvs input.mpg -vf codecview=mv=fp+bp:frames=pf+bf
> @end example
> @end itemize
>
> diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
> index e70b397..d2c9254 100644
> --- a/libavfilter/vf_codecview.c
> +++ b/libavfilter/vf_codecview.c
> @@ -35,24 +35,32 @@
> #include "avfilter.h"
> #include "internal.h"
>
> -#define MV_P_FOR (1<<0)
> -#define MV_B_FOR (1<<1)
> -#define MV_B_BACK (1<<2)
> +#define MV_FOR (1<<0)
> +#define MV_BACK (1<<1)
> +#define FRAME_TYPE_I (1<<0)
> +#define FRAME_TYPE_P (1<<1)
> +#define FRAME_TYPE_B (1<<2)
>
> typedef struct {
> const AVClass *class;
> unsigned mv;
> + unsigned frames;
> int hsub, vsub;
> int qp;
> } CodecViewContext;
>
> #define OFFSET(x) offsetof(CodecViewContext, x)
> #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> +#define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, unit }
> +
> static const AVOption codecview_options[] = {
> { "mv", "set motion vectors to visualize", OFFSET(mv), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, INT_MAX, FLAGS, "mv" },
> - {"pf", "forward predicted MVs of P-frames", 0, AV_OPT_TYPE_CONST, {.i64 = MV_P_FOR }, INT_MIN, INT_MAX, FLAGS, "mv"},
> - {"bf", "forward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = MV_B_FOR }, INT_MIN, INT_MAX, FLAGS, "mv"},
> - {"bb", "backward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = MV_B_BACK }, INT_MIN, INT_MAX, FLAGS, "mv"},
> + CONST("fp", "forward predicted MVs", MV_FOR, "mv"),
> + CONST("bp", "backward predicted MVs", MV_BACK, "mv"),
> + { "frames", "set frame types to display MVs of", OFFSET(frames), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, INT_MAX, FLAGS, "frames" },
> + CONST("if", "I-frames", FRAME_TYPE_I, "frames"),
> + CONST("pf", "P-frames", FRAME_TYPE_P, "frames"),
> + CONST("bf", "B-frames", FRAME_TYPE_B, "frames"),
it would be better if the previous syntax would still work, in addition
to any new things
bug reports, mailing list posts, user experience and scripts may
use the old syntax
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160514/bdde0d07/attachment.sig>
More information about the ffmpeg-devel
mailing list