Log in

View Full Version : I'm curious about interlaced NTSC->PAL conversion


trbarry
11th August 2003, 21:32
I live in NTSC land so I've not had to deal much with 50 Hz. PAL interlaced clips. But I hear bad things about frame rate conversions and blended fields.

What happens instead if you just take an interlaced (video not telecined) clip and:

1) Deinterlace it to 60 progressive frames / second, say with TomsMoComp(-1,5,1), or other.

2) Adust the frame rate to 60 from 59.94 (ChangeFPS?).

3) Decimate it to 50 fps (Decimate(cycle=6).

4) Re-interlace to 50 fields / second.

This would still have some judder but it should be no worse than the 3:2 pulldown we experience with telecined NTSC movies. And it doesn't seem it would be as objectionable as the blended fields.

The reason for deinterlacing first and then re-interlacing is so we can effectively decimate fields instead of frames, making it hopefully a bit less obvious. That is, the effective presentation time of any field should never be off by more than 1/100 of a second if done right.

Has anyone in PAL land tried doing the conversion this way?



- Tom

hakko504
11th August 2003, 22:34
Tried it a while ago, and it works reasonably well. You have mixed up 60 and 59.94 fps though. The original NTSC video is 59.94fps and should be changed to 60fps or the Decimate(6) will produce strange fps.
mpeg2source(ntsc.d2v)
TomsMoComp(-1,5,1)
BicubicResize(last.width,last.height*288/240)
Assumefps(60,true) #adding 'true' will keep the audio in synch
Decimate(cycle=6)
Separatefields()
Selectevery(4,0,3)
weave()

trbarry
12th August 2003, 01:07
hakko504 -

I already did say "to 60 from 59.94" though I guess maybe I phrased it sort of backward. But you may well be right about using AssumeFPS instead of ChangeFPS. With ChangeFPS I was thinking it would occasionally add an additional duplicate frame which would probably be the one removed later by Decimate anyway. But maybe I didn't think that part through well.

So how does it compare to blending frame rate conversion when viewed on a 50 Hz interlaced display? Did you try it that way? I don't have one to try it.

- Tom

trbarry
12th August 2003, 01:21
Also, normal TomsMoComp does not make 60 fps, just 30. It needs that special script for 60, like (for top first clips):


# This script is only for TopFirst material, make 60 FPS
Mpeg2Source("D:\VCR\Its_All_Here.d2v")
Top=AssumeFrameBased().ComplementParity()
Bottom=Top.SeparateFields.Trim(1,0).weave
Interleave(Top.TomsMoComp(1,5,1),Bottom.TomsMoComp(0,5,1))


instead of TomsMoComp, and then followed by the other stuff above to make PAL 50i.

- Tom

hakko504
12th August 2003, 07:25
Actually when I tried it I used a 'GreedyBob' function, where I deinterlace twice with a=last.GreedyHMA(1,0,0,0,0,0,0,0) and b=last.GreedyHMA(0,0,0,0,0,0,0,0) and then interleaved the results. I did say it was a while ago. ;)

And when you watch the results on a PAL TV it is obvious that the 50field video is much sharper and more detailed than the quick and dirty blends that are way too common in PAL DVD's (esp anime). I saw on a few occasions a tendency to jerky movement, but that could very well be my computer that couldn't handle the large video at 50 fields/s. I haven't tried it with MPEG-2 as resulting video, only DivX, and DivX needs more computer power to make things go smoothly.

And yes I read 60 to 59.94. My mistake.

ppera2
12th August 2003, 11:43
There's a thread about it: http://forum.doom9.org/showthread.php?s=&threadid=40450&highlight=framerate+conversion .

Smooth deinterlace 'duplicates' framerate very well. It is about getting progressive, not interlaced result, but framerate conversion itself is same. I personally like more blending instead simple framedrops, but it probably depends from material too.

I think that there is no need for separate step to change fps to round 60. It makes only problems with audio sync. Bad side is that then we can't use decimate. But simple ChangeFps(50) or ConvertFps(50) will give practically same result. It will drop 9 instead 10 field-frames sometimes (aprox. at every 1000 frame?), what is only theoretically bad - practically it's invisible in all framedrop stuff.

