Page 2 of 2

Re: How do I best sync tracks with different, unknown tempo?

Posted: Sun Mar 02, 2014 3:49 pm
by Gale Andrews
Robert J. H. wrote:
Gale Andrews wrote:
Robert J. H. wrote:Or in the Nyquist Prompt (Effect menu):

Code: Select all

(resample s (* *sound-srate* (/ 24.101 25)))
This will shorten the sound (otherwise change 24.101 and 25).
It will also change the pitch.
This is intentional, in the case that the original speed should be achieved.
Yes, If the pitch actually is incorrect in the video to be speeded up.
Robert J. H. wrote:The Standards are:
- Ntsc 29.97
- Pal 25
- Film 24

The reduction by 1/1000 is normally used to convert from film to Ntsc.
Does your original Video have this intermediate frame-rate?
Theoretically, you have to speed up by 1/1000 to get a frame rate of 24 with the original pitch (as in the motion picture).
And then the sliding time/pitch shift to convert from 24 to 25 frames per second.
As I understand it, the 24/1.001 frame rate was a variant for colour compatibility. It all depends if the video that is at 24/1.001 is already pitch changed or not, however pitch differences between 24 and 24/1.001 are unlikely to be audible so probably not worth the extra step.


Gale

Re: How do I best sync tracks with different, unknown tempo?

Posted: Sun Mar 02, 2014 8:25 pm
by steve
"Frame rate" is about video, not audio. You can have two videos, one PAL and the other NTSC, both perfectly synchronised to identical audio tracks.
I presume that the synchronisation problem is because one of the audio files was not extracted correctly.
If the audio from a 1 hour NTSC video is extracted, the length of the audio should be exactly 1 hour.
If the audio from a 1 hour PAL video is extracted, the length of the audio should be exactly 1 hour.
So what went wrong?

Re: How do I best sync tracks with different, unknown tempo?

Posted: Sun Mar 02, 2014 9:36 pm
by Robert J. H.
steve wrote:"Frame rate" is about video, not audio. You can have two videos, one PAL and the other NTSC, both perfectly synchronised to identical audio tracks.
We know that.
It seems that the video frame rate is simply misinterpreted somehow.
The best would probably be to convert the video track itself in a suited editor.
At least if the audio doesn't show any pitch irregularity.

Re: How do I best sync tracks with different, unknown tempo?

Posted: Sun Mar 02, 2014 10:20 pm
by steve
Robert J. H. wrote:It seems that the video frame rate is simply misinterpreted somehow.
So the best solution would be to re-extract the audio from the video but do it without screwing up the sound and synchronisation.

Re: How do I best sync tracks with different, unknown tempo?

Posted: Mon Mar 03, 2014 11:51 am
by swaan
Thanks for all the help everyone.

Just to clear up a few things. Quote from Handbrake Framerate guide:
Back in the day, NTSC TV video was indeed 30fps. However, video hasn't "really" been 30fps since color TV broadcasts started. Before them it was 30000 frames for every 1000 seconds. But to accommodate the extra color information, the rate was very slightly dropped by stretching the frames to cover an extra second for every 1000 seconds, making it 30000/1001.

30fps == 30000/1001 == 29.97fps

24fps == 24000/1001 == 23.976fps
True, audio doesn't flow in frames per second and our only mission when doing A/V sync is to make sure the length of both audio and video match. Since video does consist of frames you could alter FPS to match audio without quality loss.

However when your (my) goal is to present an audio track that must line up with NTSC video - I have to do the work. The problem was that my audio was made for 25FPS PAL encoding and was originally faster (shorter in length) the desired than desired NTSC reference (sync). So both my PAL and NTSC audio tracks were at normal pitch.

True, video editors are up to the task of converting between those formats but I don't have a video stream, nor do I have software for it.

Hence, my problem was syncing two audio tracks of different length(leading,trailing silence) and tempo. I have them now synced using the change tempo tool by trial and error. By error I mean my math skills. NTSC*(100+4.0959..%) is not PAL-25fps. 4.2708333334376025..% is.


