]>
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 # volume 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")"
22 if [ -f "$outfile" ]; then
23 echo "Not overwriting $outfile"
28 tmpdir
="$(mktemp -d "${TMPDIR:-/var/tmp}/pal-XXXXXXXX
")"
29 mplayer
-novideo -ao pcm
:file="${tmpdir}/audio.wav" -vo null
"$infile"
30 sox
"${tmpdir}/audio.wav" "${tmpdir}/audio-fixed.wav" speed "${SLOWDOWN}" gain
-n
31 lame
--preset standard
"${tmpdir}/audio-fixed.wav" "${tmpdir}/audio.mp3"
32 trackid
="$(mkvmerge -i "$infile" | grep video | sed 's/^Track ID \(.\):.*$/\1/')"
33 mkvmerge
-o "${outfile}" --default-duration "${trackid}:${FORCEFPS}fps" --no-audio "$infile" "${tmpdir}/audio.mp3"