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

Error: ffmpeg vmaf exit code Some(1) #23

Closed
astyanax opened this issue Feb 19, 2022 · 9 comments
Closed

Error: ffmpeg vmaf exit code Some(1) #23

astyanax opened this issue Feb 19, 2022 · 9 comments

Comments

@astyanax
Copy link

astyanax commented Feb 19, 2022

Hi @alexheretic, many thanks for this contribution!

Unfortunately I haven't been able to debug a blocker and a major annoyance with the utility.(on Ubuntu 21.10):

  1. Regardless of the command used, the process fails with "Error: ffmpeg vmaf exit code Some(1)". I tried using ffmpeg-build-script to install ffmpeg and its dependencies, libvmaf should be 2.2.1 (I see you mentioned 1.5.3 as the min requirement?) and I've also compiled the latest vmaf cli and include it in the path ($ ./vmaf --version -> 9e1fb0bb). I don't see anything obvious in VmafOut.
  2. After this failure, I can no longer see my terminal's input buffer, and I have to open a new terminal/tab to return to normal (reset doesn't work). This affects all my terminals and terminals emulators (guake, alacritty, terminator, mate's).

Any thoughts on how we can debug this?

@alexheretic
Copy link
Owner

Can you try running vmaf via ffmpeg directly? Something like:

ffmpeg -i vid.av1.mp4 -i vid.mp4 -lavfi libvmaf -f null -

It's possible that you need to specify the model for your version of vmaf? (I tested with v1.5.3, and more recently v2.3.0, on arch both worked without any extra args)

I aim to improve error output #1

Regarding 2. I'm not sure why this would break your terminal, I'll try to reproduce this.

@alexheretic
Copy link
Owner

I got vmaf to work in a ubuntu 21.10 vm by using ffmpeg static and downloading https://github.com/Netflix/vmaf/blob/master/model/vmaf_v0.6.1.json then specifying ... -lavfi libvmaf=model_path=vmaf_v0.6.1.json ...

You can specify the same thing with ab-av1 with --vmaf model_path=vmaf_v0.6.1.json

Ubuntu is quite painful to use though, nothing useful is in the repos.

@astyanax
Copy link
Author

  1. Was indeed my fault: a) libvmaf wasn't enabled (I recompiled with it and make sure I had a full static build and it's all good), and b) the models can be installed under /usr/local/share/model, but it's easier to override the path as you said! Thanks :)

As for 2. my uneducated guess is that the failure leads to some wayward escape code messing things up, but curiously a reset doesn't solve it. I wouldn't expect it to be a problem with Gnome3/Xorg because existing or new terminals are fine. I will experiment a bit more and see whether it will reoccur on successful invocations.

@dudeofea
Copy link

dudeofea commented Mar 1, 2022

I'm getting this same error, could you post your ffmpeg compile flags? here are mine:

./configure --enable-gpl --enable-libx264 --enable-cuda --enable-cuvid --enable-nvdec --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libx265 --enable-libsvtav1 --enable-libass --enable-libopus --enable-libdav1d --enable-libvmaf --enable-avfilter --enable-static

I've tried both workarounds you specified and I get errors with the ffmpeg test command

libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version
libvmaf ERROR could not read model from path: "/usr/local/share/model/vmaf_v0.6.1.pkl"
libvmaf ERROR support for pkl model files has been removed, use json
libvmaf ERROR problem loading model file: /usr/local/share/model/vmaf_v0.6.1.pkl
[Parsed_libvmaf_0 @ 0x5608b8c39500] libvmaf encountered an error, check log for details
Error while filtering: Invalid argument
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Conversion failed!

with workaround

libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version
libvmaf ERROR could not read model from path: "/usr/local/share/model/vmaf_v0.6.1.json"
libvmaf ERROR problem loading model file: /usr/local/share/model/vmaf_v0.6.1.json
[Parsed_libvmaf_0 @ 0x55be808fbd40] libvmaf encountered an error, check log for details
Error while filtering: Invalid argument
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Conversion failed!

I've downloaded the file to /usr/local/share/model/vmaf_v0.6.1.json, with 664 permissions. I'm on Ubuntu 18.04

EDIT: I'm a big idiot, I didn't download the JSON file correctly, I downloaded the HTML page itself. It works.

@alexheretic
Copy link
Owner

I've added a wiki page to capture some steps that can help on older linux distros.

@Werve
Copy link
Contributor

Werve commented Apr 3, 2022

On windows there is still this error.
Probably because of Netflix/vmaf#424
It is possible to pass an argument to specify vmaf model path?

@alexheretic
Copy link
Owner

You can pass ffmpeg vmaf args using --vmaf ARG see https://ffmpeg.org/ffmpeg-filters.html#libvmaf

So something like --vmaf model=path=..., or maybe --vmaf model_path=... for older vmaf.

@alexheretic
Copy link
Owner

Also if you find some workarounds this may be worth adding to https://github.com/alexheretic/ab-av1/wiki/Troubleshooting

@Werve
Copy link
Contributor

Werve commented Apr 4, 2022

Thanks, I only saw after your clarification that there was the argument--vmaf.
I was able to get it to work on Windows with this template:
--vmaf '"model_path=C/:path\path 2\vmaf_v0.6.1.json"'
If it is of interest I share the .bat that automates the search also for preset of a video file passed as argument.
https://github.com/Werve/ab-av1/blob/main/Windows_cfr_search.bat

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

4 participants