All pastes #2090283 Raw Edit

gamontecarlo

public diff v1 · immutable
#2090283 ·published 2011-10-15 12:21 UTC
rendered paste body
--- mkvdts2ac3.sh	2011-10-14 19:26:47.000000000 +0200+++ mkvdts2ac3-ffmpeg.sh	2011-10-15 14:21:08.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 		;;@@ -352,7 +356,11 @@ 	checkdep mkvmerge 	checkdep mkvextract 	checkdep mkvinfo-	checkdep dcadec+	if [ $FFMPEG = 1 ]; then+		checkdep ffmpeg+	else+		checkdep dcadec+	fi 	checkdep aften 	checkdep rsync fi@@ -498,7 +506,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 +519,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