diff --git a/convert_only_audio_ddp5.1_768k.sh b/convert_only_audio_ddp5.1_768k.sh new file mode 100755 index 0000000..d9f2ae1 --- /dev/null +++ b/convert_only_audio_ddp5.1_768k.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Check if the input file is provided +if [ -z "$1" ]; then + echo "Usage: $0 input.mkv" + exit 1 +fi + +INPUT_FILE="$1" +OUTPUT_FILE="${INPUT_FILE%.*}_ddp.mkv" + +# Convert and retain all streams, adding a new DDP 5.1 audio track +ffmpeg -i "$INPUT_FILE" -map 0:v -map 0:a -map 0:a -map 0:s? -map 0:t? -c:v copy -c:a:0 copy -c:a:1 eac3 -b:a:1 768k -c:s copy "$OUTPUT_FILE" + +# Check if ffmpeg was successful +if [ $? -eq 0 ]; then + mv "$OUTPUT_FILE" "$INPUT_FILE" + echo "Conversion successful. Original file replaced." +else + echo "Conversion failed. Original file unchanged." + exit 1 +fi + diff --git a/downmix_only_audio_dd2.0_320k.sh b/downmix_only_audio_dd2.0_320k.sh new file mode 100755 index 0000000..5b33c6c --- /dev/null +++ b/downmix_only_audio_dd2.0_320k.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Check if the input file is provided +if [ -z "$1" ]; then + echo "Usage: $0 input.mkv" + exit 1 +fi + +INPUT_FILE="$1" +OUTPUT_FILE="${INPUT_FILE%.*}_dd2.0.mkv" + +# Convert and retain all streams, adding a new DD 2.0 audio track +ffmpeg -i "$INPUT_FILE" -map 0:v -map 0:a -map 0:a -map 0:s? -c:v copy -c:a:0 copy -c:a:1 ac3 -b:a:1 320k -ac 2 -c:s copy "$OUTPUT_FILE" + +# Check if ffmpeg was successful +if [ $? -eq 0 ]; then + mv "$OUTPUT_FILE" "$INPUT_FILE" + echo "Conversion successful. Original file replaced." +else + echo "Conversion failed. Original file unchanged." + exit 1 +fi + diff --git a/fix_font_mime_single_file.sh b/fix_font_mime_single_file.sh index cd942d0..4a86651 100755 --- a/fix_font_mime_single_file.sh +++ b/fix_font_mime_single_file.sh @@ -25,5 +25,11 @@ if [ $? -gt 1 ]; then echo "Error processing mime-type: font/ttf for $MKV_FILE" fi +mkvpropedit "$MKV_FILE" --attachment-mime-type "application/x-font-ttf" --update-attachment "mime-type:application/x-truetype-font" +if [ $? -gt 1 ]; then + echo "Error processing mime-type: application/x-truetype-font for $MKV_FILE" +fi + + echo "Finished processing $MKV_FILE"