View Full Version : Interlaced picture problem
Matthaeus
14th June 2003, 03:48
Hello!
I have a problem with a 720x576 25 fps PAL interlaced source.
I want to create a half resolution but 50 fps clip form it, so I have separated the even and odd fields with SeparateFields() /I'm using Avisynth 2.52/ to get an 50 fps clip.
Everything is working fine, the only problem is that every other frame (created from the even field) is 1 pixel below the odd frame so the picture is "bouncing" up and down by 1 pixel while playing (not because of confusing bff and tff!). How can I solve this problem. Please, help!
Thanks in advance.
bilu
14th June 2003, 04:09
See if this fits.
http://www.avisynth.org/index.php?page=ReduceBy2
Bilu
Matthaeus
14th June 2003, 04:24
No! I don't want to de-interlace it!
25 fps full resolution interlaced pictures -> 50 fps half vertical resolution pictures (from the even and odd fields)
trbarry
14th June 2003, 05:50
Everything is working fine, the only problem is that every other frame (created from the even field) is 1 pixel below the odd frame so the picture is "bouncing" up and down by 1 pixel while playing (not because of confusing bff and tff!). How can I solve this problem. Please, help!
That's why they call that method of deinterlacing a "bob". It bobs up and down.
But maybe try this:
http://www.avisynth.org/index.php?page=Bob
- Tom
neuron2
14th June 2003, 06:35
Use SmoothDeinterlacer() by Gunnar Thalin and ported to Avisynth by Xesdeeni.
BTW, I have an experimental DGBob() that acts like the above filter but is about 2 times as fast. I hope to release it soon.
neuron2
14th June 2003, 16:56
Originally posted by Bach
Great news! It will be yv12 compatible? The first release is YUY2, but YV12 is in the works. Please see the dedicated thread I am posting now for the first release.
Matthaeus
16th June 2003, 04:22
Deinterlacing = losing picture information
So I don't want to do it. Finally I have found out the solution of my problem:
Let's say our video is top-field-first, fields 1 and 2 are in frame 1 and 2 of 3 are in frame 2 and so on... :
1.frame 2.frame 3.frame
1111111 3333333 5555555
2222222 4444444 6666666
1111111 3333333 5555555
2222222 4444444 6666666
If I remove the even field or blend into the odd field I get a 25 fps movie like this:
1111111 3333333 5555555
1111111 3333333 5555555
BUT you can make an 50 fps movie using DoubleWeave() instead of removing a field or deinterlacing:
1111111 2222222 3333333 4444444
2222222 3333333 4444444 5555555
1111111 2222222 3333333 4444444
2222222 3333333 4444444 5555555
Now all you have to do that remove every other line with for eg. PointResize(width, height/2):
1111111 2222222 3333333 4444444 5555555
1111111 2222222 3333333 4444444 5555555
and voila: you got an 50 fps (progressive) movie, which contains all fields information without(!) deinterlacing. The only drawback is that you get a half vertical resolution movie (720x288, or 720x240), but resizing filters are more reliable than deinterlacer filters, I think. If the 50 fps is too much you can convert it with eg. ConvertFps(37.5)
/37.5 is the average of 25 and 50/
You get a very smooth motion movie this way.
neuron2
16th June 2003, 05:39
Your method does not work. First I'll prove it, then I will explain why.
I took a 700x432 TFF video and ran this:
assumetff() # make sure Avisynth knows
showframenumber()
doubleweave()
pointresize(700,216)
You'll see when you play it and inspect the frame numbers that you are not getting clean frames, half of them are blends! Don't ask me why; it looks like PointResize() isn't doing what it should.
You can instead delete every other line like this:
assumetff
showframenumber
doubleweave
assumefieldbased.separatefields.selecteven # toss odd lines
Now you see that you get frames 0 1 1 2 2 3 3 ... and not what you want. But it is correct. Here's why.
When you doubleweave, you get this (and not as you showed, otherwise the lines of some frames would be in incorrect spatial positions):
1111111 3333333 3333333 5555555
2222222 2222222 4444444 4444444
1111111 3333333 3333333 5555555
2222222 2222222 4444444 4444444
Now if you toss every other line, you get 1 3 3 5 5... as I showed above.
The way to correctly achieve your goal is to separate fields and then shift half the fields into alignment. There are several ways to do it. The Bob() filter is designed to do it.
You are also wrong thinking this is better than smart bobbing (smart deinterlacing). Your way, when you resize to full height, you INVENT half the vertical lines. If you smart bob you invent lines only in moving areas.
Matthaeus
16th June 2003, 06:31
Sorry. I didn't know what exactly DoubleWeave does, but it worked for me. You wrote that if I toss every other line I get 1 3 3 5 5 ...
and when I replaced PointResize to VerticalReduceBy2 or AssumeFieldBased.SeparateFields.SelectEven I got exactly this sequence: 1 3 3 5 5 7 7 ..... so you're right!
But with PointResize every frame is different. (?)
Take a look at this:
http://www.tar.hu/frameset.phtml?path=/matthaeus/backup/video_50fps.zip
neuron2
16th June 2003, 08:49
As I said, PointResize() is not doing what you think it is. I haven't looked at its code, it may just be broken. It's emitting blended frames, which is not what you want, nor what one expects.
Your method is simply not a correct method for bobbing.
Your link is dead.
Matthaeus
17th June 2003, 02:31
@neuron2:
My new experiences:
(after DoubleWeave: )
1 3 3 5 5 7
2 2 4 4 6 6
1 3 3 5 5 7
2 2 4 4 6 6
I want the following sequence:
1 2 3 4 5 6
1 2 3 4 5 6
But if PointResize blends, I get the follwing sequence:
1/2 2/3 3/4 4/5 5/6 6/7 (x/y means blended fields)
1/2 2/3 3/4 4/5 5/6 6/7
This time you were right, too.
@all:
Conclusion:
So my movie contains 50% interpolated frames/fields (between the fields I wanted), instead of correctly shifted fields. That's why I haven't noticed any interlacing or motion-blur artifacts because they are not interframe-blended but interfield-blended (and whole) frames, alhough the picture is a bit blurred (because of blending).
I prefer smoothness (higher fps) to sharpness and I think it's worth. An adaptive sharpen filter and/or resizing to a smaller resolution may help. Using a good bob filter instead of this method will give sharper and more detailed images.
Thanks for all your help!
About the link: try the left mouse button instead of the right. It's working for me :)
oh, and it's about 500k
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.