To avoid multiple files being processed at the same time (which might use too many resources), use parallel
. By default, it only does one job at a time. If you want to use multiple CPU cores in parallel, try parallel -j 4 ...
for 4 jobs in parallel. Also check out man parallel
.
sudo apt-get install parallel
This line will extract aac
audio files from selected videos and put them into m4a
containers.
parallel avconv -i '{}' -map 0:1 -c:a copy '{.}.m4a' ::: %F
When working straight in the CLI, substitute%F
with the list of your input files. E.g. *.mp4
.
Inspired by this answer, by a previous answer to this question, and by evilsoup's comment to the latter (saying: 'raw aac files can't contain metadata; if you want to keep metadata from the original files then use m4a (which is just another name for mp4, but is fairly widely recognised by audio players) instead of aac as a file extension').
I use such commands in Thunar custom actions,
limiting the application to videos that contain aac
audio.
To have a terminal window open during processing, which closes at the end, the command can be changed like:
gnome-terminal -e "parallel avconv -i '{}' -map 0:1 -c:a copy '{.}.m4a' ::: %F"