]>
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
6 # slowed, and encoded as AAC, preserving surround sound.
8 if [ -z "$1" -o -z "$2" ]; then
9 echo "Usage: $0 infile outfile"
15 SLOWFILTER
="-filter asetrate=46080,aresample=osr=48000:resampler=soxr"
17 function mux_replace_audio
{
22 local trackid
="$(mkvmerge -i "$infile" | grep 'Track ID.*video' | sed 's/^Track ID \(.\):.*$/\1/')"
23 mkvmerge
-o "${outfile}" --default-duration "${trackid}:${FORCEFPS}fps" --no-audio "$infile" "$audiofile"
26 function encode_audio
{
31 -c:a libfdk_aac
-vbr 3 \
35 function convert_file
{
38 local audiofile
="${tmpdir}/audiofile.m4a"
40 encode_audio
"${infile}" "${audiofile}"
41 mux_replace_audio
"${infile}" "${audiofile}" "${outfile}"
47 tmpdir
="$(mktemp -d "${TMPDIR:-/var/tmp}/pal-XXXXXXXX
")"
48 convert_file
"$infile" "$outfile"