View Full Version : Reinterlacing deinterlaced video
ajordan
27th May 2004, 03:54
Hi! I am trying to reinterlace video that has been deinterlaced, so I can transfer it to a VHS tape. I wrote this script:
AVISource("movie.avi")
AssumeFrameBased
a = SeparateFields
af1 = a.SelectOdd.Trim(1,0)
af2 = a.SelectEven
Interleave(af1,af2)
Weave
It looks good on the PC, but there has to be something fundamentally wrong with it because my dv camcorder doesn't like it and goes blue after about 5 seconds of recording this signal. I can record other dv signals without a problem...
More detail in this page (http://www.geocities.com/alex_j_jordan).
Any help will be very much appreciated!
minolta
27th May 2004, 06:54
I think your trying to reinterlace a 30p to 60i. But once you go from 60i to 30p, there is no going back. Looking at your clean script from your site I see:
AVISource("movie.avi")
ConvertToYV12(interlaced=true)
TomsMoComp(0,5,1)
deen("c3d",ti=4)
aWarpSharp(8.0, 1)
This produces 30 progrossive. To reinterlace you should first deinterlace to 60p instead of 30p. Deinterlacers such as Bob(), DGBob(), KernelBob() do this. For example, your scripts might appear as (if TFF):
AVISource("movie.avi").AssumeTFF()
ConvertToYUY2(interlaced=true)
# Convert to 60p; credits to scharfis_brain
KernelBob()
deen("c3d",ti=4)
aWarpSharp(8.0, 1)
# Back to 60i; easier to use SelectEvery(), but...
AVISource("movie2.avi").AssumeTFF()
tf=SelectEven().AssumeTFF().SeparateFields().SelectEven()
bf=SelectOdd().SeparateFields().AssumeTFF().SelectOdd()
Interleave(tf, bf).Weave()
When converting to 60p you might loose vertical resolution (although KernelBob is quite good).
I don't know why your DV turns blue, but I'm guessing interlaced vs. non-interlaced has nothing to do with it (I could be wrong :confused: ). Your DV should record a 'progressive' image just as well as interlaced. I don't think it cares if the fields are similar.
-Minolta
ajordan
27th May 2004, 19:39
Minolta, you are right, I am trying to get 60i from 30p. I will try your approach in the future (although I'd hate to part with TomsMoComp, it does an incredible job), but what do I do with all the 30p video I have?
I guess I need to create the missing field by somehow interpolating or morphing between adjacent frames. There are filters that do this in order to double the frame rate, if I'm not mistaken...
minolta
27th May 2004, 21:42
30p doesn't look too terible on tv (i.e. VCD is 30p), but it is a loss from the original 60i. I wouldn't bother converting back (even more lossy) if you don't have to...
Sorry, I'm still not understanding why your DV won't record based upon interlaced vs. progressive. How do you output the video back to your DV (s-video, component, firewire)? When and how does it usually work?
-Minolta
ajordan
27th May 2004, 22:22
When looked from close it does look terrible in my TV set. I see black horizontal lines whenever something moves, and some dancing pixels on vertical edges...
Regarding the camcorder blues, I have no clue as to what is wrong. I'm printing to tape in Premiere through firewire, and I've done it several times without a problem, besides the occasional dropped frames caused by unknown processes kidnapping my hard disk, which I prevent by killing all apps (firewall, antivirus, explorer, etc) and stopping all non-essential services.
I am theorizing it could be Premiere itself, not sending the video signal to the camcorder... It also happens when I scrub the timeline in Premiere, and only with this "reinterlaced" video. I'll do more tests and post the results.
ajordan
28th May 2004, 22:17
I've been searching for frame rate doublers, and found several: DGbob, FrameDbl and MotionPerfect, although I only experimented with FrameDbl so far (Tom: I'm impressed!) and they seem perfect for my purposes. They synthesize the missing frame, so I can take the second field from that intermediate frame instead of the next frame (which in any case was the wrong choice). I will test it tonight and post the results.
I have also been working on the other problem I talk about in my site (saturated color bleeding). As soon as I have something coherent to show I'll open a separate thread.
[Edit] I've tested the frame rate doublers, and came to the conclusion that the best for my needs is Tom's FrameDbl. DGBob simply separates both fields (which I'm wanting to reconstruct), MotionPerfect does an astonishing job but has artifacts and is commercial.
[Edit2] After using the script below, I got a better looking result, but I am still unable to print it to the dv-tape. I tried other avi files and they work ok. I even tried rendering the "reinterlaced" movie with Premiere and reopening it again, and it still blue-screens the camcorder... I'm out of ideas...
LoadPlugin("FrameDbl.dll")
AVISource("movie.avi")
ConvertToYV12
FrameDbl(255,3)
SeparateFields
SelectEvery(4,0,3)
Weave
ajordan
30th May 2004, 04:42
Ok. I solved the blue-screen problem by opening the avs file directly in premiere instead of using virtualDUB to save an intermediate avi file. Don't know why it only works this way, but it does.
Now to the tests. I hooked the camcorder to the TV set and compared the original fottage (as filmed, true 60i, no passage through the PC) with the 30p material and with the "60i-ish" produced by the script above.
They are all exactly the same quality. No difference I can tell. They are all equaly awful when looked from close, and acceptable when I step back a bit. I switched to broadcast TV (cable) and the quality (resolution, cleannes) is way better, both verticaly and horizontaly.
I have a theory and a question. The theory is that the quality difference comes from two sources: low-end consumer JVC camcorder, and NTSC (compared with PAL-N broadcast).
The question is: shouldn't there be a difference between the original 60i and the 30p material?
(Sorry if I've been mumbling to myself in this thread lately... :D)
minolta
31st May 2004, 03:35
> The question is: shouldn't there be a difference between the original 60i and the 30p material?
Viewed on tv, the only subtle difference should be that motion in 60i appears more smooth. Even then, you won't notice until watching sports or something with panning motion.
So your thought is that 30p should be perceived as having better vertical resolution? Well, in slow moving scenes 30p and 60i become nearly equal, and in fast moving scenes 60i looks smoother. So the only thing to gain is the smoother motion of 60i. I can't say that resolution ever improves by deinterlacing to 30p (as viewed on tv, anyway).
In general, people deinterlace to 30p because:
1) their capture is low-motion anyway
2) better compress-ability to low bitrates
3) not necessary to deinterlace during playback (for pc monitor)
So, to retain original quality then leave interlaced.
-Minolta
ajordan
31st May 2004, 10:09
I didn't mean to imply that 60i should have better vertical resolution than 30p. But I thougth the black horizontal lines on moving parts were a product of 30p. Anyway, thanks for your help! :cool:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.