Log in

View Full Version : change sample rate or pitch ?


varunb
21st December 2007, 07:29
I did find a post regarding this topic but i was unable to clear my doubt. I just want to know that while going from ntsc to pal or the opposite, should I change the pitch or should I change the sample rate. For example if i m doing pal to ntsc, should I use assumefps(23.976,true) & ssrc(48000) or the timestretch method ?

madshi
21st December 2007, 10:37
I did find a post regarding this topic but i was unable to clear my doubt. I just want to know that while going from ntsc to pal or the opposite, should I change the pitch or should I change the sample rate. For example if i m doing pal to ntsc, should I use assumefps(23.976,true) & ssrc(48000) or the timestretch method ?
When doing PAL -> NTSC you need to be aware that the studio originally had a NTSC track to start with. They then somehow converted that to PAL. Now the decisive question is: How did the studio do that? Did they use pitch correction or did they use simple resampling/timestretch? Basically to undo what the studio did, you need to do the very same thing - just in reverse.

Here in Germany most PAL tracks were created by the studio by using simple resampling/timestretching. However, I've been told that in Spain most PAL tracks are done by using pitch correction. So as the very first step you need to find out which method the studio used for your PAL tracks.

tebasuna51
21st December 2007, 12:53
I just want to know that while going from ntsc to pal or the opposite, should I change the pitch or should I change the sample rate. For example if i m doing pal to ntsc, should I use assumefps(23.976,true) & ssrc(48000) or the timestretch method ?

TimeStretch can do both methods because:
assumefps(23.976,true) & ssrc(48000)
is equivalent to (with (100.0*24000.0/1001.0)/25.0 = 96000.0/1001.0):
AssumeFPS("ntsc_film") # only video changed
TimeStretch(rate = (96000.0/1001.0)) # audio length increased without pitch correction

If you want audio length increased with pitch correction you need:
TimeStretch(tempo = (96000.0/1001.0))

Like madshi say you if the PAL audio track are previously processed you need revert the method if you know.

But if the audio is not processed previously, for instance my movie filmed with my PAL camera, the right way is correct the pitch when the audio length is increased.

And also more correct is let the audio untouched (the samplerate 48000 is supported by PAL or NTSC systems) and modify the video only with ConvertFPS().

I know this last method is slow and can degrade the video quality, but if you play at 23.976 my video recorded at 25 fps (AssumeFPS), a 100 m race with a good time of 10.0 sec seems a poor time 10.4 sec. Now the time quality is the degradate.

madshi
21st December 2007, 12:58
And also more correct is let the audio untouched (the samplerate 48000 is supported by PAL or NTSC systems) and modify the video only with ConvertFPS().

I know this last method is slow and can degrade the video quality, but if you play at 23.976 my video recorded at 25 fps (AssumeFPS), a 100 m race with a good time of 10.0 sec seems a poor time 10.4 sec. Now the time quality is the degradate.
I guess ConvertFPS would reencode the video? Personally, when I want to change video framerate, I'm muxing the video to MKV (I'm muxing all my movies/videos to MKV, anyway) and then I'm rewriting the timestamps with mkvtoolnix. That works well, doesn't cost much time and doesn't do any harm to the video (apart from changing the framerate, obviously).

varunb
21st December 2007, 15:03
When doing PAL -> NTSC you need to be aware that the studio originally had a NTSC track to start with. They then somehow converted that to PAL. Now the decisive question is: How did the studio do that? Did they use pitch correction or did they use simple resampling/timestretch?

Consider that I don't know how the studio processed the audio. I just want to avoid or minimize quality loss. Now which method should I prefer ? One thing's for sure is that there's no need to use convertfps() as I just want to process the audio.

madshi
21st December 2007, 16:17
Consider that I don't know how the studio processed the audio. I just want to avoid or minimize quality loss. Now which method should I prefer ?
The key point is that if you want to minimize quality loss you NEED to know how the studio processed the audio!! Finding out what the studio did is not that difficult. Do you have a 23.976 audio track (of the same movie) to compare your PAL audio track to?

varunb
22nd December 2007, 17:09
Do you have a 23.976 audio track (of the same movie) to compare your PAL audio track to?

No, cos only PAL system is followed here. So right now, I only have the PAL audio track in my hand.

madshi
22nd December 2007, 18:27
No, cos only PAL system is followed here. So right now, I only have the PAL audio track in my hand.
But you seem to have a NTSC (23.976) video stream? Didn't that NTSC video stream come with its own audio track (maybe in a different language)?

Or if you don't have a NTSC video stream then why do you want to convert the audio track in the first place?

varunb
23rd December 2007, 06:25
Thats bcos the Hollywood DVDs here are available in only PAL format. Its very rare that I get my hands on the NTSC format. I view them in NTSC format using Avisynth on my PC as I don't like the high pitch/speed dialogues in PAL movies that occurs due to NTSC->PAL speed-up.

madshi
23rd December 2007, 10:13
Thats bcos the Hollywood DVDs here are available in only PAL format. Its very rare that I get my hands on the NTSC format. I view them in NTSC format using Avisynth on my PC as I don't like the high pitch/speed dialogues in PAL movies that occurs due to NTSC->PAL speed-up.
Well, if you know that the pitch is high then you already know that the studio used simple resampling and no pitch correction. In that case you should use simple resampling, too, to undo the PAL speedup. See tebasuna51's post about "TimeStretch".

I'm sorry, you probably wanted to hear: "Do this, it's always the right thing". Unfortunately the right thing depends on what the studio did. So that's really all I can tell you. If the studio used method A to do the PAL speedup then you need to use the same method A to undo the PAL speedup. If the studio used method B, then so should you. (method A being simple resampling, method B being complex pitch correction). If you don't follow this advice with a bit of bad luck you could end up with too high pitch or too low pitch.

varunb
23rd December 2007, 12:05
Well u r right. It depends on the studio & the softwares they use. We can't say whether the software implemented resampling or pitch correction. I was hoping to get some preference & I also had in my mind that whether v use resampling or pitch correction, both increase the pitch to the same amount. Looks like I was wrong.

madshi
24th December 2007, 10:27
Well u r right. It depends on the studio & the softwares they use. We can't say whether the software implemented resampling or pitch correction. I was hoping to get some preference & I also had in my mind that whether v use resampling or pitch correction, both increase the pitch to the same amount. Looks like I was wrong.
Yep, the sense of "pitch correction" is that the pitch is not changed before/after the slowdown/speedup. Unfortunately doing pitch correction in a good way is very hard. Often you end up with some audio artifacts. If you want/have to do pitch correction and want to keep the highest possible audio quality, you should only use the best software. From what I've read about pitch correction, TimeFactory might be the ticket. Costs money, though...

varunb
24th December 2007, 14:57
What about Goldwave ?

madshi
24th December 2007, 18:07
Don't know. I'm just repeating what I read elsewhere. I've checked neither of these pitch correction algorithms. Maybe tebasuna51 can comment on which algorithms are good and which you should avoid? I think he has more experience with pitch correction than I have.