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 > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th September 2012, 02:57   #1  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Sox Pal->Ntsc conversion?

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?
Foofaraw is offline   Reply With Quote
Old 16th September 2012, 18:31   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,116
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,...
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 16th September 2012, 18:55   #3  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,555
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.
sneaker_ger is offline   Reply With Quote
Old 16th September 2012, 19:46   #4  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Quote:
Originally Posted by Selur View Post
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.

Quote:
Originally Posted by sneaker_ger View Post
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

Last edited by Foofaraw; 16th September 2012 at 19:58.
Foofaraw is offline   Reply With Quote
Old 17th September 2012, 01:17   #5  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
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.
Foofaraw is offline   Reply With Quote
Old 17th September 2012, 06:12   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,555
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.

Last edited by sneaker_ger; 24th September 2012 at 12:04.
sneaker_ger is offline   Reply With Quote
Old 18th September 2012, 01:27   #7  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Quote:
Originally Posted by sneaker_ger View Post
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..
Foofaraw is offline   Reply With Quote
Old 18th September 2012, 07:13   #8  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,555
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.
sneaker_ger is offline   Reply With Quote
Old 19th September 2012, 02:18   #9  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Quote:
Originally Posted by sneaker_ger View Post
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.
Foofaraw is offline   Reply With Quote
Old 19th September 2012, 20:42   #10  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,957
25001/24000 not 24000/1001
Asmodian is offline   Reply With Quote
Old 20th September 2012, 00:01   #11  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Quote:
Originally Posted by Asmodian View Post
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.
Foofaraw is offline   Reply With Quote
Old 20th September 2012, 01:14   #12  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,957
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
Asmodian is offline   Reply With Quote
Old 20th September 2012, 01:38   #13  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Quote:
Originally Posted by Asmodian View Post
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.
Foofaraw is offline   Reply With Quote
Old 20th September 2012, 01:52   #14  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,957
Hmm, well 25 / (24000/1001) = 25025/24000 not 25001/24000 so that is probably it.
Asmodian is offline   Reply With Quote
Old 20th September 2012, 01:59   #15  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
Quote:
Originally Posted by Asmodian View Post
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
Foofaraw is offline   Reply With Quote
Old 20th September 2012, 02:07   #16  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,957
It really isn't black magic, sneaker_ger just forgot to multiply the 1 during 1001*25.

1.0427083333333333333333333333333 is more correct.
Asmodian is offline   Reply With Quote
Old 20th September 2012, 04:31   #17  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
How many decimals will it take?
Foofaraw is offline   Reply With Quote
Old 20th September 2012, 06:48   #18  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,957
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.
Asmodian is offline   Reply With Quote
Old 20th September 2012, 15:11   #19  |  Link
Foofaraw
Registered User
 
Join Date: Apr 2004
Posts: 126
sounds good
Foofaraw is offline   Reply With Quote
Old 24th September 2012, 12:05   #20  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,555
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.
sneaker_ger is offline   Reply With Quote
Reply

Tags
convert, ntsc, pal, sox

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 10:50.


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