]>
code.delx.au - transcoding/blob - fix-pal-speedup
3 # Many DVDs released in Australia are sped up from 24fps to 25fps.
4 # This script reverses the procedure, correcting the audio pitch.
5 # The video framerate is adjusted without re-encoding. The audio is slowed and
6 # normalised then re-encoded as mp3.
8 if [ -z "$1" -o -z "$2" ]; then
9 echo "Usage: $0 destdir infile [infile ...]"
19 for infile
in "$@"; do
20 outfile
="$destdir/$(basename "$infile")"
21 tmpdir
="$(tempfile -p 'pal-')"
24 if [ -f "$outfile" ]; then
25 echo "Not overwriting $outfile"
31 mplayer
-novideo -ao pcm
:file="${tmpdir}/audio.wav" -vo null
"$infile"
32 sox
"${tmpdir}/audio.wav" "${tmpdir}/audio-fixed.wav" speed "${SLOWDOWN}" gain
-n
33 lame
--preset standard
"${tmpdir}/audio-fixed.wav" "${tmpdir}/audio.mp3"
34 mkvmerge
-o "${outfile}" --default-duration "1:${FORCEFPS}fps" --no-audio "$infile" "${tmpdir}/audio.mp3"