Sure, so let me give you this example:
This workflow saves the final vmaf value in a variable like %s_vmaf% and sets s_success to it so you see the result in the job monitor.
The cmd is built like this:
Code: Select all
"%s_ffmpeg%" -i "%s_source%" -i "%s_original_path%\%s_original_name%_1.%s_original_ext%" -filter_complex "[0:v]split=1[vmaf0];[1:v]split=1[vmaf1];[vmaf0][vmaf1]libvmaf=ts_sync_mode=nearest:n_threads=20" -an -hide_banner -nostdin -f null -
as you see the second -i (the file to compare) is built using the original filename but adds _1, so this would compare the files
C:\temp\test.mxf and c:\temp\test_1.mxf
Now there is a couple of options, besides we could specify the vmaf model (here i dont specify any model which means we use the fullhd living room default model), we can compare just a portion of the clips by inserting something like
at the %HERE% Position in: [0:v]%HERE%split=1 and [1:v]%HERE%split=1
For Reference, the internally calculated command looks like this:
Code: Select all
"%s_ffmpeg%" -i SOURCEFILE -i COMPAREFILE -filter_complex "[0:v]trim=start=74:end=148,split=1[vmaf0];[1:v]trim=start=74:end=148,split=1[vmaf1];[vmaf0][vmaf1]libvmaf=use model='path=C\:/temp/FFAStrans1.4.0.1/processors/FFMpeg/vmaf_v0.6.1.json':log_path='c\:/.ffastrans_work_root/20210121-2008-2041-5578-dc1cf46d7048/20240404-0036-4036-0181-13152608ff67/1-15-15~240404003642543~2132~20240404-0036-1586-9e74-2d30d687ed2c~anal_videoq~vmaf.json':log_fmt=json:pool=mean:ts_sync_mode=nearest" -an -hide_banner -nostdin -f null -
While looking at the libvmaf filter documentation, we can safely remove some of the options, especially the model path because 0.6.1 seems to be default. If you need to specify the model path, you must take great care about escaping the doubledot as seen above "c\:/temp" and use forward slashes for the rest of the path. The log_path i believe we don't need at all. Instead i just parse the vmaf value from the executed ffmpeg output in a populate variables processor by applying a regex.
Not to mention, the real speedup would be gained by using GPU power, you can just use the cuda version libvmaf_cuda by downloading and use a nonfree version of ffmpeg with "nonfree" components (or build yourself), like from here:
https://github.com/AnimMouse/ffmpeg-autobuild
In this case, you migh not want to replace the internal ffmpeg.exe from ffastrans but just keep your own copy in a separate path and replace the path to ffmpeg in the cmd processor to point to your own ffmpeg version.
Further resources:
In case you want a GUI for selecting and submitting 2 (original and to_compare) files more comfortable, let me know and i will come up with a corresponding example workflow that you can use from webinterface.