ffmpegogg

ffmpeg convert audio to ogg and keep album cover


If I convert an audio file with an album cover thank's to:

ffmpeg -i sample1.flac -ar 48000 -vn -c:a libvorbis -b:a 320k sample1.ogg

My sample1.ogg file doesn't have any album cover. Is there a way to ask explicitly to ffmpeg to keep the cover ?


Solution

  • Sum up of answers I found: Remove the option -vn which means: no video, because thumbnail are frame of video. Use libtheora instead of libvorbis. If you get a bitrate error, remove option -b:a 320k. At the end we get:

    ffmpeg -i file.flac -c:v libtheora -q:v 10 -c:a libvorbis file.ogg
    

    This gives you a file with an audio and a video content.

    If you prefer to extract thumbnail in a separate file (to re-add it later for example), use:

    ffmpeg -i file.flac -an -vcodec copy thumbnail.jpg
    

    Thank's to Баяр Гончикжапов for his help and answers!