5

The way I understand man avconv (version 9.16-6:9.16-0ubuntu0.14.04.1), the following command should convert input.ogg to output.mp3 and carry over metadata:

avconv -i input.ogg -map_metadata 0 output.mp3

It does not, however; ogginfo clearly shows the information (artist, album, title, ...) in input.ogg and id3info confirms that output.mp3 has empty (ID3) tags.

The same happens when converting ogg to flac, or (presumably) any combination of the formats.

Is my understanding of -map_metadata wrong? Is there a way to convert between formats and keep tags (without hardcoding like this)?

1 Answer 1

4

Following this answer on Stack Overflow, I tinkered around and found out that the correct parameter depends on the combination of input and output format/codec.

These combinations work as intended:

  • OGG → MP3: -map_metadata 0:s:0

  • FLAC → MP3: -map_metadata 0:g:0

  • FLAC → OGG: -map_metadata 0
    Using -codec libvorbis.

    In case your FLACs contains covers (as stream), add -vn to drop that stream (all video streams, really); the result is otherwise a broken file¹. See here for ways to add cover images back in later.

Since avconv is officially dead now, I'll note that the same options seem to work with ffmpeg (at least up to 3.4.8).


  1. According to some players, anyway. easyTag would log, "Ogg bitstream contains unknown data", and Android 12 would refuse to play the file, but VLC would see nothing wrong. So YMMV.
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.