On Wed, 16 Dec 2020 18:25:59 +0100 Michael Koch <astroelectronic@t-online.de> wrote:
Am 16.12.2020 um 17:34 schrieb adam smith via ffmpeg-user:
Hi guys,
I am looking at turning 16x9 content into 1x1 I want to be able to specify the source area that should be used for the output in 1 second increments and move between them smoothly.
It looks like I could perhaps use the crop filter or the zoompan filter to achieve this. Does anyone have any reasons why one would be better than the other?
I think in this case it's better to use the crop filter, because it supports commands.
ffmpeg -i in.mp4 -lavfi sendcmd=f=coord.cmd,crop@1=w=800:h=800:x=0:y=0 out.mp4
You can specify the top left coordinates of the square window in the file "coord.cmd":
0.0-1.0 [expr] crop@1 x 'lerp(0,100,TI)'; 0.0-1.0 [expr] crop@1 y 'lerp(0,100,TI)'; 1.0-2.0 [expr] crop@1 x 'lerp(100,150,TI)'; 1.0-2.0 [expr] crop@1 y 'lerp(100,220,TI)'; 2.0-3.0 [expr] crop@1 x 'lerp(150,80,TI)'; 2.0-3.0 [expr] crop@1 y 'lerp(220,220,TI)'; and so on...
In this example linear interpolation is used in the intervals. For more info about 'sendcmd' see also chapter 2.80 in my book: http://www.astro-electronic.de/FFmpeg_Book.pdf
wow, the book is a great work, awesome!!!
Michael
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
-- Best regards, Lingjiang Fang