Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd April 2002, 14:33   #1  |  Link
Zoltan
Registered User
 
Zoltan's Avatar
 
Join Date: Feb 2002
Location: Hungary
Posts: 91
29.97 fps NTSC to 25 fps PAL makes choppy output

Hi there,

I have converted many PAL DVDs but I am quite newbie to NTSC world. I have quite a few 29.97 fps interlaced DVDs and I want to convert them to PAL SVCDs using DVD2SVCD. One of them is this title. Since I tried all the possible combination given by the D2S UI without success, I suspect this problem can only be solved by Avisynth scripting so this is why I am escalating this problem here.

The results are as follows:

Force Film = On
Stunning quality output but slow playback, deep voice, video+audio are in sync. I guess the problem is that the stream is correctly converted to 23.97 fps and the AssumeFps(25,1,true) line executed by D2S results in a slow playback. Any opininon?

iVTC = On (uses telecide() and decomb(5))
Correct playback speed, video+audio are in sync but video is choppy at around every sec or a half even onmy PC (WinDVD). I suspect decomb(5) deletes wrong fields due to inappropriate field order. I tried select or deselect field first - none of them helped so I have no more idea here.

Searching for the forums I think many guys have similar problems out there. I am following Avisynth and the D2S forums for a while and search through both of them and although many people already asked this, no real answer was available.

Finally the questions are as follows:

1) What is the difference between pulldown and iVTC? Any URLs are appreciated. So far I though both of them are to remove extra frames that were inserted to get a 29.97 fps stream.

2) How does decimate(5) select the frames to be deleted? I read that it makes comparison of every 5 frames, but it this the function I need here at all?

3) When I use the following script

DoubleWeave()
SimpleResize(480,576)
Pulldown(0,2)

I get a perfect 23.97 fps NTSC mpv. Audio, of course, is async. How can I convert the video to 25 fps PAL stream? Audio synch may be handled by BeSweet as I read in the D2S forum: "-frc( -r 960 1001 )".

4) Let's suppose that similarly to D2S I want use the external utility pulldown.exe. Its usage says:
"PULLDOWN is a tool for modifying the encoding flags in an MPEG-2 video stream. It is most useful for turning a 23.976fps progressive stream into an SVCD-compliant 29.97fps NTSC interlaced stream via 2:3 pulldown."

- I need the opposite thing here. Can do it with this tool? What does the "-nopulldown" argument exactly do?
- What does the "-framerate" argument do? Does it change the framerate to the one that's specified? Sounds obvious. Which fields are deleted then? How is audio sync handled? It made quite choppy output from my smooth 23.97 fps MPEG-2.

5) I use DVD2AVI and BitrateViewer to analyze mpeg streams. Any other tool available to check whether the stream is hybrid, changing field order, etc.?

Thanks for your answers for this long list questions in advance. I know this is too much in one but all in all this is about one problem only: 29.97 NTSC to 25 PAL conversion.

Thanks,
Z
Zoltan is offline   Reply With Quote
Old 3rd April 2002, 16:56   #2  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
Hit F5 in DVD2AVI: if you have at least 95% FILM go for Force Film in DVD2AVI. Encode AS IS in 23.976fps (without asssumefps or what so ever!). After Encoding, open your AVI in VirtualDub, select Video -> Direct Stream Copy, set Framerate to 25fps, that's it you have now a PAL video. You may then convert this AVI to SVCD.

Now, if it shows less than 95% Film or NTSC all the time, don't check Force Film, and make a simple AVS file like this:

LoadPlugin("path\mpeg2dec.dll")
mpeg2source("path\project.d2v")

Without any other line!
Now open this AVS file in VirtualDub and look frame for frame using the right arrow. If there are every time 3 full frames + 2 interlaced frames, your video is telecined, go for IVTC
You may use IVTC 2.2 with the setting: ivtc(32,11,120)
or Decomb with
Telecide()
Decimate(cycle=5)
When you're done with encoding, convert the framerate as above.

