I'm using ffmpeg to extract just the audio stream from a video file:
ffmpeg -i video.mp4 -vn -acodec copy audio.aac
This produces a clean audio file but without any metadata.
To add metadata, ffmpeg has a command line option:
ffmpeg -i video.mp4 -vn -acodec copy -metadata title="My Title" audio.aac
This runs without error, but when the output file is checked with ffprobe, it has no metadata tags at all.
If the output container is changed to mp4, the metadata can be set and appears in the output file:
ffmpeg -i video.mp4 -vn -acodec copy -metadata title="My Title" audio.mp4
Here's the interesting bit; if I use Banshee to edit the metadata of an existing .aac file, then use ffmpeg to process the file the same way, the original metadata is copied successfully to the new .aac file.
ffmpeg -i metadata.aac -vn -acodec copy audio.aac
but, attempts to change the metadata have no effect:
ffmpeg -i metadata.aac -vn -acodec copy -metadata title="My Title" audio.aac
So it seems the .aac container can hold metadata and ffmpeg can copy it from input to output, but can't alter it when the copy codec is used.
Does anyone know of a way to get ffmpeg to alter the metadata in an aac container without reencoding?
Alternately, is there another generic tool I could be using to set the metadata after the file has been processed?
Much thanks. Chris.