Thanks guys.
I've expanded on these scripts to add non-linear squeezing of videos for the Tiny TV Mini's square display.
for i in *.mkv; do ffmpeg -y -i "$i" -r 24 -vf "[0:v]scale=-1:128,split=2[left][right];
[left]crop=iw/2:ih:0:0,geq='p(X * (3 * W - X) / (2 * W),Y)',scale=oh/2:ih[left_scaled];
[right]crop=iw/2:ih:iw/2:0,geq='p(X * (W + X) / (2 * W),Y)',scale=oh/2:ih[right_scaled];
[left_scaled][right_scaled]hstack=2,scale=64:64:force_original_aspect_ratio=increase,hqdn3d[output]" -sws_flags experimental -b:v 300k -maxrate 300k -bufsize 64K -c:v mjpeg -acodec pcm_u8 -ar 10000 -ac 1 "${i%.*}.avi"; done
Here I'm converting MKV files to AVIs for a TinyTV mini.
It splits the screen left and right, then uses quartic scaling (power 4) to scale each side, keeping the center undistorted, and pushing the distortion to the edges.
These are the things you might need to tweak for your own use
1. "*.mkv" - change this for your input video extension
2. scale=128:128. This is for performance reasons, before non-linear scaling, do a linear scale to twice your output resolution. This reduces the number of pixels that need pushing through the non-linear algorithm. I get encode speeds of 60x with this. Don't do the initial rescale, and your encode speed might be only 2 or 3 times realtime.
3. scale-64:64 - of course this is your final output resolution, yay!
4. sws (software scaling) is set to experimental to get a good balance of speed and quality
Here's an example frame of output (attached)