If you get interlaced frames all the time, your video is real 29,97fps, so you can't use IVTC or Force Film.
You have then 3 choices, leave it AS IS WITHOUT DEINTERLACING and encode a normal NTSC SVCD. That will require a very high bitrate!
Deinterlace it using Decomb for example and encode to NTSC SVCD, that will not need as much bitrate as an interlaced SVCD.
Or deinterlace it, encode to 29,97fps AVI and convert the framerate then in VirtualDub to 25fps. But this will be quite noticeable, since you're lowering the speed 20% down!

You may adjust the length of the soundtrack to the length of the new AVI after you have done the framerate conversion.
DJ Bobo is offline   Reply With Quote
Old 3rd April 2002, 20:10   #3  |  Link
Zoltan
Registered User
 
Zoltan's Avatar
 
Join Date: Feb 2002
Location: Hungary
Posts: 91
I must confess, this was the first real valuable step-by-step guide during the last year for an NTSC to PAL project I have seen on Doom9 or VCDhelp.

I hope these DVDs are not fully 29.97 fps NTSC because, as I understand, there is no solution to convert then to high quality PAL SVCD. Would be a pain, since my whole project is about to convert these R1 NTSC DVDs to PAL for my TV set is PAL only.

I will check the vobs as soon as I am at my PC.

Thanks again, bobotns!
Z
Zoltan is offline   Reply With Quote
Old 4th April 2002, 08:20   #4  |  Link
Zoltan
Registered User
 
Zoltan's Avatar
 
Join Date: Feb 2002
Location: Hungary
Posts: 91
@bobotns:
I checked the DVD last night and it turned out to be 100% NTSC. Now I understand why and iVTC resulted in choppy playback: there were no padding frames so it deleted precious content.

Interestingly enough, during the first minute I found a small, 5 sec scene that is iVTC-d. Apart from this, the whole film is full interlaced 29.97 fps.

Question:
What codec do you suggest when making the intermediate, deinterlaced avi?
- HUFFYUV?
- MJPEG Q=18?
- Or can I just further frameserve from VDub to the MPEG encoder?
- Does CCE support VDub frameserver? Somewhere I heard CCE has problems with it.

Thanks,
Z
Zoltan is offline   Reply With Quote
Old 4th April 2002, 11:50   #5  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
The fastest way will be to make an intermediate AVI File, but you'll need very much harddisc space.
Huffyuv is lossless, but it's very slow, so I won't use it.
MJPEG is good, but you better go for a higher setting like Q20, because the higher the setting, the better will your SVCD look.

I never tried to frameserve from VirtualDub, so you may try that on your self. If it works, it will be much slower than the first way.
DJ Bobo is offline   Reply With Quote
Old 4th April 2002, 15:43   #6  |  Link
ppera2
Registered User
 
ppera2's Avatar
 
Join Date: Oct 2001
Location: Lands of confusion
Posts: 1,217
Frameserving is always faster than making intermediate file.

Only exception would be if use 2 or more pass encoding and use slow filters by it. Then is worth to make intermediate AVI file with filters, and then encode fast from it...

@Zoltan
If origin source is Film, it is always possible to restore it from NTSC source, unless it is really screwed up. I converted lot of Chinese DVD's with poor quality Telecine, and get good results with TMPGenc or Decomb.

If you encode with TMPGenc you don't need VDub. Make IVTC of DVD2AVI project , and save it as tmpg project. Now you have 23.976 fps.
Then load it again to TMPGenc and set framerate in Setting, Video to 25 fps, and check in Advanced 'Do not framerate conversion' .
This will ensure that no frame duplication, but of course it will play faster. Because of it you must before audio encoding timestretch audio by factor 23.976/25 .

CCE is faster, but it's not so easy to use and makes lot of problems.
ppera2 is offline   Reply With Quote
Old 4th April 2002, 17:01   #7  |  Link
movmasty
Registered User
 
