VideoOnTapes
27th August 2020, 00:28
I have video recordings from VHS where there are large vertical jumps (loss of sync). I no longer own the tapes.
Here a example :
https://i.imgur.com/mYVAz78.jpg
I'm looking for a solution to realign the faulty images. I mean align them correctly based on the previous frames, even if the image is not perfect in other aspects.
To identify the bad frames, I think I could use the PSNR value of each frame.
The Compare() function has allowed me to see that the frames that have a sync loss are those that return a PSNR value < 20.
Is it possible to retrieve the PSNR value in a variable to use it in conditional tests?
In order to reconstruct the frames that are out of sync, I wrote this function :
function reorderImage(clip clip, int yPos) {
return stackvertical(\
crop (clip, 0, yPos, Width(clip), 0),\
crop (clip, 0, 0, Width(clip), yPos)\
)
}
What I'm missing now: how to find the right yPos value automatically for each bad frame ?
I found that F2QCorrelation() (http://www.avisynth.nl/users/vcmohan/FQPlus/F2QCorrelation.html) from the plugin FQPlus (http://avisynth.nl/index.php/FQPlus) can create a file with the following informations :
...
frame 98 x = -1 y = -80
frame 99 x = -1 y = -82
frame 100 x = -1 y = -82
frame 101 x = -1 y = -42
frame 102 x = -2 y = 2
frame 103 x = -2 y = 0
...
Can someone tell me if it's possible to read the y variable of each line with AviSynth from this kind of file, or do I need to convert the file first to an appropriate format ?
If it turns out it's not the right approach, I'm thinking of developing a small web application that would allow me to manually align the frames and save the values to a file that would then be read by AviSynth.
Here a example :
https://i.imgur.com/mYVAz78.jpg
I'm looking for a solution to realign the faulty images. I mean align them correctly based on the previous frames, even if the image is not perfect in other aspects.
To identify the bad frames, I think I could use the PSNR value of each frame.
The Compare() function has allowed me to see that the frames that have a sync loss are those that return a PSNR value < 20.
Is it possible to retrieve the PSNR value in a variable to use it in conditional tests?
In order to reconstruct the frames that are out of sync, I wrote this function :
function reorderImage(clip clip, int yPos) {
return stackvertical(\
crop (clip, 0, yPos, Width(clip), 0),\
crop (clip, 0, 0, Width(clip), yPos)\
)
}
What I'm missing now: how to find the right yPos value automatically for each bad frame ?
I found that F2QCorrelation() (http://www.avisynth.nl/users/vcmohan/FQPlus/F2QCorrelation.html) from the plugin FQPlus (http://avisynth.nl/index.php/FQPlus) can create a file with the following informations :
...
frame 98 x = -1 y = -80
frame 99 x = -1 y = -82
frame 100 x = -1 y = -82
frame 101 x = -1 y = -42
frame 102 x = -2 y = 2
frame 103 x = -2 y = 0
...
Can someone tell me if it's possible to read the y variable of each line with AviSynth from this kind of file, or do I need to convert the file first to an appropriate format ?
If it turns out it's not the right approach, I'm thinking of developing a small web application that would allow me to manually align the frames and save the values to a file that would then be read by AviSynth.