You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
608 B
24 lines
608 B
#!/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
|
|
|