View Full Version : Sox Pal->Ntsc conversion?
Foofaraw
16th September 2012, 02:57
I was looking to convert a PAL sound to NTSC, and it was suggested I use Sox, and I found this snippet:
sox in.wav output.wav speed 0.95904
And that sounds right, except the output file grows in duration, which is not what I want.
So I'm guessing I should use the -pitch argument instead - however I have no idea what value is the correction one - anybody know what it should be?
Selur
16th September 2012, 18:31
It's unclear what you want, if you have a video stream and you do a 'slow down' from 25fps to 24fps the duration changes, so should the duration of your audio if it is ment to stay synch.
Since you do not seem to want to change the audio length it is unclear what you want sox to do with your audio stream,...
sneaker_ger
16th September 2012, 18:55
According to his post in the eac3to thread he really just wants to change the pitch. PAL speedup results in a pitch change of 70.67 cents, but I'm not 100% sure if you can just use -70.67 for the pitch parameter to reverse the effect - maybe someone else can explain.
Though I support Selur's suggestion to slowdown both video and audio to get the original playback speed and pitch. This can be done losslessly for video.
Foofaraw
16th September 2012, 19:46
It's unclear what you want, if you have a video stream and you do a 'slow down' from 25fps to 24fps the duration changes, so should the duration of your audio if it is ment to stay synch.
Since you do not seem to want to change the audio length it is unclear what you want sox to do with your audio stream,...
As I wrote, I want to change the audio from the PAL speed to the NTSC speed.
According to his post in the eac3to thread he really just wants to change the pitch. PAL speedup results in a pitch change of 70.67 cents, but I'm not 100% sure if you can just use -70.67 for the pitch parameter to reverse the effect - maybe someone else can explain.
Though I support Selur's suggestion to slowdown both video and audio to get the original playback speed and pitch. This can be done losslessly for video.
Hi sneaker_ger.
I didn't want to touch the video because I thought that would mean re-encoding, plus it would take 5000% longer than just processing the audio.
But you are saying one can do this losslessly for video?
Didn't know that.
As for using -70.67 I'll try that as soon as I have finished my pizza :)
Foofaraw
17th September 2012, 01:17
Well, it seems to accept -70.67 but it doesn't sound quite slow enough.
And sneaker_ger based on your suggestion of video, I tried putting video and audio in an mkv, and change the video playback speed - it did appear to be in sync - though the subtitles were now out of step. If I have to OCR them and resync it becomes a bigger job :-/
Oh well.
sneaker_ger
17th September 2012, 06:12
OCR is not necessary. You can change the subtitle speed in mkvmerge GUI as well, by selecting the subtitle track and entering the following in the "Stretch by" field:
25 -> 23.976: 25025/24000
25 -> 24.000: 25/24
23.976 -> 25: 24000/25025
24.000 -> 25: 24/25
I hope I got the numbers correct. Otherwise you could also re-time the subtitles with programs like BDSup2Sub.
Foofaraw
18th September 2012, 01:27
OCR is not necessary. You can change the subtitle speed in mkvmerge GUI as well, by selecting the subtitle track and entering the following in the "Stretch by" field:
25 -> 23.976: 25001/24000
25 -> 24.000: 25/24
23.976 -> 25: 24000/25001
24.000 -> 25: 24/25
I hope I got the numbers correct.
Curious, I tried adding that to the field, but the resulting mkv now displays its duration as one third of the original length!
(and doesn't play)
Hm..
sneaker_ger
18th September 2012, 07:13
Stretching a single track should in no way change the duration of the complete file by a third. Re-check and make sure that you're stretching the correct tracks.
Foofaraw
19th September 2012, 02:18
Stretching a single track should in no way change the duration of the complete file by a third. Re-check and make sure that you're stretching the correct tracks.
I would assume it only stretches the subtitle track not the video?
Anyway, in mkvmerge I click on a S_VOBSUB track (I only keep one), chose the "Format Specific options" and enter something like "24000/1001" in the "Stretch by" field - and that produces an mkv with a wildly different playback length.
Asmodian
19th September 2012, 20:42
25001/24000 not 24000/1001
Foofaraw
20th September 2012, 00:01
25001/24000 not 24000/1001
The numbers make no sense to me. Could you explain how you arrived at 25001/24000? :)
Its much better, but not quite right, by the end it has drifted by about 4 seconds.
Asmodian
20th September 2012, 01:14
I just copied what sneaker_ger stated. Are you going to 24000/1001 or 24 fps?
I assume it is just the ratio you want them slowed by.
[START FPS] = [END FPS] * X
Foofaraw
20th September 2012, 01:38
I just copied what sneaker_ger stated. Are you going to 24000/1001 or 24 fps?
I assume it is just the ratio you want them slowed by.
[START FPS] = [END FPS] * X
Source was originally 25. In Mkvmerge I set the FPS for the video track to 24000/1001 (which then matches the new audio)
Using "25001/24000" as you suggested (sorry Sneaker_ger I'm getting confused over these numbers) on the subtitle track, means it starts out well enough in sync, but it drift over time, showing up too late.
Asmodian
20th September 2012, 01:52
Hmm, well 25 / (24000/1001) = 25025/24000 not 25001/24000 so that is probably it. :)
Foofaraw
20th September 2012, 01:59
Hmm, well 25 / (24000/1001) = 25025/24000 not 25001/24000 so that is probably it. :)
I tried actually calculating it.
25001/24000=1.041708333333333
Whereas
25/23.976=1.042709376042709
So not the same. I tried using 1.042709376042709 instead and that worked :) Now the subs didn't drift.
This is black magic :D
Asmodian
20th September 2012, 02:07
It really isn't black magic, sneaker_ger just forgot to multiply the 1 during 1001*25. ;)
1.0427083333333333333333333333333 is more correct. :D
Foofaraw
20th September 2012, 04:31
How many decimals will it take? :)
Asmodian
20th September 2012, 06:48
Just use 25025/24000 or 1001/960.
But your 25/23.976 is only 3.6 ms slow every hour so you might not need to worry about it. ;)
Foofaraw
20th September 2012, 15:11
sounds good :)
sneaker_ger
24th September 2012, 12:05
Ah, yes, Asmodian is correct, of course. I did forget the 1...
I corrected my post.
And you can put those fractions directly into the field, no need to calculate them to a float.
Foofaraw
24th September 2012, 16:16
Ah, yes, Asmodian is correct, of course. I did forget the 1...
I corrected my post.
And you can put those fractions directly into the field, no need to calculate them to a float.
Oh. Since it refuses it in the FPS field I thought it would here as well.
sneaker_ger
24th September 2012, 16:37
I don't think that's true, it should allow fractions for the fps field as well unless some bug was introduced recently.
Foofaraw
25th September 2012, 19:36
I don't think that's true, it should allow fractions for the fps field as well unless some bug was introduced recently.
Oh, well I tried it told me that wasn't allowed.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.