I'm trying to recreate the "Superview" effect of a go-pro camera in linux, from a camera that doesn't have this ability. A description of what I am going for is here, the critical bit is the image below:
The effect is created by recording in 4:3, then stretching out the edges of the image to fill out a 16:9 frame. The centre of the image is relatively unstretched.
I cannot find a way of distorting an video in this way in Linux, so intend to use ffmpeg to break the video into frames, then an imagemagick script to distort each frame, then re-build the video from the new frames.
However, I cannot find a distort filter which does what I want. I have tried using the polynomial and barrel distorts, but I can't work out how to get them, or any other distort method, to apply in this way - linear in the y axis, with a variable scale in the x axis.
Starting with 1440x1080, aiming for a 1920x1080, the closest I have got is the following, which simply stretches out the image uniformly. It feels like this should be close, but when I change the Order to 2, all hell breaks loose, and I'm not sure why:
Code: Select all
convert 4by3.jpg -define distort:viewport=1920x1080+0+0 -filter point -distort polynomial \
'1.5 \
0,0 0,0 576,0 816,0 720,0 960,0 864,0 1104,0 1440,0 1920,0 \
0,1080 0,1080 576,1080 816, 1080 720,1080 960,1080 864,1080 1104,1080 1440,1080 1920,1080' \
16by9.jpg