Log in

View Full Version : Restoring 60FPS vertically scrolling credits from interlaced video?


Dwedit
8th October 2020, 08:16
This is an idea I have about how to fix vertically scrolling credits.

This is for cases where a DVD was encoded as 29.97FPS, and has 3:2 pulldown. Video is normally 24FPS, but there are 60FPS scrolling overlays.

Normally, when you encode them, you see horrible weave artifacts.

Field 2+3 Weaved - This is usually what you see after a Telecine filter has finished.
https://i.imgur.com/vcTggZu.jpg


This is an alternative approach where you reconstruct the Credits layer.

First, you need to see how fast the credits layer is moving. For this step, only consider the same kind of field (even/odd), and look for an identical image for the credits layer.

In this case, we find that the credits layer has moved 6 pixels upward after 4 fields have passed.

Field 2 by itself:
https://i.imgur.com/WkGPUPL.jpg

Field 6 by itself:
https://i.imgur.com/n62PmGH.jpg

Take difference between the frames, move it up and down to see when the text becomes darkest (smallest difference), and we find that it has moved 6 pixels after 4 fields.
https://i.imgur.com/ihNo1Ub.jpg

Given that Field 2, 6, 10, 14... has half of the original scanlines, and it is moving at a constant speed, that means that Fields 4, 8, 12, 16... will have the other half of the scanlines.

So if we weave Field 2+4 (Move field 4 downward by 3 pixels), we get this:
https://i.imgur.com/2d0XtEB.jpg

Text now looks perfect, but the picture behind the text looks awful.

So here's a quick and dirty solution, make a simple mask around the text.

Take the difference between Field 2 and 4, you get this:
https://i.imgur.com/pJ58CQ2.png

Go to Gimp, Dilate 6 times, Erode 4 times, here's a mask:
https://i.imgur.com/mypdhmY.png

Now put the Clean Text over the original frame, and we get this:
https://i.imgur.com/zdsw4qm.jpg

Not perfect, as there are combing artifacts around the text, but it looks much much better than what you'd get by other means.


Now I'm wondering if anyone has ever made a script or plugin before that would do something like this, then how would I go about making a script or plugin to do this?

The critical steps:
* Identify that a scrolling layer exists
- - This can be seen when looking at the fields. Normally there's a period where 3 fields are repeated, then 2 fields are repeated. So look for the motion in the fields that are supposed to match.
* Identify the speed of the scrolling layer
- - In this example, it was 6 pixels over 4 fields.
* Take the missing scanlines from another field that has the other half.
- - Does not necessarily need to be the same even/odd as the first field.
* Make a mask for the text
- - Right now, I'm just comparing two frames to see what moves, then making a crude mask from there
* Paste the restored text over a detelecined frame.

johnmeyer
8th October 2020, 15:39
Wow, that is pretty impressive.

I dealt with this when trying to get good results with the crude title generator in what was Sony Vegas Pro. I wrote a really long post about it here:

Credit Roll (Title Scroll): Getting it to Work (https://www.vegascreativesoftware.info/us/forum/credit-roll-title-scroll-getting-it-to-work--87552/)

I got it to work and have used (many times) the techniques I created in that thread. You may skim the thread and see if any of my ideas can help you keep the text moving at the rate needed to put each letter at the same relative position on each scan line as it moves up the screen.

I know AVISynth pretty well, but have never mastered the masking techniques. Fortunately there are people here who have all sorts of tricks for making masks. Hopefully they can help you with that part of the project.

Katie Boundary
14th October 2020, 21:32
Have you tried ordinary bob-deinterlacing?

Dwedit
15th October 2020, 01:07
Ordinary Bob deinterlacing would look just like the Field Only screenshots I posted in there, just with vertical blurring instead of repeated scanlines.

wonkey_monkey
15th October 2020, 01:11
Ordinary Bob deinterlacing would look just like the Field Only screenshots I posted in there, just with vertical blurring instead of repeated scanlines.

This is Katie Boundary's way - suggesting the most inappropriate solution even when a much better one has already been demonstrated.

Katie Boundary
15th October 2020, 23:44
Ordinary Bob deinterlacing would look just like the Field Only screenshots I posted in there, just with vertical blurring instead of repeated scanlines.

Bobbing doesn't normally cause blurring unless you're using a very simple/primitive approach.

wonkey_monkey
16th October 2020, 00:10
Bobbing doesn't normally cause blurring unless you're using a very simple/primitive approach.

Then perhaps you should explain what you mean by "bob-deinterlacing" because it clearly isn't what everyone else thinks it means.