View Single Post
Old 25th November 2020, 21:20   #5  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Is the "stray frame" an inserted frame (framecount not same as source, possible sync issues), or replaced frame (framecount is the same) ?

Is dynamic link the problem ? Did you try encoding, then authoring ? Or does a "physically" exported file have the same issue ? I've done probably 100's of BD's using EncoreCS6 in the past, never an issue with an exported file method


What is the DCP package generated from ?

Some options

1) ffmpeg psnr . Test DCP MXF as "source" against BD M2TS. Generate per frame metrics. This assumes your DCP is ok. One issue is DCP is 12bit 444 xyz, and BD is 8bit 420 YUV AVC/MPEG2/VC1 . So instead of getting "infinity" for matched frames, you have to look for large dips in dB

1b) msu vqmt; the free version I think only supports 720p but that's more than enough for a "stray" frame detection. The nice thing about this is the visualization features and it plots your graphs, so it's easy to see which frames are mismatched. It accepts avs script input - you can use avisynth scripts to downcovert both MXF to match the BD version in bitdepth, colorspace, chroma subsampling, and to satisfy the 720p limit on the free version

2) avisynth writefileif . It will print out frame numbers in a text file that are detected according to criteria you set.

Write an expression that logs frames that have some difference from previous n-1 and next n+1 ( or more if you want n-2, n+2, or some average, but you probably don't want that if it's a single frame replacement) . You have to tweak the detection threshold values, because something like a strobe light scene, or explosion will have a very different next frame . You want something that does not generate too many false positives, but you'd want to err on the side of caution and have more false detections than to miss a real "stray" frame. ie. you'd prefer it more sensitive

It would look something like this for looking at the difference between the Y plane for n-1, n+1 . An replaced random frame from another scene should be higher for both n-1, n+1 . (You can add some fancy averaging of multiple frames, or some other logic operators if required). This example has both n-1, n+1 >20 (You might have to set it higher or lower, it's just an arbitrary number for discussion)

Code:
LWLibavVideoSource("BD.m2ts")
WriteFileIf (last,  "writefile.log",  "YDifferenceFromPrevious > 20  &&  YDifferenceToNext > 20", "current_frame", """ ":" """, "YDifferenceFromPrevious", """ ":" """, "YDifferenceToNext")

Last edited by poisondeathray; 25th November 2020 at 21:30.
poisondeathray is offline   Reply With Quote