slhck/ffmpeg-quality-metrics

Tries to run `brew` on windows even when not enabling VMAF

cdgriffith opened this issue · 2 comments

Tries to run run_command(["brew", "--prefix", "libvmaf"]) when VMAF is disabled.

Traceback (most recent call last):
  File "C:\Users\<me>\venv\Scripts\ffmpeg_quality_metrics-script.py", line 11, in <module>
    load_entry_point('ffmpeg-quality-metrics==0.3.3', 'console_scripts', 'ffmpeg_quality_metrics')()
  File "c:\users\<me>\venv\lib\site-packages\ffmpeg_quality_metrics\__main__.py", line 272, in main
    model_path = os.path.join(get_brewed_model_path(), "vmaf_v0.6.1.pkl")
  File "c:\users\<me>\venv\lib\site-packages\ffmpeg_quality_metrics\__main__.py", line 36, in get_brewed_model_path
    stdout, _ = run_command(["brew", "--prefix", "libvmaf"])
  File "c:\users\<me>\venv\lib\site-packages\ffmpeg_quality_metrics\__main__.py", line 57, in run_command
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "C:\Program Files (x86)\Python37-32\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files (x86)\Python37-32\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Only workaround I found was to specify another file as the model to fool it.

ffmpeg_quality_metrics action.mkv Action-ultra.mkv -m <any other existing file> 
slhck commented

Thanks for reporting this. I usually don't factor in Windows when writing these. Do you know how to infer the Windows path for VMAF models? What would be the default?

Personally I would just have a check for 'if windows' to not run that function. Would also be possible to make a subprocess call to see if brew is available at all, and if not disable / throw an error that VMAF can't be run, and allow the user to specify via -m.

Could add a link in description to where to download them from https://github.com/Netflix/vmaf/tree/master/model