[FFmpeg-devel] [PATCH] add phqm filter and img_hash

Christopher Kennedy ckennedy at ellation.com
Sat Oct 26 21:56:47 EEST 2019


On Sat, Oct 26, 2019 at 11:15 AM Paul B Mahol <onemda at gmail.com> wrote:
>
> On 10/26/19, Christopher Kennedy <ckennedy at ellation.com> wrote:
> > On Sat, Oct 26, 2019 at 8:22 AM Paul B Mahol <onemda at gmail.com> wrote:
> >>
> >> On 10/26/19, Christopher Kennedy <ckennedy at ellation.com> wrote:
> >> > This is a reference/encode comparison filter with two files input like
> >> > the psnr or vmaf filter.
> >> > So it is completely different and uses the C++ OpenCV API since this
> >> > img_hash library is not in the C API.
> >> > It's unique to what the OCV filter does, and has more research
> >> > implications from my talk at Demuxed 2019.
> >>
> >> I do not see how that is relevant.
> >>
> >> There should be generic opencv filter which could do this above in
> >> generic way, and not by adding yet another filter that uses only some
> >> part of opencv.
> >
> > Is it really possible to do framesync() operations like dual input filters
> > like psnr/vmaf and also handle input/output rendering of the frames too?
> > This sounds odd to me but I would love to understand how this is possible.
>
> framesync is nothing special, its just used a lot, there are video
> filters that do not use it and still operate on multiple inputs.
>
> >
> > The C OpenCV API is not recommended so this does the OpenCV part
> > in C++ which allows it to be fully utilized and supported. So that seems
> > better to me than using the API OpenCV won't really support and doesn't
> > allow usage of img_hash (it is NOT in the C API of OpenCV, impossible to
> > use).
> >
> > The OpenCV C++ img_hash library is the fastest implementation and does
> > work best in OpenCV. So implementing this in C directly isn't a task I
> > believe
> > is good to do.
>
> I do not care how generic opencv filter is done, it can be C++ just fine.
>
> >
> > So should the current OpenCV stuff be merged into this filter, is that
> > possible?
>
> Current opencv stuff in libavfilter is pretty dead and not maintained at all.
> So I'm not really fond of adding yet another opencv filter that not
> gonna be maintained.
>
> > If so, then your saying the PSNR filter could also alter frames and output
> > them
> > too from the reference/encode or one or the other? I need to understand
> > this
> > better, I want to make it right so am listening.
>
> I'm not sure what you really want. Native psnr filter does not alter video,
> it just takes two inputs and output first one unmodified and reports
> via log and metadata psnr values it measured.
>
> Also, I'm of opinion that hashing images is so trivial operation that
> could be done native to libavfilter.

Well one option is for me to port the other ocv filters few capabilities
into this one that uses the recommended maintained API. Otherwise
this feature isn't available in the other. Yeah I would love to have a
C version of it to plop in. I don't think C++ linking like this can be kept
out of individual parts of FFmpeg that aren't affecting the other parts
forever. I don't like C++ but I do like all the other possible options in
OpenCV this filter will open up for others to add into FFmpeg filters
in the future. I do think there is great value and not enough people
to rewrite OpenCV into C and maintain that.

Thanks,
Christopher

>
> >
> > Thanks
> > Christopher
> >
> >>
> >> >
> >> > Christopher
> >> >
> >> > On Sat, Oct 26, 2019 at 7:38 AM Paul B Mahol <onemda at gmail.com> wrote:
> >> >>
> >> >> Why is this not generic filter like already existing opencv filter?
> >> >>
> >> >> On 10/26/19, ckennedy at ellation.com <ckennedy at ellation.com> wrote:
> >> >> > From: Christopher Kennedy <ckennedy at ellation.com>
> >> >> >
> >> >> > this adds a phqm filter and OpenCV img_hash based resource usable
> >> >> > by the phqm and future filters using image hash functionality
> >> >> > from OpenCV.
> >> >> >
> >> >> > C++ to C handling so that full OpenCV functionality and API can
> >> >> > be used instead of the C versions (which are incomplete and
> >> >> > don't always exist).
> >> >> >
> >> >> > Example command line:
> >> >> >
> >> >> > ffmpeg -i encode.mp4 -i reference.mp4 \
> >> >> >            -filter_complex "[0:v][1:v]phqm=stats_file=out.log" \
> >> >> >            -y -f null /dev/null
> >> >> >
> >> >> > Signed-off-by: Christopher Kennedy <ckennedy at ellation.com>
> >> >> >
> >> >> > _______________________________________________
> >> >> > ffmpeg-devel mailing list
> >> >> > ffmpeg-devel at ffmpeg.org
> >> >> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >> >> >
> >> >> > To unsubscribe, visit link above, or email
> >> >> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> >> >
> >


More information about the ffmpeg-devel mailing list