I would like to extract meta data from a MP3 file. This is going into a script, and I therefore want to do it from the command line. Since I have already installed ffmpeg, I thought I could use it for this purpose. I found here the following description:
Extracting an ffmetadata file with ffmpeg goes as follows:
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
I tried it like this:
ffmpeg -i InSpace.mp3 -f ffmetadata meta.txt
and found that it indeed created meta.txt with the required data, but also dumped the meta data in a different format to stderr, together with the error message Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used). In addition, it prints this pagination prompt to stderr:
Stream mapping:
Press [q] to stop, [?] for help
and then waiting for me to input something.
Of course I can get around this by writing the command as
ffmpeg -i InSpace.mp3 -f ffmetadata meta.txt </dev/null 2>/dev/null
but this looks pretty inelegant, and it also means that real error messages are also thrown away.
What did I do wrong? Or, is there a better way to extract the meta-data from the command line?
UPDATE:
Following the suggestion in the comment by gregg, I tried:
ffprobe -show_entries 'stream_tags : format_tags' InSpace.mp3
This also produced a lot of text on stderr (including such information like which gcc version was used to create the program), but also dumped the tags to stdout. Of course I can redirect the stderr to /dev/null again, and while the output format is slightly less convenient than the one produced by ffmpeg, getting the information on stdout is more flexible than the ffmpeg approach, which forces me to name a file for the tags. In this respect, I see ffprobe as an improvement over my approach to ffmpeg.
Nevertheless, I would like to understand why my ffmpeg command behaves in this way.
