[FFmpeg-user] Strange results with delogo filter, maybe a bug

Moritz Barsnick barsnick at gmx.net
Tue Aug 26 10:23:56 CEST 2014


On Mon, Aug 25, 2014 at 22:35:51 +0200, sxe wrote:
> Here is how i tested it:

Posting the full output really really helps. But thanks for providing
input sample.

This must be due to the colorspace conversion:

> Sample 1:
> ffmpeg -i test.mp4 -r 1 -vf 'delogo=x=214:y=192:w=273:h=98:band=1'
> test2/%03d.png
> http://wstaw.org/m/2014/08/25/001_1.png

Note these lines when using "-loglevel debug":
[auto-inserted scaler 0 @ 0xad07580] w:854 h:480 fmt:yuvj420p sar:1/1 -> w:854 h:480 fmt:yuv420p sar:1/1 flags:0x4
[auto-inserted scaler 1 @ 0xad078c0] w:854 h:480 fmt:yuv420p sar:1/1 -> w:854 h:480 fmt:rgb24 sar:1/1 flags:0x4

> Sample 2:
> ffmpeg -i test.mp4 -r 1 test2/%03d.png
> http://wstaw.org/m/2014/08/25/001.png

Note this in the direct conversion from your clip to PNG:
[auto-inserted scaler 0 @ 0xa6ec7e0] w:854 h:480 fmt:yuvj420p sar:1/1 -> w:854 h:480 fmt:rgb24 sar:1/1 flags:0x4

If I use this following command line to simulate only the colorspace
conversion:

> ffmpeg -loglevel debug -i test.mp4 -r 1 -vf 'format=yuv420p' test5/%03d.png

resulting in this filter message:
[auto-inserted scaler 0 @ 0xa67e640] w:854 h:480 fmt:yuvj420p sar:1/1 -> w:854 h:480 fmt:yuv420p sar:1/1 flags:0x4
[auto-inserted scaler 1 @ 0xa67e980] w:854 h:480 fmt:yuv420p sar:1/1 -> w:854 h:480 fmt:rgb24 sar:1/1 flags:0x4

identical to your issue, you can observe that this is the color shift
you are seeing, and the delogo filter isn't at fault. Except perhaps
for the reason that it only accepts these pix_fmts:

yuv444p, yuv422p, yuv420p, yuv411p, yuv410p, yuv440p, yuva420p, gray8

I'm no colorspace expert and don't know how to reduce this "loss" you
are observing - others will chime in. :-)

Moritz


More information about the ffmpeg-user mailing list