Join Date: Feb 2002
Posts: 970
in the .avs file you could use
SelectEvery(6,1,2,3,4,5)
to change framerate to 29.97 to 24.975 keeping original duration
then in vdub change fps to 25

then use an audio editor to make audio duration match
movmasty is offline   Reply With Quote
Old 4th April 2002, 18:50   #8  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
@ ppera
He's doing SVCD, so multi pass encoding!
And then you havn't read anything and come with tips that won't help, since his movie is real 29,97fps

@ movmasty
I never has real 30fps NTSC video, will your command result in a smooth PAL stream?
DJ Bobo is offline   Reply With Quote
Old 4th April 2002, 20:13   #9  |  Link
Zoltan
Registered User
 
Zoltan's Avatar
 
Join Date: Feb 2002
Location: Hungary
Posts: 91
Thanks for all the replies.

@bobotns: I have used MJPEG a lot for my many hours of analogue capture to VCD projects. I'll stick to it then.

I was not going to start a religious war between TMPG and CCE. For VCDs I prefer TMPG, for SVCD I think 4 pass VBR CCE is the ultimate solution. All in all, everyone should make its decision based on his/her personal experience. My original question was not about encoding speed though, but any possible frameserving client problems with CCE.

For quality reasons I prefer 4pass VBR CCE and since I have 20-30 GB more disk I would create an intermediate avi.

@movmasty: For Film input I had many positive results. But this my first fully 29.97 fps NTSC stream. AFAIK that means SelectEvery() or any similar filter would necessarily loose precious info.

Maybe some kinda blending that creates 25 new frames per sec instead of the 29.97 old ones by making them a bit less sharp would work. Does VDub change framerate do blending? I doubt it, because as bobotns said, Direct Stream Copy should be On.

Opinion?

Thanks,
Z
Zoltan is offline   Reply With Quote
Old 4th April 2002, 21:01   #10  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
@ Zoltan
VirtualDub accelerates or decelerates the video when converting framerate. That means no frame will get lost.
I heard about a tool named "motion perfect" or something that can do framerate convertion without changing duration of the movie, but I never used it, had it or even searched for it.

But I can tell you something: even professionals can't do clean 29,97 -> 25fps convertion, look for example at star trek episodes, they aren't smooth in their PAL version (every second a little jitter)
DJ Bobo is offline   Reply With Quote
Old 4th April 2002, 22:51   #11  |  Link
ppera2
Registered User
 
ppera2's Avatar
 
Join Date: Oct 2001
Location: Lands of confusion
Posts: 1,217
Problem when making SVCD via VDub and CCE is that VFAPI and VDub's frameserving work not together, at least not by me.
I needed in that case to use DVD2AVI, AVISynth, VDub and frameserving from it (AVIProxy) to CCE. It is still much faster than TMPGenc. And I still don't see any reason to make intermediate AVI file (except if use slow filters). It works only with CCE 2.5 .

I converted many NTSC DVD to PAL (S)VCD, result was always very good.
But must tell that all it was FILM, and I was able to get always smooth 23.976 video, then speed up it to get 25 fps...

When source is true NTSC probably movmasty's way will give good results.
ppera2 is offline   Reply With Quote
Old 4th April 2002, 23:39   #12  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
@ ppera
creating AVI intermediate file is always faster because:
1) MPEG2 decoding only one time, and you know that MPEG2 software decoding is very CPU intensive
2) Resizing also only one time
Not to mention TemporalSmoother and other things that one may use (I always use TemporalSmoother)

And then CCE will work like a raket!
DJ Bobo is offline   Reply With Quote
Old 5th April 2002, 08:40   #13  |  Link
movmasty
Registered User
 
Join Date: Feb 2002
Posts: 970
SelectEvery command gives always smooth output
if the result cant be "round"(es 29.97 source)use vdub after
vdub "decimate by 2" is the same than
SelectEvery(2) or SelectEven/odd

