[FFmpeg-user] ffmpeg Adding cover art to mkv file convert image to video stream

CMG DiGiTaL cmarciog at gmail.com
Thu Mar 3 12:24:17 EET 2022


hi,

why when I add a cover art to an mkv file does ffmpeg convert the image
into a video stream? What I want is for the image to be attached to the
file as mjpeg only!

Command used:
ffmpeg -i "input_without_cover.mkv" -i "cover_image.jpg" -map 0:0 -map 1 -c
copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v
comment="Cover (front)" "output_with_cover.mkv"


C:\Users\CMG\Desktop>ffmpeg -i "input_without_cover.mkv" -i
"cover_image.jpg" -map 0:0 -map 1 -c copy -id3v2_version 3 -metadata:s:v
title="Album cover" -metadata:s:v comment="Cover (front)"
"output_with_cover.mkv"
ffmpeg version 2022-02-28-git-7a4840a8ca-full_build-www.gyan.dev Copyright
(c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib
--enable-lzma --enable-libsnappy --enable-zlib --enable-librist
--enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth
--enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d
--enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e
--enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg
--enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r
--enable-libfreetype --enable-libfribidi --enable-libvidstab
--enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
--enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc
--enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc
--enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio
--enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libilbc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa
--enable-libbs2b --enable-libflite --enable-libmysofa
--enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, matroska,webm, from 'input_without_cover.mkv':
  Metadata:
    title           : Cuidado!
    ARTIST          : Lobão
    ALBUM           : CMG Clássicos Pop Rock Nacionais
    GENRE           : Clássico Pop Rock Nacional
    TKEY            : E m
    DATE            : 1988
    ENCODER         : Lavf59.17.102
  Duration: 00:03:26.63, start: 0.000000, bitrate: 322 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
    Metadata:
      ENCODER         : Lavc59.12
      DURATION        : 00:03:26.628000000
Input #1, image2, from 'cover_image.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 55354 kb/s
  Stream #1:0: Video: mjpeg (Baseline), yuvj420p(pc,
bt470bg/unknown/unknown), 1018x1023 [SAR 72:72 DAR 1018:1023], 25 fps, 25
tbr, 25 tbn
Output #0, matroska, to 'output_with_cover.mkv':
  Metadata:
    title           : Cuidado!
    ARTIST          : Lobão
    ALBUM           : CMG Clássicos Pop Rock Nacionais
    GENRE           : Clássico Pop Rock Nacional
    TKEY            : E m
    DATE            : 1988
    encoder         : Lavf59.17.102
  Stream #0:0: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp,
320 kb/s
    Metadata:
      ENCODER         : Lavc59.12
      DURATION        : 00:03:26.628000000
  Stream #0:1: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj420p(pc,
bt470bg/unknown/unknown), 1018x1023 [SAR 72:72 DAR 1018:1023], q=2-31, 25
fps, 25 tbr, 1k tbn
    Metadata:
      title           : Album cover
      COMMENT         : Cover (front)
      DURATION        : 00:00:00.040000000
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 Lsize=    8397kB time=00:03:26.62 bitrate=
332.9kbits/s speed=4.44e+03x
video:270kB audio:8071kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.667450%


display output_with_cover.mkv information in Mediainfo:

General
UniqueID/String                : 289631759593428790618744847619697652327
(0xD9E50C40DBA7AD4168888BDE2507B267)
CompleteName                : output_with_cover.mkv
Format/String                   : Matroska
Format_Version                : Version 4
FileSize/String                  : 8.20 MiB
Duration/String                  : 3 min 26 s
OverallBitRate/String        : 333 kb/s
Movie                                : Cuidado!
Encoded_Application/String       : Lavf59.17.102
Encoded_Library/String              : Lavf59.17.102
ErrorDetectionType          : Per level 1
ALBUM                            : CMG Clássicos Pop Rock Nacionais
ARTIST                            : Lobão
DATE                               : 1988
GENRE                            : Clássico Pop Rock Nacional
TKEY                               : E m

*Video*
ID/String                            : 2
Format/String                    : *V_MJPEG*
CodecID                            : *V_MJPEG*
Duration/String                  : 40 ms
Width/String                       : 1 018 pixels
Height/String                      : 1 023 pixels
DisplayAspectRatio/String          : 0.995
FrameRate_Mode/String            : Constant
FrameRate/String                       : 25.000 FPS
ColorSpace                       : YUV
Title                                   : Album cover
Default/String                    : No
Forced/String                    : No
colour_range                     : Full
matrix_coefficients            : BT.470 System B/G
Comment                          : Cover (front)

Audio
ID/String                        : 1
Format/String                    : MPEG Audio
Format_Version                 : Version 1
Format_Profile                   : Layer 3
Format_Settings                : Joint stereo
CodecID                            : A_MPEG/L3
CodecID/Hint                     : MP3
Duration/String                   : 3 min 26 s
BitRate_Mode/String          : Constant
BitRate/String                     : 320 kb/s
Channel(s)/String                : 2 channels
SamplingRate/String           : 44.1 kHz
Compression_Mode/String     : Lossy
StreamSize/String                   : 7.88 MiB (96%)
Encoded_Library/String           : LAME3.100ªªª ´ 3ß@è
Default/String                   : No
Forced/String                    : No

thanks
Clamarc


More information about the ffmpeg-user mailing list