-
Notifications
You must be signed in to change notification settings - Fork 0
/
aactoaacADTS
executable file
·40 lines (31 loc) · 1.07 KB
/
aactoaacADTS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Check if any input files are provided
if [ $# -eq 0 ]; then
echo "Please provide one or more input files."
echo "Usage: $0 <input_audio_file1> [input_audio_file2 ...]"
exit 1
fi
# Loop through all command-line arguments
for input_file in "$@"; do
# Check if the input file exists
if [ ! -f "$input_file" ]; then
echo "Error: File '$input_file' not found. Skipping."
continue
fi
# Get the base name of the file (without any extension)
base_name=$(basename "$input_file")
base_name="${base_name%.*}"
# Set the output filename
output_file="${base_name}.adts.aac"
echo "Converting $input_file to $output_file"
# Perform the conversion
ffmpeg -i "$input_file" -c:a copy -bsf:a aac_adtstoasc "$output_file"
# Check if the conversion was successful
if [ $? -eq 0 ]; then
echo "Conversion complete for $input_file. Output file: $output_file"
else
echo "Conversion failed for $input_file."
fi
echo "-----------------------------------"
done
echo "All conversions completed."