[FFmpeg-user] Unable to accurately split vmaf calculation
Ferdi Scholten
ferdi at sttc-nlp.nl
Mon Oct 14 22:26:36 EEST 2024
Hi,
> I am trying to split vmaf calculation work across multiple threads by
> logically dividing the video ( not literally )
>
> I tried following 2 commands to do vmaf on a 20.08 sec ( 477 frames ) video
>
> *For 1st 10 second: *
>
> *ffmpeg -i transcodedA.mp4 -i sourceA.mxf -filter_complex
> "[0:v][1:v]scale2ref=flags=bicubic[encoded][source];[source]format=pix_fmts=yuv420p,trim=start=0,trim=end=10,setpts=PTS-STARTPTS[source2];[encoded]trim=start=0,trim=end=10,setpts=PTS-STARTPTS[encoded1];[encoded1][source2]libvmaf=feature='name=psnr|name=float_ssim|name=float_ms_ssim':n_threads=4:log_fmt=json:log_path=A0-10.json"
> -f null -*
>
>
> *For remaining part of video:*
>
> *ffmpeg -i transcodedA.mp4 -i sourceA.mxf -filter_complex
> "[0:v][1:v]scale2ref=flags=bicubic[encoded][source];[source]format=pix_fmts=yuv420p,trim=start=10,setpts=PTS-STARTPTS[source2];[encoded]trim=start=10,setpts=PTS-STARTPTS[encoded1];[encoded1][source2]libvmaf=feature='name=psnr|name=float_ssim|name=float_ms_ssim':n_threads=4:log_fmt=json:log_path=A10-20.json"
> -f null -*
>
> But in both output files, collectively I get only 465 frames, that means 13
> frames missing. What can I do that ensure no frame is missed?
>
>
>
> Regards,
> Tarun Singhal
> _______________________________________________
>
Most likely the split is not at a keyframe.
This does not matter for the first part, but it does for the second
part, that has to start on a keyframe. You will be missing all the
frames from the 10s where the first vide ends, to the first keyframe
after the 10 seconds which is where the second video starts.
So only split at keyframes, or just process the entire file without
spitting (will be more accurate too)
More information about the ffmpeg-user
mailing list