Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower FPS and CPU utilization with VMAF v2.0.0 with FFmpeg #770

Closed
LarLei opened this issue Dec 16, 2020 · 3 comments
Closed

Lower FPS and CPU utilization with VMAF v2.0.0 with FFmpeg #770

LarLei opened this issue Dec 16, 2020 · 3 comments

Comments

@LarLei
Copy link

LarLei commented Dec 16, 2020

Hello,

With ffmpeg-2020-12-12-git-5148740e79-full_build (https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-2020-12-12-git-5148740e79-full_build.7z) that has VMAF v2.0.0, the FPS is much lower (around 10) and the CPU utilization averages around 20%.

However, with ffmpeg-2020-11-18-git-e3081d6f4f-full_build (no longer available for download) that has VMAF v1.5.3, the FPS averages around 25 and the CPU utilization is at 100%.

The CPU is an Intel i7-9750H (6 cores, 12 threads, AVX2)

I use 1 below for FFmpeg with VMAF v1.5.3 and 2 below for FFmpeg with VMAF v2.0.0:

  1. ffmpeg -report -benchmark -i Transcode.mp4 -i Source.mp4 -lavfi libvmaf=model_path=D\:/Software/FFMPEG/cmds/vmaf_v0.6.1.pkl:pool=harmonic_mean:log_fmt=xml:log_path=C\:/Save/%Transcode%.VMAF.xml -f null -

  2. ffmpeg -report -benchmark -i Transcode.mp4 -i Source.mp4 -lavfi libvmaf=model_path=D\:/Software/FFMPEG/cmds/vmaf_v0.6.1.json:pool=harmonic_mean:log_fmt=xml:log_path=C\:/Save/%Transcode%.VMAF.xml -f null -

Thanks!

@malakudi
Copy link

Add n_threads=X to your libvmaf parameters where X the number of threads you want. It seems 2.0 uses only 1 thread when n_threads is not defined.

@kylophone
Copy link
Collaborator

kylophone commented Dec 16, 2020

Add n_threads=X to your libvmaf parameters where X the number of threads you want. It seems 2.0 uses only 1 thread when n_threads is not defined.

Yes, this is correct. Previous libvmaf would query your system and use all the available cores by default. The default in libvmaf v2.0.0 is to use no threading. Use n_threads to explicitly set the number of threads to be used.

@LarLei
Copy link
Author

LarLei commented Dec 16, 2020

Thanks all! That fixed the issue. I modified the command 2 above to include the n_threads=12 and saw a nice improvement of 35 FPS with the CPU at 100% for all cores/threads.

ffmpeg -report -benchmark -i Transcode.mp4 -i Source.mp4 -lavfi libvmaf=model_path=D\:/Software/FFMPEG/cmds/vmaf_v0.6.1.json:pool=harmonic_mean:n_threads=12:log_fmt=xml:log_path=C\:/Save/%Transcode%.VMAF.xml -f null -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants