ned14
23rd October 2006, 23:23
I have come up with a whacky way of returning a telecined and PALed film back to its original and I was hoping for input. The original 24fps film was telecined into 29.97fps NTSC, then a PAL conversion was done using an *analog* converter (it was a VHS cassette) to PAL DVD. This needless to say yields some annoying video.
In AVISynth after SeparateFields(), you get a 50fps half sized output. Of this, ON AVERAGE 22 frames are film stills, 8 are duplicates of those stills, 16 are interpolated frames between those stills and four frames are interpolated frames where the original stills have been dropped by the PAL-isation. So to yield our 24fps original, we need to throw away the 8 still duplicates, the 16 interpolated frames and blend the other four into two reconstituted stills.
The problem with an analogue conversion is that the pattern of duplicate stills varies over time, as does which still frames have been lost. Therefore using SelectEvery() is out. What we need is some heuristic to detect the unnecessary frames and remove them.
What I thought of I think is pretty novel and no one else seems to have thought of it from a google search. What I have done is as follows:
LoadPlugin("G:\Program Files\DVDtoOgm\Plugins\mpeg2dec3.dll")
LoadPlugin("G:\Program Files\DVDtoOgm\Plugins\Decomb.dll")
mpeg2source("p.d2v", idct=5, iPP=true)
SeparateFields()
Decimate()
# Copyright decl ends at frame 725
src=ConvertToYUY2()
diff=Overlay(trim(src, 724, 0), trim(src, 726,0), opacity=0.5)
orig=Trim(src, 725,1225)
comp=Compare(diff, orig)
StackVertical(orig, comp)
#LanczosResize(640, 480)
The Decimate() removes the still duplicates. For each frame, the script then blends the frame before and the frame after. It then compares the blended frame with the original, and if it's very similar then we know we can drop it.
My current problem is not being familiar enough with AVISynth. I don't know how to compare two frames from within the script, but to the naked eye they do look very similar.
If successful, one should have enough information to reconstitute the original 24fps film. You guys are surely much more familiar with what filters can do than I, so I was hoping for your thoughts on the matter?
Cheers,
Niall
In AVISynth after SeparateFields(), you get a 50fps half sized output. Of this, ON AVERAGE 22 frames are film stills, 8 are duplicates of those stills, 16 are interpolated frames between those stills and four frames are interpolated frames where the original stills have been dropped by the PAL-isation. So to yield our 24fps original, we need to throw away the 8 still duplicates, the 16 interpolated frames and blend the other four into two reconstituted stills.
The problem with an analogue conversion is that the pattern of duplicate stills varies over time, as does which still frames have been lost. Therefore using SelectEvery() is out. What we need is some heuristic to detect the unnecessary frames and remove them.
What I thought of I think is pretty novel and no one else seems to have thought of it from a google search. What I have done is as follows:
LoadPlugin("G:\Program Files\DVDtoOgm\Plugins\mpeg2dec3.dll")
LoadPlugin("G:\Program Files\DVDtoOgm\Plugins\Decomb.dll")
mpeg2source("p.d2v", idct=5, iPP=true)
SeparateFields()
Decimate()
# Copyright decl ends at frame 725
src=ConvertToYUY2()
diff=Overlay(trim(src, 724, 0), trim(src, 726,0), opacity=0.5)
orig=Trim(src, 725,1225)
comp=Compare(diff, orig)
StackVertical(orig, comp)
#LanczosResize(640, 480)
The Decimate() removes the still duplicates. For each frame, the script then blends the frame before and the frame after. It then compares the blended frame with the original, and if it's very similar then we know we can drop it.
My current problem is not being familiar enough with AVISynth. I don't know how to compare two frames from within the script, but to the naked eye they do look very similar.
If successful, one should have enough information to reconstitute the original 24fps film. You guys are surely much more familiar with what filters can do than I, so I was hoping for your thoughts on the matter?
Cheers,
Niall