1
1
i am trying to embed Album Art to a FLAC file with ffmpeg.
It seems that it cannot embed Album Art to a FLAC File and the file that is generated has zero length.
I know that you can put the image in the same folder as the FLAC file, but is there a way to embed it to a specific FLAC file ?
Thanks !
Command Line
ffmpeg.exe -y -i "C:\1\test112014\cd\1.flac" -i "C:\Users\alex\AppData\Local\Temp\cover.png" -map 0 -map 1 -c copy -id3v2_version 3 -write_id3v1 1 "C:\1\test112014\cd\1-with-album-art.flac"
Output
ffmpeg version N-60321-g4d7d9a5 Copyright (c) 2000-2014 the FFmpeg developers
built on Feb 2 2014 22:01:03 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 49.101 / 55. 49.101
libavformat 55. 29.101 / 55. 29.101
libavdevice 55. 7.100 / 55. 7.100
libavfilter 4. 1.102 / 4. 1.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, flac, from 'C:\1\test112014\cd\1.flac':
Metadata:
ALBUM : Chillout del Mar Ibiza Lounge Cafe
ARTIST : Chillarea
TITLE : Sunset - Miami Beach Mix
track : 01/20
DATE : 2013
ENCODER : Lavf55.29.101
Duration: 00:03:48.26, bitrate: 823 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Input #1, image2, from 'C:\Users\alex\AppData\Local\Temp\cover.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #1:0: Video: png, rgb24, 500x500 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
[flac @ 0430b7e0] only one stream is supported
Output #0, flac, to 'C:\1\test112014\cd\1-with-album-art.flac':
Metadata:
ALBUM : Chillout del Mar Ibiza Lounge Cafe
ARTIST : Chillarea
TITLE : Sunset - Miami Beach Mix
track : 01/20
DATE : 2013
encoder : Lavf55.29.101
Stream #0:0: Audio: flac, 44100 Hz, stereo
Stream #0:1: Video: png, rgb24, 500x500 [SAR 1:1 DAR 1:1], q=2-31, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred
1
Why not use metaflac? The command would be
– Vinayak – 2014-11-23T11:00:36.910metaflac.exe --import-picture-from cover.png audiofile.flac
I could be wrong, but it looks like FLAC files don't support multiple arbitrary streams. This is from flacenc.c
– Vinayak – 2014-11-23T11:10:46.177if (s->nb_streams > 1){ //print error }
as opposed tofor (i = 0; i < s->nb_streams; i++){ //proceed }
for mp3enc.c from FFMPEG's source code.1The cover image is not a stream but metadata. /edit: Oh yeah, also: FLAC does not use ID3 at all. So you cannot use an MP3 example and transfer it to FLAC. – Daniel B – 2014-11-23T11:53:03.833
@DanielB You're right, but I read about it being mentioned as a video stream in the comments of mp3enc.c, so I wasn't sure what to call it.
– Vinayak – 2014-11-23T12:59:23.393