All pastes #2092535 Raw Edit

Anonymous

public diff v1 · immutable
#2092535 ·published 2011-10-22 13:17 UTC
rendered paste body
--- mkvdts2ac3.sh	2011-10-14 19:26:47.000000000 +0200+++ mkvdts2ac3-ffmpeg.sh	2011-10-22 14:24:43.000000000 +0200@@ -42,6 +42,7 @@ COMP="none" WD="/tmp" # Working Directory (Use the -w/--wd argument to change) DUCMD="$(which \du) -k"+FFMPEG=0  # Check for a .mkvdts2ac3.rc file in user's home directory for custom defaults if [ -f ~/.mkvdts2ac3.rc ]; then@@ -63,6 +64,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 +227,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,8 +357,12 @@ 	checkdep mkvmerge 	checkdep mkvextract 	checkdep mkvinfo-	checkdep dcadec-	checkdep aften+	if [ $FFMPEG = 1 ]; then+		checkdep ffmpeg+	else+		checkdep dcadec+		checkdep aften+	fi 	checkdep rsync fi @@ -498,7 +507,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 +520,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