Video-to-video
April 12, 2020 ยท View on GitHub
Algo

The algorithm is composed of 2 steps:
- search for the time shift that gives the PSNR peak:
- select the frame/field in middle of the
referencevideo sequence - search for the frame/field in
mainwhich resembles the most toreferenceframe, i.e. giving the maximum PSNR value - calculate the
index deltabetween thereferenceandmainframes/fields and derive delays
- select the frame/field in middle of the
- refine the peak value
- previous PSNR calculation based on one-to-one frame comparison isn't accurate enough and needs to be refined by extending the calculation to video sequences
- discard 1st and last frames/fields in both streams because they're probably incomplete
- keep the common portion of content shared by the 2 streams, derived from
index delta - recalculate the PSNR over these 2 stripped sequences
- replace the peak value in PSNR graph (hackish)
Results in the UI
| Parameter | Explanation |
|---|---|
| Maximum of PSNR | the maximum of the PSNR between the ref frame/field and every frame/field of the main sequence |
| Actual delay | the difference between the capture timestamps of the ref frame/field and the most similar main frame/field |
| Media delay | actual delay converted in media units |
| RTP delay | the difference between the RTP timestamps of the ref frame/field and the most similar main frame/field |
Notes
- positive values means
mainis later thanreference - ffmpeg returns
infvalue for perfectly equal images. This is associated to value100in graphes - if video is interlace, then PSNR operation is performed on fields
- the scan type of both
mainandreferencestream must be the same type
Limitations
- decoded frames/fields are .PNG files so pixels are 8-bit per color channel instead of the initial 10-bit