PDA

View Full Version : Converting interlaced PAL to NTSC


neuron2
6th January 2009, 19:15
Recently I had the need to convert some interlaced PAL video to NTSC, i.e., convert the frame rate from 25 to 29.97. Initially I thought to deinterlace it and then apply DGPulldown's 25->29.97 conversion. But that throws away 1/2 the temporal resolution of the video and I didn't want to do that for this sports action material. So I got to thinking about the possibility of doing field pulldown directly on the interlaced content. I came up with a technique that seems to work quite well. I don't know if this is something already well-known, but thought I'd share it as well as ask if it is already known and used.

The basic idea is to repeat fields as needed. If we have:

a c e g
b d f h

And we need to repeat fields a and e, then we can have:

a b' d' e g
a' c' e' f h

where the ' indicates the field is interpolated from an existing field, e.g., you have the top field but need to use the interpolated bottom field from the same picture (temporal moment).

I came up with a simple script to implement this. Note that sbdeint() can be replaced with the high-quality bobber of your choice.

avcsource("file.dga") # 25fps interlaced
sbdeint() # 50fps progressive
# resize to NTSC here if needed
changefps(59.94) # 59.94fps progressive with frame dups
separatefields() # Convert back to interlaced 29.97fps
selectevery(4,0,3)
weave()

I think the quality will depend on how good your bobber is.

scharfis_brain
6th January 2009, 19:30
Yeah that is the basic idea behind field-blending standards conversions.
Besides that you'll have to resize the video before or after convertfps().
(convertfps() won't do dups. it will do blends)

Better fluidity of motion (as well as compression!) can be achieved by replacing fliedblending (converfps())
by a motion compensated framerate interpolation like mvtools' mvflowfps().

Thus the best approach might be atm:

avcsource("file.dga") # 25fps interlaced PAL

tempgaussmc() # motion compensated bob-deinterlacing to 50fps

bicubicresize(width, 480) #resize to NTSC height

source=last
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
source.MVFlowFps(backward_vec, forward_vec, num=60000, den=1001, ml=100, idx=1) # get 59.94 = 60000/1001 fps

separatefields().selectevery(4,0,3).weave() # reinterlace back to interlaced 29.97fps

neuron2
6th January 2009, 19:34
Ah, but I don't want blends, so I change to ChangeFPS().

I found this old post of Xesdeeni that has a similar solution:

http://forum.videohelp.com/topic90816.html

scharfis_brain
6th January 2009, 19:38
why do you prefer a jerky video?

neuron2
6th January 2009, 19:47
I'm from an NTSC country. We're used to pulldown judder. :)

Why do you prefer filters that run at 1-2fps?

scharfis_brain
6th January 2009, 20:10
I'm from an NTSC country. We're used to pulldown judder. :)
That might be an explantation.
I cannot stand telecine judder. Luckily I got a DVD-Player that can translate soft telecined NTSC Film DVDs to a 2:2:2:2:2:2:2:2:2:2:2:3 - Pattern (two small hickups per second) with PAL-output.
I prefer this over the constant 12 Hz judder of NTSC.

If you use mvflowfps with a reasonable fast bobber, eg. yadif(mode=1) then you'll get at least half realtime processing. So this isn't as slow as you might think.

Things are starting to become slow if you introduce tempgaussmc(), which is like a swiss army knife:
- bob-deinterlace
- suppress stairstepping
- suppress bobbing/flicker
- reduce noise

Why do you prefer filters that run at 1-2fps?
cause they offer pretty good visual quality.

neuron2
6th January 2009, 22:03
Don't get me wrong, I'm not dissing your advice, for which thank you. I just want to expose this as a relatively decent and fast solution for interlaced PAL to NTSC. If normal pulldown can be lived with, and as I said, we NTSC people get used to it very early, then this slight variation on it can be lived with too.

I'll experiment with your suggestions to see if I can tolerate the conversion times.

EuropeanMan
22nd January 2009, 22:53
Yeah that is the basic idea behind field-blending standards conversions.
Besides that you'll have to resize the video before or after convertfps().
(convertfps() won't do dups. it will do blends)

Better fluidity of motion (as well as compression!) can be achieved by replacing fliedblending (converfps())
by a motion compensated framerate interpolation like mvtools' mvflowfps().

Thus the best approach might be atm:

avcsource("file.dga") # 25fps interlaced PAL

tempgaussmc() # motion compensated bob-deinterlacing to 50fps

bicubicresize(width, 480) #resize to NTSC height

source=last
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
source.MVFlowFps(backward_vec, forward_vec, num=60000, den=1001, ml=100, idx=1) # get 59.94 = 60000/1001 fps

separatefields().selectevery(4,0,3).weave() # reinterlace back to interlaced 29.97fps

Scharfis,

I've had a few PAL DVD9s that I convert to NTSC DVD9s...and I've usually gone the way iirc yadif mode3 & vinverse to take care of the interlacing lines...and of course after all is said & done, I'm at 25fps...I get my mpv and use the DGPulldown to 29.970.

With your script here versus the one by neuron versus mine...which, in YOUR opinion, is a better method - speed of processing NOT relevant?

Neuron mentioned that half of the temporal resolution is lost...I'm confused on this. What does that mean exactly?

Thanks in advance.

scharfis_brain
23rd January 2009, 00:12
Neuron mentioned that half of the temporal resolution is lost...I'm confused on this. What does that mean exactly?
This means you'll loose smoothness of motion.
Or - in other words - you'll introduce motion judder.

neuron2
23rd January 2009, 00:16
With your script here versus the one by neuron versus mine...which, in YOUR opinion, is a better method - speed of processing NOT relevant? You must have missed the bit where he said:

"Thus the best approach might be atm:"

Hard to believe since you quoted it in your own post. :)

EuropeanMan
23rd January 2009, 05:44
I miss alot of things :) Thanks guys for helping...appreciate it very much.

by the way, any idea the speed of scharfis' small script?

I'm running a core2duo t5550, 3gbram...

IF it's a crawl around 1-2fps...I'll have to forget it LOL...no offence...as bollywood films reach towards the 3hour mark. Unfortunately though Bodega of France & Rapid Eye Movies of Germany make some excellent DVD9s, as opposed to ones from the Bollywood studios. And alas, I live in the US of A...NTSC country...

scharfis_brain
23rd January 2009, 07:45
yes it will be that slow.
but you might replace tempgaussmc() with yadifmod(mode=1, edeint=nnedi(field=-2)) this should give you like 10 fps.


before you start converting MOVIES, you should inform youself about telecine.
movies usually aren't pure interlace footage. they usually are telecined.
movies have to be converted with other techniques.

the script above only works for pure interlaced stuff like from a DV-Camcorder or sports events/news

manono
23rd January 2009, 08:46
before you start converting MOVIES, you should inform youself about telecine.
movies usually aren't pure interlace footage. they usually are telecined.
I suspect EuropeanMan is referring to interlaced extras, shot on video. He already knows how to convert the movies (although I admit that what he wrote seems a bit peculiar). During those rare times that I have occassion to convert PAL material to NTSC, if there's any interlaced material to convert I use the Bob/Resize/ChangeFPS/Reinterlace method as outlined by neuron2. Looks fine and plays smoothly (to us NTSCers).