hakko504
12th August 2003, 11:58
IIRC assumefps(new_frame_rate,true) first sets the new sample rate to old_sample_rate*old_frame_rate/new_frame_rate and then resamples it back to old_sample_rate. I'm quite sure though that BeSweet will do a much better job of stretching the audio than avisynth. And of course it is possible to use ChangeFPS with the right parameters so it only duplicates 1 frame in 1000 (or is it 999?). It is a fact though that if you target a bitrate limited environment (i.e. isn't using DivX/viD with fixed quantizer) you don't want to have more frames than necessary, as every frame will be assigned fewer bits equalling lower quality. And since it's hard enough anyway to do interlaced video, why make it harder by increasing the framecount?

ppera2
12th August 2003, 14:55
hakko504:

I really don'r understand your logic. Why is better to have one duplicated frame instead one less dropped? Why is better to perform 2 steps instead one?
For encoding quality 1 promile more frame means nothing (or you will get file longer for 300 KB - big deal for my Nero 'overburner' :D )

trbarry
12th August 2003, 15:22
I was just reading the newer Avisynth manual and it seems ChangeFPS may operate differently than it used to before Avisynth 2.05. It's unclear from the manual whether it now blends a field every 1000 frames, but I don't think so. I'll have to play with it a bit since I'd rather it didn't.

But I still lean towards:

ChangeFPS(60).Decimate(cycle=6)

used on 59.94 FPS progressive frames. I think this should add an extra frame every 1000 or so and then decimate so there are 50 FPS. And it should do it in a way that does not need any audio adjustment so I could still later just mux in my ac3 like I usually do. I don't like playing with the audio at all when I don't have to.

And no more frames should be created this way. Decimate should choose the most duplicate-like frame out of every 6 to drop and that usually should be the one added by ChangeFPS. After re-interlacing the clip should be the same time length and have 50 fields / second.

But I still have not made functions to do or test any of this. I probably won't be able to do that for awhile as I'm preparing to move now.

- Tom

ppera2
12th August 2003, 16:04
ChangeFps in earlier Avisynth versions worked incorrect, as is described in new manual. Btw. I noticed it in that time, there is post without reply about it.
Be sure that ChangeFps will not perform any blending.
Old ChangeFps changed framerate, but inserted/duplicated not frames, so framecount remained same.

cheap-red-wine
14th August 2003, 16:33
My experiments show that field decimation via smart bobbing creates objectionable artifacts for progressive material such as anime, but it seems OK for natural interlaced video.

If this approach was generally good, it would be a fine solution to the problem of hybrid clips as well, because the 30fps sections could be decimated to 24fps. But so much hybrid material is anime or CG and smart bobbing destroys that stuff.

trbarry
14th August 2003, 19:30
My experiments show that field decimation via smart bobbing creates objectionable artifacts for progressive material such as anime, but it seems OK for natural interlaced video.

There's probably a couple different issues here.

First, if you deinterlace NTSC video you get create 60 unique frames / second. But progressive material such as anime mostly likely has only 24 FPS or fewer unique source frames. So it is not easy to make 5060 different progressive frames out of it and have it look very good.

But, second and related, many deinterlacer such as TomsMoComp really can't do as good a job if they start with progressive material. In order to get the most info interpolated from adjacent fields/frames it has to assume they are from regularly spaced different points in time. And it also needs a certain amount of error checking to not let apparently combed material though.

So I pretty much agree this method applies only to interlaced video material. But heck, 24p stuff speeds up nice to 25p anyway doing it the traditional way.

- Tom

cheap-red-wine
15th August 2003, 00:55
Sure, Tom, I fully agree with your points.

But I was trying to throw cold water on people that think smart bobbing provides a good solution to rendering 24/30 hybrids at 24.

