Opened 5 years ago

Closed 4 months ago

Last modified 2 months ago

#2798 closed enhancement (fixed)

Write cover art to mov files

Reported by: svnpenn Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

.m4a files support album art
.mp4 files support cover art

currently you can add the art in this way

atomicparsley infile.mp4 --artwork infile.png --overWrite

However once muxed with FFmpeg some changes happen

ffmpeg -i infile.mp4 -c copy -map 0 outfile.mp4
  1. The png stream changes from
png

to

png (m[0][0][0] / 0x006D)
  1. Thumbnail disappears, example http://superuser.com/a/524120
  1. If you open in VLC instead of just playing video it also opens a second window with the png
ffmpeg version N-37428-gf18d2df Copyright (c) 2000-2013 the FFmpeg developers
  built on May 23 2013 01:35:26 with gcc 4.8.0 (rubenvb-4.8.0)
  configuration: --enable-gpl --enable-libx264 --enable-nonfree --enable-libfdk-aac --arch=x86 --target-os=mingw32 --logfile=/dev/stdout --extra-ldflags=-static --cross-prefix=i686-w64-mingw32- --host-cc=i686-w64-mingw32-gcc
  libavutil      52. 28.100 / 52. 28.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 035e5f00] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 035e5f00] max_analyze_duration 5000000 reached at 5005031 microseconds
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'infile.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.4.101
  Duration: 00:01:00.06, start: 0.000000, bitrate: 4923 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1040 [SAR 1:1 DAR 24:13], 4019 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 47.95 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2: Video: png, rgb24, 1920x1040 [SAR 1:1 DAR 24:13], 90k tbr, 90k tbn, 90k tbc
[mp4 @ 035f65c0] track 1: codec frame size is not set
Output #0, mp4, to 'outfile.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.4.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1040 [SAR 1:1 DAR 24:13], q=2-31, 4019 kb/s, 23.98 fps, 16k tbn, 16k tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, 5.1(side), 384 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2: Video: png (m[0][0][0] / 0x006D), rgb24, 1920x1040 [SAR 1:1 DAR 24:13], q=2-31, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame= 1440 fps=0.0 q=-1.0 Lq=-1.0 size=   36097kB time=00:01:00.00 bitrate=4928.4kbits/s    

video:33241kB audio:2812kB subtitle:0 global headers:0kB muxing overhead 0.118462%

Change History (12)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords mov added

Is this problem reproducible with current git head?

comment:2 Changed 5 years ago by svnpenn

If it helps, I tested it again with

ffmpeg version N-54802-gfc6de70 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 18 2013 18:07:01 with gcc 4.7.3 (GCC)

same result. If need be I can build from HEAD and try again.

comment:3 Changed 5 years ago by jamal

mov/mp4/m4a muxer currently doesn't support cover art.
A patch that implements this was submitted to ffmpeg-devel a few weeks ago.

This is the thread: http://comments.gmane.org/gmane.comp.video.ffmpeg.devel/165509

comment:5 Changed 4 years ago by cehoyos

  • Priority changed from normal to wish
  • Status changed from new to open
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

comment:6 Changed 4 years ago by cehoyos

  • Summary changed from Unexpected behavior with cover art to Write cover art to mov files

comment:7 Changed 11 months ago by vitaly-zdanevich

Still no way to add a cover to the m4a?

comment:8 Changed 6 months ago by ocalvo

What is the current status of this issue?

comment:9 Changed 5 months ago by fabled

I am also interested to fix this, I just posted redesigned and greatly simplified patch against current git master: https://ffmpeg.org/pipermail/ffmpeg-devel/2018-March/227516.html

comment:10 Changed 4 months ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed

comment:11 Changed 2 months ago by svnpenn

This is not fixed - as the commit does nothing for M4A files:

[ipod @ 0000000000353bc0] Could not find tag for codec mjpeg in stream #1, codec
not currently supported in container

comment:12 Changed 2 months ago by fabled

Yes, it was omission in the original patch to not support m4a and m4v files. This has been fixed in commit 12205d2c896b7edbc929d4886e7bfda4b53538e5. Be sure to use '-c copy' or similar to make sure that ffmpeg does not try to transcode the cover image to H.264 which is not supported as cover image. Additional (relatively intrusive) changes would be needed to get the automatic transcoding codecs right.

Note: See TracTickets for help on using tickets.