TL;DR: You can do it with the Change Tempo tool but you'd need a bit more precision than hundredths of seconds (wink at devs). Yes it accepts a greater precision but the measurement tools (seconds) also show only up to hundredths.

I also wish there was an option to mark cue-points to both tracks: point A1 is on track one where point A2 on track two. Point B1 is on track one where B2 is on track two and let it calculate the needed alignment and tempo change to sync them.

And finally: Thank you everyone involved in making Audacity a reality!

Re: How do I best sync tracks with different, unknown tempo?

Posted: Mon Mar 03, 2014 1:50 pm
by steve
swaan wrote:The problem was that my audio was made for 25FPS PAL encoding and was originally faster (shorter in length) the desired than desired NTSC reference (sync). So both my PAL and NTSC audio tracks were at normal pitch.
This is the part that I don't get.
Why are the PAL and NTSC versions different lengths? Which of them is the correct length?
If the NTSC version is the correct length, how was the audio in the PAL version shortened? Was it by removing bits of the audio, time stretching, or simply speeded up?
How do you know that the PAL version is the exactly correct pitch?

Re: How do I best sync tracks with different, unknown tempo?

Posted: Mon Mar 03, 2014 2:41 pm
by swaan
steve wrote: This is the part that I don't get.
Why are the PAL and NTSC versions different lengths? Which of them is the correct length?
If the NTSC version is the correct length, how was the audio in the PAL version shortened? Was it by removing bits of the audio, time stretching, or simply speeded up?
How do you know that the PAL version is the exactly correct pitch?
Both are correct :) You could say that the PAL version is "wrong" because the whole project (video) was sped up. There was no audio then. Audio was made for the "incorrect" PAL framing.

Re: How do I best sync tracks with different, unknown tempo?

Posted: Mon Mar 03, 2014 4:04 pm
by steve
OK, I see.
You can get it to within about 16 ms per 5 minutes if you use a Chain command http://manual.audacityteam.org/o/man/edit_chains.html
Here is a Chain text file that you can put in your Chains folder
NTSC-PAL.txt
(66 Bytes) Downloaded 108 times
To get it bang-on, you will need to add a few ms of silence every few minutes (about 16 ms per 5 minutes if I got the calculation right).

Re: How do I best sync tracks with different, unknown tempo?

Posted: Mon Mar 03, 2014 4:46 pm
by Gale Andrews
swaan wrote:You can do it with the Change Tempo tool but you'd need a bit more precision than hundredths of seconds (wink at devs). Yes it accepts a greater precision but the measurement tools (seconds) also show only up to hundredths.
Change Tempo is inaccurate due to limitations in the algorithm. If you want accuracy you must use Sliding Time Scale (and in my opinion it badly needs a "length" control like Change Tempo has, unless we give Change Tempo an option to use the slower/higher quality algorithm that Sliding Time uses).

You can right-click over the time digits in Selection Toolbar to change to highest precision (samples) formats, or to frames or other formats.
swaan wrote:I also wish there was an option to mark cue-points to both tracks: point A1 is on track one where point A2 on track two. Point B1 is on track one where B2 is on track two and let it calculate the needed alignment and tempo change to sync them.
Do you want to vote for this which is one feature request we have?
Time Stretching: mouse tools for both pitch-variable and pitch-constant time stretching
So if you had two different length tracks you would drag one to the end of the other to make the appropriate tempo or speed change.


Gale

Re: How do I best sync tracks with different, unknown tempo?

Posted: Mon Mar 03, 2014 9:54 pm
by swaan
Yes, selection toolbar gives me more precise options but what do I do with samples if,for example in Change Tempo I need to enter a percentage or seconds?

Yes I'd vote for that! That would make it more useful for making mixtapes. As long as I can see the waveforms while dragging. I'd love to get off the outdated MixMeister (one of a kind tool for timeline based DJing and mixtape creation). It's not as precise as my request but still a move in that general direction - I can't see working with long (music/beat-less) tracks unless you do it with markers as I mentioned.

Thanks for the chain tip, steve!