Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Stretching audio track (Read 15396 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Stretching audio track

Hey everyone!

I got a movie which has an English audio track. I want to add to it another track.
The problem is the additional track I want to add is a few seconds shorter. (source FPS issue)

I tried audacity but I had no success on stretching those few seconds.

What program you would recommend do stretch the track length?

Thanks!

Stretching audio track

Reply #1
In fact the audio track I want to add is in AAC format.
I tried mkvtoolnix stretch option but I never can get the exact stretcth factor (float number).

 

Stretching audio track

Reply #2
SoX should be able to do that, check the speed and tempo options.
The speed factor is the ratio of your target video FPS to the FPS of the source from where you got the audio. As far as I gathered "speed" option changes both pitch and tempo (i.e. "no" (dep. on quality of the resampler) shifting of tones after speedup), while "tempo" alters just the tempo and keeps the pitch.

For example the frame rate of NTSC is 23.976 FPS, while PAL has 25 FPS, so the ratio in that case would be 23.976/25 = 0.9something.
It's only audiophile if it's inconvenient.

Stretching audio track

Reply #3
If its off sync you could simply adjust the audio delay for that track. But if its synced at the beginning and off sync at the end, then its probably because the audio has variable bit rate.

Stretching audio track

Reply #4
If its off sync you could simply adjust the audio delay for that track. But if its synced at the beginning and off sync at the end, then its probably because the audio has variable bit rate.

Are you suggesting that VBR tracks play at a variable speed?

Stretching audio track

Reply #5
If its off sync you could simply adjust the audio delay for that track. But if its synced at the beginning and off sync at the end, then its probably because the audio has variable bit rate.

Are you suggesting that VBR tracks play at a variable speed?

No but its common to have sync issues with vbr audio in avi container. Actually i had two things in mind when i said that, out of sync audio at the end of a video could be when fps is incorrectly specified.

Stretching audio track

Reply #6
Thanks everyone.

Just downloaded SOX.
As it have no gui and I'm a newbie, I will need some help on the -delay usage.
Will it work on AAC?

Actually is 4 minutes correction!!! (if it were just a few seconds i sure could use the delay option on mkv, but it isn't. It is a different source fps/framerate issue)

What command line options should i use to stretch this audio (2.0) in 4 minutes?

Thanks again!

Stretching audio track

Reply #7
What is the result when you simply add the audio without modification? If the 4 minutes missing are only the ending credits, for example, i don't see a problem with different length audio and video.

What part of the audio is missing, beginning or end?

EDIT: If you stretch the audio it will most likely cause sync problems. The video FPS doesn't affect the audio (unless it is incorrect), so for example you can convert a video from NTSC to PAL and still use the exact same audio file, because the frame rate doesn't affect the total length.

Stretching audio track

Reply #8
At the beggining the audio goes synced (first few minutes). As the movie plays it loses sync: the audio is left behind.

Stretching audio track

Reply #9
At the beggining the audio goes synced (first few minutes). As the movie plays it loses sync: the audio is left behind.

Is it actually 4 minutes off sync at the end or just a few seconds?

Stretching audio track

Reply #10
4min advanced

need to stretch it +4min

Stretching audio track

Reply #11
4min advanced

need to stretch it +4min

If the audio is ok at the beginning but 4 min in advance at the end, it means that somehow your muxer is stretching the audio to fit the video length.

Try adding 4 min silence at the end of your track to make it the same length as the original audio, then remux it. What mkv muxer are you using btw?

Stretching audio track

Reply #12
If the audio is ok at the beginning but 4 min in advance at the end, it means that somehow your muxer is stretching the audio to fit the video length.

?? If the audio is in advance at the end, how could it be getting stretched?

I think it's just a PAL/NTSC thing. He probably has the 23.976 fps movie, and wants to add a track that was demuxed/recorded from a PAL source.

To the OP, if the above is true, you need to watch out for the "PAL speedup" pitch. Most of the time 24 fps movies are just sped up to 25, and the audio gets a higher pitch. You might or might not have to correct that as well, that is, if it's an issue for you.

Stretching audio track

Reply #13
+1 for the pitch thing. It's very common for pal movies to simply have higher pitch and be shorter. So try that instead of stretching, because stretching can audibly affect the sound quality if its used too much.

Stretching audio track

Reply #14
because stretching can audibly affect the sound quality if its used too much.

So "can" pitching

(So much that it REALLY bothers me to watch PAL DVD's - Thank god Blu-ray fixed this)
Can't wait for a HD-AAC encoder :P

Stretching audio track

Reply #15
Indeed. It's about choosing the lesser evil, which is eventually also subjective.

Stretching audio track

Reply #16
I think it's just a PAL/NTSC thing. He probably has the 23.976 fps movie, and wants to add a track that was demuxed/recorded from a PAL source.

To the OP, if the above is true, you need to watch out for the "PAL speedup" pitch. Most of the time 24 fps movies are just sped up to 25, and the audio gets a higher pitch. You might or might not have to correct that as well, that is, if it's an issue for you.

It's not like I said that 10 posts ago including the solution and was ignored all the time.
It's only audiophile if it's inconvenient.

Stretching audio track

Reply #17
Well IMHO the easiest way to fix PAL speedup (or speeddown whatever is the issue) is using eac3to
Can't wait for a HD-AAC encoder :P

Stretching audio track

Reply #18
Can it resample to fix the pitch though? I imagine most audio editors have this option, though I've never tried it.

btw, odyssey, have you tried ReClock? It does this on-the-fly for PAL DVDs, changes both pitch and framerate to the original 24 fps.

Stretching audio track

Reply #19
I would use eac3to for this.  It can take basically any audio format known to man.  The command would be "eac3to "input.file" "output.file" -25.000 -changeto23.976"  That is for a movie that came as PAL (25 fps) and you are making the video into NTSC (24000/1001).  When they speed up audio for PAL, the pitch is higher, too.  They never bother to correct that, so when you slow it back down, it will be the original pitch.  If the source is originally PAL then the pitch will be lower than what it should be.

Stretching audio track

Reply #20
If the audio is ok at the beginning but 4 min in advance at the end, it means that somehow your muxer is stretching the audio to fit the video length.

?? If the audio is in advance at the end, how could it be getting stretched?

Because if audio is shorter than video, and audio plays till the end of video... it must be stretched, and the last samples will be in advance...

Guys, i get what you are all saying. That's exactly what I referred to when I wrote "fps is incorrectly specified". But, i don't think this should be an issue when properly muxing a proper rip.

FPS values should only affect the video, not the audio. Regardless of the video rate any audio track can be muxed with it, as a matter of fact audio rate is usually 48000 for dvd.

Try mkvtoolnix. Set the right fps value for video, and join any audio tracks worry-free, no stretching involved.

Stretching audio track

Reply #21
Btw one instance of PAL speedup is when you try playing 24 fps video on a device that only supports 25 fps, 4% speedup. On a pc or any modern digital device this is not a problem.

Stretching audio track

Reply #22
A sample rate of 46,034 will put the audio at NTSC from PAL, but that's not a standard rate.  Basically anything that can perform the conversion is going to change the sample rate to that, then upsample back to 48,000.

Stretching audio track

Reply #23
Please give me some feedback on mkvtoolnix, there is no use in altering the audio if using the matroska container.