View Full Version : NTSC to PAL with AviSynth (for CCE)
aldaco12
13th October 2005, 14:44
Hi. I'm becoming mad because I'm sure this should be a common problem, but I haven't still managed to find an example of and AviSynth script to be used to convert a SVCD MPEG-2 (480x480) into a SVCD PAL one (480x576)
So far, I think I'm able to make a proper 'image' conversion:
DirectShowSource("C:\mc\Tmp\mov\movie.mpg",fps=29.97)
AddBorders( 0,48,0,48 )
but the result is that I obtain a 480x576 video 29.97 fps!
The problems are:
1) Obtain a 25 fps video as CCE output
2) have an audio in sync with the video
I have read thousands of pages about 'proressive' or 'interlaced' videos, millions pages about DVD conversion, but I am still unable to convert properly my movie.
How can it be that such a common problem (PAL <--> NTSC) is so hard to solve?
I will be grateful for any suggestion.
Guest
13th October 2005, 15:00
http://forum.doom9.org/search.php?searchid=317923
:search:
Boulder
13th October 2005, 15:04
No need to use DirectShowSource. Use the DGIndex/DGDecode combo to create a d2v project file and to load it in your script with MPEG2Source().
You'll need to IVTC the video to 23.976fps if it's not truly interlaced. Then use AssumeFPS(25) in the script to speed up the video and process the audio similarly with BeSweet for example.
EDIT: I'm as slow as a pig today :D
aldaco12
13th October 2005, 15:47
But if I apply Besweet to the audio (OTA Option: Preset NTSC --> PAL [29.97 --> 25] ) , clicking on the output I see it is 1h 10' long even if it was 58' 46" when it was NTSC!
Is, this info I get from the audio stream, true or false?
To Neuron2: SORRY, I can't use the 'search function'. When I did, 300 forum pages appeared.
Boulder
13th October 2005, 16:00
To Neuron2: SORRY, I can't use the 'search function'. When I did, 300 forum pages appeared.
Uh, that means that you need to start reading through the threads. The search engine is no magical box from which you'll get an immediate answer. You need to work a little yourself as well.
The audio (although audio doesn't actually have a framerate, only length) is either 23.976fps or 29.97fps depending on if you have telecined video (=encoded at 23.976fps, pulldowned to 29.97fps) or true interlaced material (encoded at 29.97fps). Depending on the preset, audio will either be stretched or compressed length-wise.
Prodater64
13th October 2005, 18:32
But if I apply Besweet to the audio (OTA Option: Preset NTSC --> PAL [29.97 --> 25] ) , clicking on the output I see it is 1h 10' long even if it was 58' 46" when it was NTSC!
Is, this info I get from the audio stream, true or false?
To Neuron2: SORRY, I can't use the 'search function'. When I did, 300 forum pages appeared.
You don't need to change audio if you do use DGPulldown method.
http://neuron2.net/dgpulldown/dgpulldown.html
Abond
14th October 2005, 07:51
The dgpulldown method is only applicable if the video is 23.976 progressive, pulldowned to 29.97. Then you must IVTC from 29.97 to recover 23.976 progressive. If the stream is true 29.97 interlaced (or even progressive) dgpulldown cannot do it.
@aldaco12
That is, you need to determine what type of video you have in the NTSC SVCD.
aldaco12
14th October 2005, 08:07
OK, but I cannot understand how to have a PAL audio in sync if I start with NTSC material.
foxyshadis
14th October 2005, 09:14
OK, but I cannot underatsnd how to 'process audio' with BeSweet.
If I apply the OTA preset 23.976 --> 25.000, from a 58' audio track I obtain a 56' one. Is this correct, or a false information given me by my player?
What sould I to to join that track to the video M2V properly?
That's correct, speeding up the video will give you a slightly shorter duration. Just mux the output (ac3 if going to dvd, I presume) to cce's video output, or better yet load the ac3 into cce and let it do the muxing.
Guest
14th October 2005, 13:19
OK, but I cannot understand how to have a PAL audio in sync if I start with NTSC material. IVTC makes it 23.976 fps. The audio and video have the same duration at that rate after IVTC. Now you add just enough extra fields to the video so that when it is played back at 25fps, the duration of the video stays the same. Result: video at 25fps with matching audio.
Another way to say it is: If pulldown can change 23.976 to 29.97 and keep the sync, then it can also change 23.976 to 25.00 and keep the sync. You just have to add the right number of extra fields, and that is what DGPulldown is all about.
So by 'type' we mean that you need to have 3:2 pulled down progressive (hard or soft telecined) rather than pure interlaced video in order to apply this method, because you need to be able to return to the original 23.976 fps rate.
MuttLover
14th October 2005, 14:19
Then use AssumeFPS(25) in the script to speed up the video and process the audio similarly with BeSweet for example.
I believe changefps() instead of assumefps removes the need to do any audio speed-ups/slow downs.
Boulder
14th October 2005, 14:36
AssumeFPS will also speed up the audio by default. However, to do it, you must AudioDub it in the script, save the resampled wav and encode it to the final format. The same goes for ConvertFPS and ChangeFPS as playtime is not kept constant.
I would simply use MADPlay on the extracted audio to create a wav file, then use SoundStretch/SoundTouch to do the framerate conversion and then encode it to mp2 with BeSweet.
Chainmax
14th October 2005, 15:21
Why not just using DGPulldown for that?
Boulder
14th October 2005, 15:25
I did some tests doing a 23.976fps->25fps pulldown with DGPulldown but the slight jitter bothered me. It is _very_ slight, don't get me wrong, but when I know it's there, it's hard not to notice it. Or once again, my eyes have not had the best day then.
It should be tested anyway, maybe the original poster doesn't mind it.
Abond
14th October 2005, 15:51
Yeah, I tried lately to convert an anime with hardcoded subs 23.976 -> 25 with DGPuldown. Overall there is nothing wrong on the pictures, but on the subtitles.
MuttLover
15th October 2005, 13:34
AssumeFPS will also speed up the audio by default. However, to do it, you must AudioDub it in the script, save the resampled wav and encode it to the final format. The same goes for ConvertFPS and ChangeFPS as playtime is not kept constant.
I would simply use MADPlay on the extracted audio to create a wav file, then use SoundStretch/SoundTouch to do the framerate conversion and then encode it to mp2 with BeSweet.
I have encoded several PAL to NTSC conversions using changefps() and never had to convert the audio.
See the thread at http://forum.doom9.org/showthread.php?threadid=45459&perpage=20&highlight=PAL%20NTSC%20conversion&pagenumber=9 for more info -- it is an older, but good thread discussion on PAL -> NTSC.
(from avisynth manual @ http://www.avisynth.org/FPS )
The AssumeFPS filter changes the frame rate without changing the frame count (causing the video to play faster or slower). It only sets the framerate-parameter. If sync_audio (which is false by default) is true, it also changes the audio sample rate to match the duration of the video, the pitch of the resulting audio gets shifted.
This is also a method to change only the sample rate of the audio alone.
...
ChangeFPS changes the frame rate by deleting or duplicating frames.
So ChangeFPS() & ConvertFPS() requires no audio speedup/slowdown. AssumeFPS will require audio conversion.
Boulder
15th October 2005, 15:02
Humm, my mistake :o
However, I don't understand why anyone would want to either cause jerkiness by duplicating frames or blend frames to do the conversion.
foxyshadis
15th October 2005, 22:40
It's the great PAL conversion conundrum: Do you stay true to the original video by speeding it up and raising the audio pitch slightly, or do you keep the length the same by inserting/blending frames? (Or chase the holy grail of perfect mo-comped conversion for $$$.) Neither way is perfect, and both are fairly popular.
Boulder
16th October 2005, 03:15
Let's just say that here we very often try to repair the damage (usually blending) that has been done to the video in the transfer. That's why I always wonder why anybody would want to use such methods when there's the speedup option available. Audio pitch raise can be avoided by using Soundtouch for example.
Chainmax
17th October 2005, 03:00
I did some tests doing a 23.976fps->25fps pulldown with DGPulldown but the slight jitter bothered me. It is _very_ slight, don't get me wrong, but when I know it's there, it's hard not to notice it. Or once again, my eyes have not had the best day then.
It should be tested anyway, maybe the original poster doesn't mind it.
Does that apply to 23.976fps--->29.97fps conversions as well?
Boulder
17th October 2005, 03:13
No - why would it? Going from progressive 23.976fps to 29.97fps by doing a pulldown isn't a conversion, it's required for MPEG2.
foxyshadis
17th October 2005, 05:46
Let's just say that here we very often try to repair the damage (usually blending) that has been done to the video in the transfer. That's why I always wonder why anybody would want to use such methods when there's the speedup option available. Audio pitch raise can be avoided by using Soundtouch for example.
Oooh, I hadn't known there was a free library for this. It's much better than shelling out for soundforge, if the quality is high enough.
(And yes, now that better technology's here, much better options are available, but quick and dirty is still what some people will always use, unfortunately.)
Mug Funky
17th October 2005, 06:18
soundtouch has awesome quality actually - i haven't heard any messed transients or machine-like speech when doing speedups.
however, it can go out of sync between channels which is quite a problem - the stereo image gets completely munged when this happens.
also, though the pitch doesn't change, the tempo must by necessity, and this is actually more noticable (not many people have perfect pitch anyway, and if it's a global speedup everything will remain in tune with everything else).
most movies simply get resampled when they're sped up - you can hear this if you have a keen ear and/or the soundtrack album for the movie (which will be at the original speed obviously).
mg262
17th October 2005, 07:57
It's a bit out of date, but...
Time Length Adjustment Tools Quality Comparison
http://forum.doom9.org/showthread.php?p=496797
I've always more or less relied on this because I've never had the time to test properly.
nnigam
17th October 2005, 15:01
All of these are great if your source is 23.976 or can be convert to it. But what if you have interlaced 29.97 NTSC. Pulldown will not work, and change/convertfps will result in choppy video. I tried tdint. It did a reasonable job of de-interlacing and reducing frame rate to 23.976, but this also resulted in choppy video.
I have a capture from my video camera which was converted to dvd some time ago. I want to send a copy to a friend in PAL land. I am converting using dgindex to process my vob, avisynth scirpt with vdubmod with tdint in quenc to create the m2v at 23.976, dgpulldown to convert to 25fps and muxman to create the dvd. Guess he will have to settle for slightly choppy video.
My Pal to NTSC conversions however are flawless. Thanks to all the talented people here and the software they have developed.
Boulder
17th October 2005, 15:17
nnigam: Did you try using
AVISource("path\clip.avi")
AssumexFF() # TFF for top field first, BFF for bottom field first
TDeint(mode=1)
Lanczos4Resize(720,576)
ConverttoYUY2()
ConvertFPS(50)
AssumexFF() # as earlier
SeparateFields()
SelectEvery(4,0,3)
Weave()
If you IVTC a truly interlaced clip, you get very jerky video.
nnigam
17th October 2005, 15:22
Yes, I know about the IVTC and the jerky video, but could not find a way around it. I thought of convertFPS(50), but ignored it because the dvd format limits me to 25fps for PAL. But I see that your script should resolve that. I will try it. Thanks.
Boulder
17th October 2005, 15:32
Not my script, the framework can be found in the Avisynth docs ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.