Log in

View Full Version : Can anyone help me improve this FFMPEG script?


GAP
7th December 2022, 07:05
Can anyone talk a look at this script? I am to make this setup into a FFMPEG script and even an AVISynth/AVS script. Here is what I am trying to do:


Using Virtualdub I was going to do two resizes using Nearest Neighbor and later Lanzcos3. The Nearest Neighbor resize filter was going to upscale the video while the other filter was for aspect ratio correction via "Compute Height from Ratio" on Lanzcos3. I know you do not have to do this in FFMPEG or AVISynth but you could in Virtualdub2.
I was to resize it to four times bigger than usual since that is considered HD and I do not want it to be bigger than what it can allowed to be.
I was put in a .mp4 video container with .aac as the audio container. Someone recommended me libopus as a possible audio codec but I want to play it safe with .aac.
As for codecs and compression, I mostly use x264 8 bit with a Slower compression with the constant rate factor being either 16 or lossless.
I wanted colorspace from RGB to YUV. I mostly work with pixels from old video games.


I was wondering how can I do so with this FFMPEG script? Do these options that I have about match what I want do? And if possible, how can export it to AVISynth or AVS.

ffmpeg -i input -vf "scale=iwX:ihX" -sws_flags neighbor -pix_fmt yuv420p -c:v libx264 -preset slower -crf 16 -c:a libopus -b:a 128k

kedautinh12
7th December 2022, 07:17
1. try use deep_resize, example in this:
https://github.com/Dogway/Avisynth-Scripts/blob/0231e9ad341ecdaa76932686f78fc65c2a106b98/ResizersPack.avsi#L37
5. http://avisynth.nl/index.php/Convert

Dogway
7th December 2022, 09:45
You can do that with PointResize(), or if you want to keep the pixel center use GaussResize(p=100).

Then you can use lanczosresize(taps=3) for final dimensions. I'm not sure if there's Quilez scaling in AviSynth, but otherwise I would recommend Bilinear to avoid the ringing from lanczos.

GAP
13th December 2022, 15:17
1. try use deep_resize, example in this:
https://github.com/Dogway/Avisynth-Scripts/blob/0231e9ad341ecdaa76932686f78fc65c2a106b98/ResizersPack.avsi#L37
5. http://avisynth.nl/index.php/Convert

So I just need to copy the text into an AVS file? Or do I have to use the text the write the script myself?


You can do that with PointResize(), or if you want to keep the pixel center use GaussResize(p=100).

Then you can use lanczosresize(taps=3) for final dimensions. I'm not sure if there's Quilez scaling in AviSynth, but otherwise I would recommend Bilinear to avoid the ringing from lanczos.

So I do this:

PointResize (height, width)

lanzcosresize (taps=3)

I was mostly used Virtualdub and FFMPEG so I am still new to AVISynth.

kedautinh12
13th December 2022, 16:12
Yes, copy text to .avsi file and drop to folder contain plugins .dll. After base my example link and use scripts for yourself