jerkiness comes from different reasons
isnt the fact to drop some frames in a ordered way
but is the video editor used that doesnt do it well
it starts to drop and duplicate frames randomly at the same time
videomach doesnt do
Ulead does
Premiere does VERY heavily

>SelectEvery() or any similar filter would necessarily loose precious info
-will drop some frames, 5 every 30 in ntsc to pal
then you say that hollywood colossals have poor info at 24 fps
you'll lose NOTHING!
you will see at 25 exactly the same movie than at 30!
eye doesnt need 30 fps!
IMO even 15fps look like 30fps...if you did well...
..if you didnt, your movie will be jerky,but not cause of the 15fps.
SelectEvery command does well.

>Does VDub change framerate do blending...
-blend 30 frames to 25 every second per 7000 seconds would be a very silly thing,other than the slower editing task
results could never be good,and like result youll have always only 25 frames...but 25 bad frames...

>VirtualDub accelerates or decelerates the video when converting framerate
-only when you use "change fps"
if you use "decimate by n" will drop frames dividing by n
SelectEvery is like a decimate but fine tuned

>I can tell you something: even professionals can't do clean 29,97 -> 25fps convertion
-they do if you use some "professional" attention
http://forum.doom9.org/showthread.php?s=&threadid=21892
movmasty is offline   Reply With Quote
Old 5th April 2002, 10:27   #14  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
@ movmasty
15fps never look as smooth as 24, 25 or 30fps, not on earth! this is nonsense!


About VirtualDub: I never said he should decimate
About real framerate convertion: as you said, SelectEvery might be the right choice.
I studied the problem yesterday: imagine we have interlaced 29,97fps video projected on a wall that we want to film with a PAL camera:

NTSC Halfframe intervall in ms:
16.68-33.36-50.04-66.72-83.40-100.08-116.76-133.44-150.12-166.80-183.48-200.16- etc

PAL Halframe intervall in ms:
20-40-60-80-100-120-140-160-180-200 etc

That means every 6th half-frame will be omitted by the camera, here half-frame that comes 100.08ms and half-frame that come 200.16ms
That means, your selectevery command must be completed with the following:

SeparateFields
SelectEvery(6,1,2,3,4,5)
Weave

Is it correct that way?
This will lead as you said to 24,975fps, that we can change (accelerate) to 25fps in VirtualDub (cool! )
DJ Bobo is offline   Reply With Quote
Old 5th April 2002, 12:21   #15  |  Link
hakko504
Remember Rule One
 
hakko504's Avatar
 
Join Date: Oct 2001
Location: SWEDEN
Posts: 1,611
@bobotns

Code:
SeparateFields 
SelectEvery(6,1,2,3,4,5) 
Weave
will produce films with some frames field shifted: If you start with 1t1b 2t2b 3t3b 4t4b 5t5b 6t6b you will get 1t1b 2t2b 3t4t 4b5t 5b6t i.e. 2 correct frames, 1 frame with 2 top fields and 2 frames with top/bottom fields shifted.

Ben Rudiak-Gould (who wrote AVISynth) recommends a bob command before converting the framerate. Something useful might look like this (Using decimate from Decomb):
Code:
LoadPlugin("Decomb.dll")
AVISource("59_97_fps.avi")
bob()
Decimate(6)
SeparateFields()
SelectEvery(4,0,3)
Weave()
AssumeFPS(25)
The only thing that remains is to speed the audio slightly (25/24.975)

Bens original NTSC to PAL conversion can be found in the document section at videotools
__________________
/hakko

http://www.boardgamegeek.com

Last edited by hakko504; 5th April 2002 at 12:24.
hakko504 is offline   Reply With Quote
Old 5th April 2002, 15:06   #16  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
@ hakko504
I also asked my self how this can be, but hey, that was just a proposition
I've never had real 29,97fps stream, so I'm just "theoreting"!

But I don't like that assumefps command though, or is it the same as changing framerate in VD!?
DJ Bobo is offline   Reply With Quote
Old 5th April 2002, 16:32   #17  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
This thread has made me re-think the way video is handled in almost all our compression utilities. I may be saying something stupid here without thinking about it enough but I think video sourced material (but not film) is handled wrong in almost all of our utilities for the cases where the frame rate will be subsequently changed.

