All pastes #2090282 Raw Edit

gamontecarlo

public diff v1 · immutable
#2090282 ·published 2011-10-15 12:19 UTC
rendered paste body
--- mkvdts2ac3.sh	2011-10-14 19:26:47.000000000 +0200+++ mkvdts2ac3-ffmpeg.sh	2011-10-15 14:12:45.000000000 +0200@@ -63,6 +63,7 @@ 	echo "                      original matroska file. This overrides '-n' and" 	echo "                      '-d' arguments." 	echo "     -f, --force      Force processing when AC3 track is detected"+	echo "     --ffmpeg         Use ffmpeg instead of dcadec" 	echo "     -i, --initial    New AC3 track will be first in the file." 	echo "     -k, --keep-dts   Keep external DTS track (implies '-n')." 	echo "     -m, --nocolor    Do not use colors (monotone)."@@ -225,6 +226,9 @@ 		"-f" | "--force" ) # Test for AC3 track exits immediately.  Use this to continue 			FORCE=1 		;;+		"--ffmpeg" ) # Use ffmpeg instead of dcadec+			FFMPEG=1+		;; 		"-i" | "--initial" ) # Make new AC3 track the first in the file 			INITIAL=1 		;;@@ -355,6 +359,9 @@ 	checkdep dcadec 	checkdep aften 	checkdep rsync+	if [ $FFMPEG = 1 ]; then+		checkdep ffmpeg+	fi fi  # Added check to see if AC3 track exists.  If so, no need to continue@@ -498,7 +505,11 @@ # ------ CONVERSION ------ # Convert DTS to AC3 doprint $"Converting DTS to AC3."-doprint "> dcadec -o wavall \"$DTSFILE\" | aften - \"$AC3FILE\""+if [ $FFMPEG = 1 ]; then+	doprint "> ffmpeg -i \"$DTSFILE\" -acodec ac3 -ac 6 -ab 640k \"$AC3FILE\""+else+	doprint "> dcadec -o wavall \"$DTSFILE\" | aften - \"$AC3FILE\""+fi  dopause if [ $EXECUTE = 1 ]; then@@ -507,7 +518,12 @@ 	fi  	color YELLOW; echo $"Converting DTS to AC3:"; color OFF-	nice -n $PRIORITY dcadec -o $AUDIOMODE "$DTSFILE" | nice -n $PRIORITY aften -v 0 - "$AC3FILE"+	if [ $FFMPEG = 1 ]; then+		nice -n $PRIORITY ffmpeg -i "$DTSFILE" -acodec ac3 -ac 6 -ab 640k "$AC3FILE"+	else+		nice -n $PRIORITY dcadec -o $AUDIOMODE "$DTSFILE" | nice -n $PRIORITY aften -v 0 - "$AC3FILE"+	fi+	 	checkerror $? $"Converting the DTS file to AC3 failed" 1 	DTSFILESIZE=$($DUCMD "$DTSFILE" | cut -f1) # Capture DTS filesize for end summary