[FFmpeg-user] Unable to accurately split vmaf calculation

tarun singhal tsinghal18 at gmail.com
Tue Oct 15 13:36:58 EEST 2024


On Tue, 15 Oct 2024 at 00:56, Ferdi Scholten <ferdi at sttc-nlp.nl> wrote:

> 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)
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>

 Yes, I understand entire file will be more accurate.
But even if split at key frames work, there is another problem, it is
possible that source videos and transcoded video key frames done align,
then that means I wont get equivalent segments to compare right?


More information about the ffmpeg-user mailing list