change wav, aiff or mov audio sample rate of MOV or WAV WITHOUT changing number of samples

StackOverflow https://stackoverflow.com/questions/15237612

Pergunta

I need a very precise way to speed up audio. I am preparing films for OpenDCP, an open-source tool to make Digital Cinema Packages, for screening in theaters. My source files are usually quicktime MOV files at 23.976fps with 48.000kHz audio. Sometimes my audio is a separate 48.000kHz WAV. (FWIW, the video frame rate of the source is actually 24/100.1 frames per second, which is a repeating decimal.)

The DCP standard is based around a 24.000fps and 48.000kHz program, so the audio and video of the source need to be sped up. The image processing workflow inherently involves converting the MOV to a TIF sequence, frame-per-frame, which is then assumed to be 24.000fps, so I don't have to get involved in the internals of the QT Video Media Handler.

But speeding up the audio to match is proving to be difficult. Most audio programs cannot get the number of audio samples to line up with the retimed image frames. A 0.1% speed increase in Audacity results in the wrong number of samples. The only pathway that I have found that works is to use Apple Cinema Tools to conform the 23.976fps/48.000kHz MOV to 24.000fps/48.048kHz (which it does by changing the Quicktime headers) and then using Quicktime Player to export the audio from that file at 48.000kHz, resampling it. This is frame accurate.

So my question is: are there settings in ffmpeg or sox that will precisely speed up the audio in a MOV or in a WAV or AIFF precisely? I would like a cross platform solution, so I am not dependent on Cinema Tools, which is only MacOS.

I know this is a LOT of background. Feel free to ask clarifying questions!

Foi útil?

Solução

sox input-file output-file speed 1.001001001001001

where files can be WAV or AIFF. Sox works out internally that the decimal is in fact 1000/999, so the timing adjustment is 100% accurate (and the resampling is high quality). Going the other way is of course

sox input-file output-file speed 0.999

FFmpeg can also do it accurately timewise, but its resampler has had some quality problems. Version 1.1 can use the sox resampler (see here: http://ffmpeg.org/trac/ffmpeg/wiki/FFmpeg%20and%20the%20SoX%20Resampler) but its probably simplest just to use sox.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top