Opened 5 years ago

Last modified 13 months ago

#8124 new enhancement

color option for perspective filter

Reported by: Michael Koch Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: perspective
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
When the "perspective" filter is used with parameter "sense=1", the size of the video becomes smaller and the outer area if filled with the pixel values from the border of the input video. It would be nice to have an option for filling the outer area with a color.

This example shows the problem:

rem Make a chessboard video
c:\ffmpeg\ffmpeg -f lavfi -i color=black:s=vga -vf geq=g='255*mod(floor(X/40)+floor(Y/40),2)' -t 5 -y in.mp4

rem Apply the perspective filter
c:\ffmpeg\ffmpeg -i in.mp4 -lavfi "perspective=x0=150:y0=125:x1=500:y1=75:x2=100:y2=375:x3=480:y3=420:sense=1" -y out.mp4

A known workaround is to pad the input video with a 1-pixel wide border (with alpha=0), before applying the perspective filter.
This is useful if you have a video in which a flickering computer screen is visible, and you want to overlay another video over this computer screen.

Change History (2)

comment:1 by Carl Eugen Hoyos, 5 years ago

Component: ffmpegavfilter
Keywords: perspective added
Priority: minorwish

comment:2 by Michael Koch, 13 months ago

Note: See TracTickets for help on using tickets.