I've written a bash script that extracts the audio out of a movie file and saves it out in separate .wav files using ffmpeg. Here is the key ffmpeg command:
Code:
ffmpeg -i $movie_file -vn -ss $start_time -t $duration ${file_name}_${counter}.wav
$start_time and $duration are floating point numbers that contain time information in the form of seconds and milliseconds (ss.xxx). It is important that I am able to control the time down to the millisecond.
My script works exactly as hoped on .avi files.
My script needs to work on an existing archive of .mov files. My problem is, when I try to use it on a .mov, the audio files created always have start times and durations that have been rounded up to the nearest half-second. This breaks up the audio in the wrong spots, and creates files that last too long and have too much extra audio.
What can I do to make my ffmpeg command create .wav files from .mov files that properly recognize a specific number of milliseconds? Or, asked another way, how can I eliminate the rounding behavior?
Thanks!
Bookmarks