-
Notifications
You must be signed in to change notification settings - Fork 0
/
createFiles.sh
executable file
·60 lines (47 loc) · 2.21 KB
/
createFiles.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
# create multichannel files for different codecs, using 64kbps per channel
# Thomas Deppisch, 2020
outdir='./audio/'
mkdir $outdir
for numChannels in 1 2 3 4 5 6 7 8 9 10 16 24 25 31 32
do
echo 'current number of channels: '$numChannels
bitrate=$((numChannels * 64))
echo '\n OPUS \n'
ffmpeg \
-i './audio/'$numChannels'.wav' \
-n -ac $numChannels -c:a libopus -mapping_family 255 -b:a $bitrate'k' -vn $outdir'/'$numChannels'.opus'
# echo '\n OPUS in CAF \n' # -> does not work for > 2 channels
# ffmpeg \
# -i './audio/'$numChannels'.wav' \
# -n -ac $numChannels -c:a libopus -mapping_family 255 -b:a $bitrate'k' -vn $outdir'/'$numChannels'.caf'
# echo '\n OPUS in WebM \n' # -> same results as opus
# ffmpeg \
# -i './audio/'$numChannels'.wav' \
# -n -ac $numChannels -c:a libopus -mapping_family 255 -b:a $bitrate'k' -vn -f webm -dash 1 $outdir'/'$numChannels'.opus'
echo '\n AAC \n' # -> only up to 8 channels
ffmpeg \
-i './audio/'$numChannels'.wav' \
-n -ac $numChannels -c:a libfdk_aac -profile:a 'aac_low' -b:a $bitrate'k' -vn $outdir'/'$numChannels'.m4a'
# echo '\n HE-AAC \n' # -> same results as aac los
# ffmpeg \
# -i './audio/'$numChannels'.wav' \
# -n -ac $numChannels -c:a libfdk_aac -profile:a 'aac_he' -b:a $bitrate'k' -vn $outdir'/'$numChannels'_he.m4a'
# echo '\n HE-AAC v2 \n' # -> less support than aac_low
# ffmpeg \
# -i './audio/'$numChannels'.wav' \
# -n -ac $numChannels -c:a libfdk_aac -profile:a 'aac_he_v2' -b:a $bitrate'k' -vn $outdir'/'$numChannels'_he2.m4a'
echo '\n MP3 \n' # -> only working for mono/stereo
ffmpeg \
-i './audio/'$numChannels'.wav' \
-n -ac $numChannels -c:a libmp3lame -b:a $bitrate'k' -vn $outdir'/'$numChannels'.mp3'
echo '\n VORBIS \n'
ffmpeg \
-i './audio/'$numChannels'.wav' \
-n -ac $numChannels -c:a libvorbis -b:a $bitrate'k' -vn $outdir'/'$numChannels'.ogg'
echo '\n FLAC \n' # -> only up to 8 channels
ffmpeg \
-i './audio/'$numChannels'.wav' \
-n -ac $numChannels -c:a flac -ch_mode 'indep' -b:a $bitrate'k' -vn $outdir'/'$numChannels'.flac'
done
exit 0