Assuming it is not from film, NTSC TV video is sent at 59.94 DIFFERENT fields / second. But all the PC capture and compression programs that I'm aware of process this at 29.97 interlaced frames / second. Our computers would maybe not have the power to display them otherwise until recently.

On the DScaler project the 59.94 fields are deinterlaced to create 59.94 full frames. But when I ported GreedyHMA from there over here to Avisynth I did what everone else does and created only 29.97 full frames / second. This is fine if it is going to be stored and played at that rate and is what everyone expects. (again this is video source, not film here)

But now consider we want to save only 25 frames / second. (or even 23.976) even though we have 59.94 unique fields / second of input video. If you don't count some awful temporal blending solutions then what you have to do is choose and keep the correct frames that occur most closely in time to each 1/25 of a second. You drop the rest. They won't line up exactly and you have to take an integer number of frames. So you choose the ones closest to the points in time you want.

But since this was really video source I could have deinterlaced 59.94 different full frames / second from the same capture data. This would mean the average error in choosing the correct frames would have been only half as much, and the conversion judder would have been less visible for folks that want to drop the frame rate to only 23.976 or 25 fps.

That is, it is more accurate to convert 59.94->25 than it is to convert 29.97->25.

I'm not actually going to change this anytime soon but if my reasoning is correct then someone should look into it the next time they create a video deinterlacer. It would run a bit slower deinterlacing and dropping the extra frames but I'll bet the results would be noticably more pleasing.

If I can I'll try to add this as an option to GreedyHMA at some time in the future.

- Tom

Last edited by trbarry; 5th April 2002 at 16:36.
trbarry is offline   Reply With Quote
Old 5th April 2002, 19:31   #18  |  Link
movmasty
Registered User
 
Join Date: Feb 2002
Posts: 970
@bobotns, does a movie at 60 fps looks smoother than at 30??
the same is between 30 and 15.
images last on eye about 1/10 of second
thus a movie is smooth above 10/11 frames

then the refresh rate of the screen is always ~75,
for ALL the movies, at 15 and at 30...

Last edited by movmasty; 5th April 2002 at 19:52.
movmasty is offline   Reply With Quote
Old 5th April 2002, 21:17   #19  |  Link
DJ Bobo
Encoding Dinosaur!
 
DJ Bobo's Avatar
 
Join Date: Oct 2001
Location: Europe
Posts: 1,668
@ movmasty
You can't compare 60/30 with 30/15.
15fps will be stuttering, 30fps will be perfectly smooth. And you've gotta test this for yourself, because it seems you've never compared 15fps and 30fps seriously (especially in long panoramic scenes)
DJ Bobo is offline   Reply With Quote
Old 30th September 2003, 21:58   #20  |  Link
Crazyjoe
Elvis Imitator
 
Crazyjoe's Avatar
 
Join Date: Jan 2002
Location: Austria
Posts: 176
Problem with telecined THX trailer

Sorry to post in such an old thread, but I have a problem that sticks close to it.

Right at the moment i'm trying to convert the THX Wow trailer to PAL. The clip is telecined. Therefore I tried it with Avisynth using Decomb. The result was a absolutely smooth playing PAL clip which lastet 20 seconds shorter than the original NTSC clip.

After that I decoded the original 5.1 Dolby track to six wav files and changed the lenght to the lenght of the new PAL clip (which had the effect of a slight pitch change, but that didn't matter so far).

Now here's my problem: although the PAL video and the adjusted audio track do have exactly the same lenght, audio gets out of sync after about 30 seconds of playback. I really can't see where the problem is.

One thing to add: during the first 30 seconds the original clip had pure NTSC. After that the part which is mostly FILM begins.

Last edited by Crazyjoe; 30th September 2003 at 22:00.
Crazyjoe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.