Remove the first seconds (15 seconds in the example) of an audio file, without re-encoding, useful to remove silences at the beginning
ffmpeg -ss 00:00:15 -i {input} -c:a copy {output}
Convert m4a (or other format) to mp3. It's a bad idea, unless the input is flac or you need the file in mp3 for an old hardware player.
ffmpeg -i {input}.m4a -b:a 192K -vn {output}.mp3
Tag Music using ffmpeg
This Script modifies the file metadata taking three arguments: input filename, artist and title.
tag.sh
#!/bin/bash
ffmpeg -i "$1" -map_metadata -1 -c copy "$1_.opus"
rm "$1"
ffmpeg -i "$1_.opus" -metadata artist="$2" -metadata title="$3" -c copy "$2 - $3.opus"
rm "$1_.opus"
Example:
tag.sh "The Beatles - Yesterday.mp3" "The Beatles" "Yesterday"
Convert files in recursive directories
find . -type f -iname '*.opus' | xargs -I{} env i='{}' bash -c 'ffmpeg -i "$i" -vn "${i%.*}.flac"'
linux command music