oddball
15th August 2003, 19:39
I'm more curious about PAL>NTSC conversion which seems rather tricky? I'd like to know if there is a way to slowdown PAL by 4% (I know it's not exactly 4%) and re-encode at 23.976FPS without dropping frames at all. Kinda a timestretch for video if you like :)

ppera2
15th August 2003, 21:07
@oddball

This is used sometimes when want from noninterlaced PAL DVD making NTSC DVD or (S)VCD.

Just need to set framerate to 23.976 (without dropping frames) and perform 3:2 pulldown. Audio must be slowed down in factor 23.976/25 .

It can be made easily with AVISynth, TMPGenc (but in 2 steps).

Mug Funky
5th November 2003, 14:09
my greatest wish... tomsmocomp with masking so it left the static areas untouched...

i've got a script that does this quite well, but it's SLOOOOWWWW, because it does field AND frame differencing (that way single horizontal lines don't get wrongly deinterlaced)

of course, my script doesn't work well on anime either, but it's just the thing for smart-bobbing natural images.

@ppera2:

changing the pitch IMHO is unacceptable... it's one of my major gripes with filmed content that comes to australia that the sound goes up 4% (this is significant)... ever try to watch a music DVD that's consistently out of key?

of course, if the sound is timestretched unnoticably then all is well, but i'd prefer not to lose ANYTHING, because i'm a sound nazi... the R4 Fight Club DVD (possibly my favourite movie) thankfully just dups one frame per second, which i never noticed even when i looked for it.

ppera2
5th November 2003, 16:39
Originally posted by Mug Funky

changing the pitch IMHO is unacceptable... it's one of my major gripes with filmed content that comes to australia that the sound goes up 4% (this is significant)... ever try to watch a music DVD that's consistently out of key?
of course, if the sound is timestretched unnoticably then all is well, but i'd prefer not to lose ANYTHING, because i'm a sound nazi... the R4 Fight Club DVD (possibly my favourite movie) thankfully just dups one frame per second, which i never noticed even when i looked for it.

Every methode has it's up and downsides. Timestretch is usually performed with pitch preserve, but it has some distorsions.
Some people is more sensitive for audio changes, errors, other is more sensitive for picture/video errors.
What you talk about dubbing one fps is fortunatelly very rare - it really pisses me off. I saw it mostly on Ukranian pirate DVD's. Jerky movement instead 4% speedup - no thanks... That you never noticed it is probably because it's combined with bloor, to make it less visible, but jerkiness is still here.

bilu
5th November 2003, 19:10
@trbarry

How about this method followed by a AssumeFPS(25) speedup ?

http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?t=216

Bilu

trbarry
5th November 2003, 22:41
bilu -

That was an interesting thread. But I was just curious about doing it without any blending and yet having the minimum judder. I didn't actually have any clips that needed this.

It is sort of an internal war I'm having with myself on video. When is it desirable to start blending info together from possibly different points in time? Often? Sometimes? Rarely? Never?

- Tom

bilu
5th November 2003, 23:00
Have you seen the different modes on the video on sharfis-brain page?

http://home.arcor.de/scharfis_brain/60ito24p.html

http://home.arcor.de/scharfis_brain/doom9-24p_modes_0123.avi

Bilu

vhelp
11th November 2003, 01:25
Hi guys,

@ Tom..

Assuming your source .AVI's are named:
* 01.00.01.avi
* 01.00.02.avi
* 01.00.03.avi

then..

## Converts (NTSC 29.97 fps) DV footage to (PAL 25 fps Interlace) ##

x="d:\01.00.vdr"

segmentedAVISource(x)

SeparateFields()
Weave()

ConvertToYUY2()
ConvertFPS(50)

SeparateFields()
SelectEvery(4,1,2)
Weave()

This works perfectly smooth. The end result is 25 fps Interlaced.
Mind you, I only did one realy quick test to CDR for dvd playing, and
my eyes only saw smooth playing, and no judder. I take it to
mean the same things "judder" = "strobbing" ??

-vhelp

vhelp
11th November 2003, 01:32
.
.

opps, forgot to finish.
.
.

About the only problme I have w/ this is that I can't seem to change
the Interlace into progressive. The Interlace seems to "stobe" in
sort of like pairs or something. hard to explain. Anyays..

I can successfully turn a Interlace source into a very good Progressive
source (DV) w/ nice clean edges etc - really looks good to me :)

But, when I apply this same script to the new 25 fps, things get all
cook-eyed, ..if you know what I mean.
.
.
I'm currently working on this issue though. ..would be good (great)
for divX (and other format) projects for sure.

-vhelp