I'm trying to write a shell script that will extract the audio from all the movie files in a folder.
audio_extracter.sh
for f in *; do
if [ "$f" != "audio_extracter.sh" ]; then
/usr/bin/avconvert --source "$f" --output */Converted/"$f" --audioTrack -af aac
echo "$f converted"
else
echo "problems"
exit 1
fi
done
It's spitting back avconvert is a command line application that will transcode a source or group of sources to create a destination file output...
Also, if possible the script should find out the format of the audio in the video and extract it as such, without converting it to a different different format (at the moment I think I'm forcing it to convert to AAC).
Any thoughts on how to make this work?
-acodec copy extracts audio without re-encoding in ffmpeg:
for f in *.mkv; do ffmpeg -i "$f" -acodec copy "${f%mkv}aac"; done
You can see the formats of the audio streams with ffmpeg -i input.mkv.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With