Log in

View Full Version : Restoring interlaced half framerate?


redfordxx
14th January 2012, 22:29
The following issue must be definitely solved and script existing, but I was not successful with search:

How to convert interlaced video 30fps into progressive? The problem is it was probably originally 60fps and the fields do not fit to the same timestamp.

So probably some motion compensation combined with field interpolation should be involved but I tried MCompensate+eedi in a basic way and it looked ugly.

Can anyone point the right direction?

Guest
14th January 2012, 22:54
Can anyone point the right direction? Yes. Post a link to an unprocessed source sample with lots of motion.

redfordxx
16th January 2012, 19:18
Well, I am always thankful for the time anyone else is spending helping. And I am trying to minimize this time.
When I was developing the plugins, I was aware there was lot of time of other people involved. However this time ti is not necessary. Pointing me to right thread or script is sufficient. Or are you saying that this problem was never solved yet???

By the way, the motion is one thing, other is that there are lot of flashlights and the result is that one field's background is black and one is white on the same frame :D

Dogway
16th January 2012, 19:35
If you post a sample we could help. I am fixing these kind of issues for the last 2 months and sometimes it is not always the same. Check my thread (http://forum.doom9.org/showthread.php?t=163375) if it is of any help

librarian
16th January 2012, 19:43
Without a sample is a bit difficult understating your problem. Perhaps this (http://forum.doom9.org/showthread.php?p=1520462#post1520462) may help.

redfordxx
16th January 2012, 23:07
Thanks, I'll go thru the threads and try to figure it out. If I am not successful, I'll post a sample to analyze.

One more thing, I saw there an idea how to explain the interalcing, so:

If this would be the progressive clip I want to finally achieve:
ab cd ef gh ij kl

then my source is:
ad eh il

-Vit-
17th January 2012, 00:25
What you're describing just sounds like ordinary interlaced material, unless there's some detail you've not mentioned.
So just use a deinterlacer/bobber like QTGMC (http://forum.doom9.org/showthread.php?t=156028), or any other deinterlacer (http://avisynth.org/mediawiki/External_filters#Deinterlacing)

[Edit] Well, the next posts seem to think there's more going on... 120fps fields?! *Shrug*

Asmodian
17th January 2012, 00:57
Thanks, I'll go thru the threads and try to figure it out. If I am not successful, I'll post a sample to analyze.

One more thing, I saw there an idea how to explain the interalcing, so:

If this would be the progressive clip I want to finally achieve:
ab cd ef gh ij kl

then my source is:
ad eh il

This seems like a very odd source.

Given this original 60i source (letters are fields):
a b c d e f g h

A simple weave gives: 30p ab cd ef gh
but with combing artifacts because a and b are from different times.

A standard deinterlace to 30p would give aa' cc' ee' gg' with lots of ways to generate the a', c', e', g' either using information from b, d, f, h and interpolation from a, c, e, g or from interpolation alone.

Is your source really 30i with half the fields dropped? It is also the top of one frame with the bottom of the next? If so I don't think there is a way to interpolate the other fields that is better than separatefields() followed by nnedi3_rpow2(). This video would bob up and down (switching from top to bottom field) so you would need to deal with that too.

Dogway
17th January 2012, 01:14
From the help I recently received from Didée and cretindesalpes I figured out how to fix these even without knowing in real what happened to the source. I don't know if there's a better way but this is how I fix them.

source
ad eh il (interlaced)
nnedi3(field=-2)
a d e h i l (frames)
MFlowFps x2
a x x d x x e x x h (double interpolated frames)
. . . . . . . .
selectevery(6,0,1,2,3)
a b c d e f g (frames)
separatefields()
b b c c
a a x x x x d d e e
. . . .
SelectEvery(4,0,3)
a b c d e f g (fields)
weave
bob

Asmodian
17th January 2012, 02:05
That looks much better than mine, nice! I never think of MFlowFps(), does this work well?

That replaces my idea's output of 30p aa' dd' ee' hh' with interpolated fields to give a 60p aa' bb' cc' dd' ee' ff' gg' to fix the bobbing and the judder from dropping two fields in a row. :D

Why end with bob() and not a nnedi3(field=-1) for 30p output?

Edit: Dropping half of the real fields does hurt I assume? Maybe nnedi3(field=-2) for 60p?

redfordxx
17th January 2012, 06:33
First, I am not sure if we understand each other about the nature of the source, so here I put how it was created:fps30i=fps60p.SeparateFields.SelectEvery(4,0,3).Weave
and in my previous post I mean ab is one progressive frame. So maybe I put it wrong and it should be written aa... I don't know, what is the standard notation.

Then, I am not very clear what do you mean with MFlowFPS x2 and a x x d. Is this that these x are additional moments between a and d? Because that shouldn't...

If we start frame counting from 0, basically c (top field of frame 1) should be spatially interpolated from d and temporally interpolated from a and e. But how to balance these two...

poisondeathray
17th January 2012, 07:06
First, I am not sure if we understand each other about the nature of the source, so here I put how it was created:fps30i=fps60p.SeparateFields.SelectEvery(4,0,3).Weave



That sounds a lot like standard interlace


The problem is it was probably originally 60fps and the fields do not fit to the same timestamp.


If every consec. field is unique moment in time , then it really sounds like interlace


So use a deinterlacer, or bobber and drop half the frames

eg.

QTGMC(preset="faster")
SelectEven

redfordxx
17th January 2012, 14:21
That sounds a lot like standard interlace
Sorry for misunderstanding, I thought that standard interlace is when there are no missing fields, only the fields are shifted to next frame ... like
fps30i=fps30p.SeparateFields.trim(1,0).Weave

-Vit-
17th January 2012, 14:54
Good, I thought I was going mad there with those surreal answers to your question. Field shifting does occur of course, but we wouldn't need such complex deinterlacing scripts to deal with that. You were correct to suggest that there are many existing scripts for this, see my post above. QTGMC is where to start unless your computer is very slow.

Dogway's script deals with interlaced where the timestamps are not evenly distributed, with 3/120s between the first two fields, then 1/120s between the next two, and repeat. Very unusual, giving uneven movement. The output of that script would be 120fps and would need decimating. There's no suggestion that it applies to your source.

Asmodian seems to have been confused by your description of the source.

redfordxx
17th January 2012, 16:28
Well I looked into the QTGMC script and... it is really long;-) But I guess there is something like the idea I had:
1) needi interpolation of frames
2) motion estimation
3) motion compensation from both directions
4) replacing the fields on each frame with the originals when available
5) some kind spatial correction, denoising or decombing
6) goto 2 ;-)

Didée
17th January 2012, 16:43
Six years & 780 posts, and you never dealt with interlaced video?

redfordxx
17th January 2012, 18:18
Well lot of it was sleeping years;-) 780 posts, hm, where it did come from... I think lot of deblocking development, DCTFilter development and other development;-)

My interlaced experience was mainly IVTC and thats all.
Well and then some weird sources, I gave up...for example source which ceased to look combed only after three times SeparateFields (but now I am thinking that maybe it was something Dogway mentioned).
And then there were few music video clips, which were the craziest thing ever, since the type of clip changed several times during it. :D

Asmodian
18th January 2012, 00:15
Asmodian seems to have been confused by your description of the source.

Very true :confused: