MP3
- https://trac.ffmpeg.org/wiki/Encode/MP3 - ffmpeg wiki
- https://ffmpeg.org/ffmpeg-all.html#libmp3lame-1 - ffmpeg with lame
Strip an MP3 of all metadata:
ffmpeg -i source.mp3 -write_xing 0 -id3v2_version 0 -map_metadata -1 -acodec copy no_metadata.mp3
Set metadata title:
ffmpeg -i source.mp3 -id3v2_version 3 -metadata title="Highway to Danger" -acodec copy title.mp3
Set title, album, artist, track number:
ffmpeg -i source.mp3 -id3v2_version 3 -metadata title="Highway to Danger" -metadata artist="Knight Rider" -metadata album="Read Along Books" -metadata track=1 -acodec copy metadata.mp3
Add cover art as well:
ffmpeg -i source.mp3 -i cover_art.jpg -acodec copy cover_art.mp3
Note that ffmpeg will convert the cover art to a PNG. If it already is one, you can can copy it directly:
ffmpeg -i source.mp3 -i cover_art.png -acodec copy -vcodec copy cover_art.mp3