Lan4
28th December 2023, 14:56
I want to limit the number of cores. In total I have 4 cores and 8 threads. I only need 6 threads for video encoding in the background (this is 80% of the computer’s power), and at this time I use the remaining threads for other work. I can change the number of processors in the Task Manager, but I have to do this every time. I wanted to do this automatically.
Now I'm trying this:
start /affinity 3F C:\ffmpeg.exe
A separate cmd window opens, which does not have the usual FFMPEG encoding log. And perhaps not all script options are used. How to do it correctly?
In general, the FFMPEG script looks like this:
FOR %%F IN (*.mp4) DO (
echo LSMASHVideoSource("%%~dpnxF"^) > "%%~dpnxF.avs"
echo SetFilterMTMode("DEFAULT_MT_MODE", 2^) >> "%%~dpnxF.avs"
echo LoadPlugin("D:\ResampleMT.dll"^) Spline36ResizeMT(720, 1280, prefetch=4^) >> "%%~dpnxF.avs"
echo KNLMeansCL(D=1, A=1, h=1.5, device_type="auto"^) >> "%%~dpnxF.avs"
echo DetailSharpen(str=0.3, pow=8, z=6, ldmp=0, mode=1, med=false^) >> "%%~dpnxF.avs"
echo Prefetch(6^) >> "%%~dpnxF.avs"
C:\ffmpeg.exe -benchmark -i "%%~dpnxF.avs" -i "%%~dpnxF" -map 0:v:0 -map 1:a:0 -c:v libx264 -qp 26 -preset medium -g 30 -keyint_min 5 -c:a copy "%%~dpnF_new.mp4"
del "%%~dpnxF.avs"
)
pause
Now I'm trying this:
start /affinity 3F C:\ffmpeg.exe
A separate cmd window opens, which does not have the usual FFMPEG encoding log. And perhaps not all script options are used. How to do it correctly?
In general, the FFMPEG script looks like this:
FOR %%F IN (*.mp4) DO (
echo LSMASHVideoSource("%%~dpnxF"^) > "%%~dpnxF.avs"
echo SetFilterMTMode("DEFAULT_MT_MODE", 2^) >> "%%~dpnxF.avs"
echo LoadPlugin("D:\ResampleMT.dll"^) Spline36ResizeMT(720, 1280, prefetch=4^) >> "%%~dpnxF.avs"
echo KNLMeansCL(D=1, A=1, h=1.5, device_type="auto"^) >> "%%~dpnxF.avs"
echo DetailSharpen(str=0.3, pow=8, z=6, ldmp=0, mode=1, med=false^) >> "%%~dpnxF.avs"
echo Prefetch(6^) >> "%%~dpnxF.avs"
C:\ffmpeg.exe -benchmark -i "%%~dpnxF.avs" -i "%%~dpnxF" -map 0:v:0 -map 1:a:0 -c:v libx264 -qp 26 -preset medium -g 30 -keyint_min 5 -c:a copy "%%~dpnF_new.mp4"
del "%%~dpnxF.avs"
)
pause