Log in

View Full Version : FFMPEG - scaling video twice before encoding?


SenorKaffee
19th June 2014, 21:59
I'm currently working on a project with a lot of retro low-res game footage. Since video editing suites usually are pretty bad at upscaling this kind of footage I usually use FFMPEG for a nearest neighbour resize before to get as close as possible to production resolution and let the video editing suite handle the rest.

These options are -sws_flags neighbor+full_chroma_inp -vf scale=iw*4:ih*4 or something similar.

This works with every output that has square pixels, but everything that uses 320x200 modes (like old Lucasarts games) produces anamorphic output which has to be stretched to look like intended. To do this it looks best to do a huge nearest neighbor resize. Those files would be too big for the program, so I want to give both steps to FFMPEG this times.

Like -sws_flags neighbor+full_chroma_inp -vf scale=iw*10:ih10 -sws_flags lanczos -vf scale=1440:1080, but of course FFMPEG doesn't accept the task like this / only does one resize.

Is there a way to do two resizes at once?

nevcairiel
19th June 2014, 23:37
try something like this:

-vf scale=w=iw*10:h=ih*10:flags=neighbor+full_chroma_inp,scale=w=1440:h=1080:flags=lanczos

I didn't actually test, but it may just work - but it will need a rather recent ffmpeg for the new options syntax to work.

SenorKaffee
20th June 2014, 19:39
Did a quick test and it seems to work. :thanks:

pandy
21st July 2014, 18:13
Don't forget about super2xsai filter which seem to be dedicated to this kind of work.

pandy
22nd July 2014, 13:01
Don't forget about super2xsai filter which seem to be dedicated to this kind of work.

@ffmpeg -i %1 -c:v rawvideo -vf "format=pix_fmts=bgr24,super2xsai,super2xsai" -shortest -y %1_sal.avi

btw
new ffmpeg have even better filter for pixel graphics - hqx

-vf "format=pix_fmts=bgr24,hqx=2 (or 3 or 4 if 2 or 3 or 4 times rescaling required)"