CrypticSignal / video-quality-metrics

Uses FFmpeg to benchmark video encoders to compare VMAF/SSIM/PSNR with different encoder settings.
MIT License
117 stars 18 forks source link

Not creating /clips/ folder #21

Closed MillingtonAllen closed 3 years ago

MillingtonAllen commented 3 years ago

python3 main.py -ovp 'file.mp4' -crf 20 22 24 26 28 30 32 34 36 38 40 42 44 46 --interval 60 --clip-length 2 -e x265 -ssim -psnr

produces

Transcoding the video with CRF 20... (file.mp4)/clips/../2-60 (ClipLength-IntervalSeconds).mp4: No such file or directory

Traceback (most recent call last): File "main.py", line 364, in main() File "main.py", line 184, in main transcode_size = os.path.getsize(transcode_output_path) / 1_000_000 File "/usr/lib/python3.8/genericpath.py", line 50, in getsize return os.stat(filename).st_size FileNotFoundError: [Errno 2] No such file or directory: '(file.mp4)/CRF comparison at preset medium/CRF 20 at preset medium.mp4'

The code generates the /clips/ folder, but deletes it before attempting to navigate & transcode.

InB4DevOps commented 3 years ago

Which OS are you on? Just tested the same command on my Windows 10 machine and it works.

CrypticSignal commented 3 years ago

@MillingtonAllen Don't surround the filename in quotes unless there's a space in the filename. Change 'file.mp4' to file.mp4. I couldn't reproduce the issue, but I've just pushed a few changes to the code. Re-clone this repository (or use git pull), try again, and report back.

MillingtonAllen commented 3 years ago

Ok, seems to be working fine with the newest code. The filename I was using at the time does have spaces, but it's working as expected now. I am using Ubuntu 20.10.

Is it feasible (and sensible) to find PSNR / SSIM values without calculating vmaf values? I currently don't have libvmaf and I'm not sure if the ffmpeg executables from Ubuntu's repos have the flag enabled.

CrypticSignal commented 3 years ago

Is it feasible (and sensible) to find PSNR / SSIM values without calculating vmaf values?

Unfortunately this is not possible with this program which uses FFmpeg with the libvmaf filter. This filter is used to obtain the VMAF, with PSNR and SSIM calculation being optional.

I currently don't have libvmaf and I'm not sure if the ffmpeg executables from Ubuntu's repos have the flag enabled.

You can get FFmpeg with the libvmaf filter enabled here.