View Single Post
Old 26th November 2020, 04:37   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
I took a YT trailer, No Time To Die, and swapped up 2 frames for a test (frame 775 is 372 and frame 2314 is 368, just so you know), re-encoded it (not BD settings, just generic AVC, but it shouldn't matter)

Code:
a = LSmashVideoSource("NO TIME TO DIE - Trailer 2.mp4")
b = LSmashVideoSource("remap.mp4")

a
WriteFileIf (last,  "log.log",  "LumaDifference(a,b)>10", "current_frame", """ ":" """, "LumaDifference(a,b)")
LumaDifference(a,b)>0 would print if there are any difference, but every frame does and should have a difference because it's a lossy re-encode. This is the fulllog.log where >0 is set just to see what types of values you get for calibration purposes

Just eyeballing it, on average each frame differences were <1 . Frame 775 was 33.890984, frame 2314 was 35.824036, so the delta is large. Some "same" frames were as high as 1.something. So if you set LumaDifference >10 or something it should be accurate

The log is correct and printed the two correct frames. This is log.log

Code:
775:33.890984
2314:35.824036

It's fairly fast, this 2min 34sec clip took ~12 seconds, with CPU decoding of both clips on an older computer

To run an avs script, you can use avsmeter64 script.avs, or use a GUI like vdub file=> run video analysis pass

I included the video files, script , both logs in a zip if you want to play with it
http://www.mediafire.com/file/eayon5..._test.zip/file

BTW avisynth starts frame numbering at zero, but ffmpeg psnr starts at "one"

This method , like PSNR, or any other clip to clip comparison assumes your "source" file is accurate

To load a m2ts, you could use lsmash too, but using LWLibavVideoSource
Code:
LWLibavVideoSource("00000.m2ts")

Last edited by poisondeathray; 26th November 2020 at 04:46.
poisondeathray is offline   Reply With Quote