]> code.delx.au - transcoding/commitdiff
fix-pal-speedup: use fdk aac encoder, no need for separate mplayer dump
authorJames Bunton <jamesbunton@delx.net.au>
Wed, 10 Feb 2016 10:49:35 +0000 (21:49 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Wed, 10 Feb 2016 10:49:35 +0000 (21:49 +1100)
fix-pal-speedup

index ab4949028287a9e1d9fb118ef64b83e4719cdd45..05a4b9aa8bcbb650160996a82ff4e7dd83e8ba2f 100755 (executable)
@@ -12,7 +12,7 @@ fi
 
 set -xe
 FORCEFPS="24"
-SLOWFILTER="-filter asetrate=46080,aresample=48000"
+SLOWFILTER="-filter asetrate=46080,aresample=osr=48000:resampler=soxr"
 
 function mux_replace_audio {
     local infile="$1"
@@ -23,36 +23,22 @@ function mux_replace_audio {
     mkvmerge -o "${outfile}" --default-duration "${trackid}:${FORCEFPS}fps" --no-audio "$infile" "$audiofile"
 }
 
-function extract_audio {
-    local infile="$1"
-    local outfile="$2"
-
-    mplayer \
-        -noconfig all \
-        -novideo \
-        -channels 8 \
-        -dumpaudio \
-        -dumpfile "$outfile" \
-        "$infile"
-}
-
 function encode_audio {
     ffmpeg \
         -i "$1" \
+        -vn \
         $SLOWFILTER \
-        -strict experimental \
+        -c:a libfdk_aac -vbr 3 \
         "$2"
 }
 
 function convert_file {
     local infile="$1"
     local outfile="$2"
-    local audio1="${tmpdir}/audio1.ac3"
-    local audio2="${tmpdir}/audio2.m4a"
+    local audiofile="${tmpdir}/audiofile.m4a"
 
-    extract_audio "${infile}" "${audio1}"
-    encode_audio "${audio1}" "${audio2}"
-    mux_replace_audio "${infile}" "${audio2}" "${outfile}"
+    encode_audio "${infile}" "${audiofile}"
+    mux_replace_audio "${infile}" "${audiofile}" "${outfile}"
 }