Opened 7 years ago

Last modified 7 years ago

#6008 new defect

Problem attaching a picture to an mp3 with id3v2 version 4

Reported by: mitchbcn Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: mp3 id3v2
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I'm trying to attach a picture, tags and other operations to an mp3 file but with id3v2 version 4 doesn't works. The file is created without errors but without metada information and without the picture.

The same command with id3v2 version 3 it works fine

How to reproduce:

% ffmpeg -y -i podcast.mp3 -i homer.png -map 0 -map 1 -b:a 48 -ac 1 -metadata "album='Podcast'" -id3v2_version 4 -f mp3 test_portada.mp3
ffmpeg version 2.8.8-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mp3 @ 0xa995e0] Skipping 0 bytes of junk at 33.
[mp3 @ 0xa995e0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'podcast.mp3':
  Metadata:
    encoder         : Lavf52.64.2
  Duration: 01:11:10.52, start: 0.000000, bitrate: 48 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 48 kb/s
Input #1, png_pipe, from 'homer.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, pal8(pc), 251x201, 25 tbr, 25 tbn, 25 tbc
[libmp3lame @ 0xaad0c0] Bitrate 48 is extremely low, maybe you mean 48k
The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, mp3, to 'test_portada.mp3':
  Metadata:
    TALB            : 'Podcast'
    TSSE            : Lavf56.40.101
    Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, s16p, 0 kb/s
    Metadata:
      encoder         : Lavc56.60.100 libmp3lame
    Stream #0:1: Video: png, pal8, 251x201, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.60.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
  Stream #1:0 -> #0:1 (png (native) -> png (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=   33373kB time=01:11:10.52 bitrate=  64.0kbits/s
video:9kB audio:33364kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000793%

Command with version 3 that works fine

ffmpeg -y -i podcast.mp3 -i homer.png -map 0 -map 1 -b:a 48 -ac 1 -metadata "album='Podcast'" -id3v2_version 3 -f mp3 test_portada.mp3
ffmpeg version 2.8.8-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mp3 @ 0x26515e0] Skipping 0 bytes of junk at 33.
[mp3 @ 0x26515e0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'podcast.mp3':
  Metadata:
    encoder         : Lavf52.64.2
  Duration: 01:11:10.52, start: 0.000000, bitrate: 48 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 48 kb/s
Input #1, png_pipe, from 'homer.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, pal8(pc), 251x201, 25 tbr, 25 tbn, 25 tbc
[libmp3lame @ 0x26650c0] Bitrate 48 is extremely low, maybe you mean 48k
The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, mp3, to 'test_portada.mp3':
  Metadata:
    TALB            : 'Podcast'
    TSSE            : Lavf56.40.101
    Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, s16p, 0 kb/s
    Metadata:
      encoder         : Lavc56.60.100 libmp3lame
    Stream #0:1: Video: png, pal8, 251x201, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.60.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
  Stream #1:0 -> #0:1 (png (native) -> png (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=   33373kB time=01:11:10.52 bitrate=  64.0kbits/s
video:9kB audio:33364kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000793%

Attachments (3)

screenshoot_testportada_option3.PNG (39.1 KB ) - added by mitchbcn 7 years ago.
screenshoot_testportada_option3
screenshoot_testportada_option4.PNG (20.4 KB ) - added by mitchbcn 7 years ago.
screenshoot_testportada_option4
screenshoot_wmp.PNG (55.8 KB ) - added by mitchbcn 7 years ago.
screenshoot wmp

Download all attachments as: .zip

Change History (13)

comment:1 by Carl Eugen Hoyos, 7 years ago

Keywords: picture removed

Please test current FFmpeg git head to make this a valid ticket.

comment:2 by mitchbcn, 7 years ago

Thank you for your answer, I will try it tomorrow.

Last edited 7 years ago by mitchbcn (previous) (diff)

comment:3 by mitchbcn, 7 years ago

Hi,

With the last version of Github I have the same problem: with '-id3v2_version 4' option it doesn't works (tags and cover doesn't appears in the mp3 file) but with the '-id3v2_version 3' option it works fine.

Execution output

:$ ffmpeg -y -i podcast.mp3 -i homer.png -map 0 -map 1 -b:a 48 -ac 1 -metadata "album='Podcast'" -id3v2_version 4 -f mp3 test_portada.mp3
ffmpeg version N-82837-gb7e4ea0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-gpl --enable-libmp3lame --enable-nonfree --enable-parser=png --enable-decoder=png --enable-encoder=png
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 67.100 / 57. 67.100
  libavformat    57. 59.100 / 57. 59.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[mp3 @ 0x2c576c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'podcast.mp3':
  Metadata:
    encoder         : Lavf52.64.2
  Duration: 01:11:10.52, start: 0.000000, bitrate: 48 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 48 kb/s
Input #1, png_pipe, from 'homer.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, pal8(pc), 251x201, 25 tbr, 25 tbn, 25 tbc
[libmp3lame @ 0x2c6c3e0] Bitrate 48 is extremely low, maybe you mean 48k
The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, mp3, to 'test_portada.mp3':
  Metadata:
    TALB            : 'Podcast'
    TSSE            : Lavf57.59.100
    Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, s16p, 0 kb/s
    Metadata:
      encoder         : Lavc57.67.100 libmp3lame
    Stream #0:1: Video: png, pal8, 251x201, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.67.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
  Stream #1:0 -> #0:1 (png (native) -> png (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=   33373kB time=01:11:10.52 bitrate=  64.0kbits/s speed=72.1x
video:9kB audio:33364kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000793%

:$ ffmpeg -y -i podcast.mp3 -i homer.png -map 0 -map 1 -b:a 48 -ac 1 -metadata "album='Podcast'" -id3v2_version 3 -f mp3 test_portada.mp3
ffmpeg version N-82837-gb7e4ea0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-gpl --enable-libmp3lame --enable-nonfree --enable-parser=png --enable-decoder=png --enable-encoder=png
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 67.100 / 57. 67.100
  libavformat    57. 59.100 / 57. 59.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[mp3 @ 0x33af6c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'podcast.mp3':
  Metadata:
    encoder         : Lavf52.64.2
  Duration: 01:11:10.52, start: 0.000000, bitrate: 48 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 48 kb/s
Input #1, png_pipe, from 'homer.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, pal8(pc), 251x201, 25 tbr, 25 tbn, 25 tbc
[libmp3lame @ 0x33c43e0] Bitrate 48 is extremely low, maybe you mean 48k
The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, mp3, to 'test_portada.mp3':
  Metadata:
    TALB            : 'Podcast'
    TSSE            : Lavf57.59.100
    Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, s16p, 0 kb/s
    Metadata:
      encoder         : Lavc57.67.100 libmp3lame
    Stream #0:1: Video: png, pal8, 251x201, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.67.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
  Stream #1:0 -> #0:1 (png (native) -> png (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=   33373kB time=01:11:10.52 bitrate=  64.0kbits/s speed=70.9x
video:9kB audio:33364kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000793%


comment:4 by Carl Eugen Hoyos, 7 years ago

Please show the console output of the following test:

$ ffmpeg -i test_portada.mp3

comment:5 by mitchbcn, 7 years ago

Hi,

Output from file with '-id3v2_version 3' option:

ffmpeg version N-82837-gb7e4ea0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-gpl --enable-libmp3lame --enable-nonfree --enable-parser=png --enable-decoder=png --enable-encoder=png
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 67.100 / 57. 67.100
  libavformat    57. 59.100 / 57. 59.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mp3, from 'test_portada.mp3':
  Metadata:
    album           : 'Podcast'
    encoder         : Lavf57.59.100
  Duration: 01:11:10.55, start: 0.025056, bitrate: 64 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 64 kb/s
    Stream #0:1: Video: png, pal8(pc), 251x201, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Other
At least one output file must be specified


Output from file with '-id3v2_version 4' option:

ffmpeg version N-82837-gb7e4ea0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-gpl --enable-libmp3lame --enable-nonfree --enable-parser=png --enable-decoder=png --enable-encoder=png
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 67.100 / 57. 67.100
  libavformat    57. 59.100 / 57. 59.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mp3, from 'test_portada.mp3':
  Metadata:
    album           : 'Podcast'
    encoder         : Lavf57.59.100
  Duration: 01:11:10.55, start: 0.025056, bitrate: 64 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 64 kb/s
    Stream #0:1: Video: png, pal8(pc), 251x201, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Other
At least one output file must be specified


by mitchbcn, 7 years ago

screenshoot_testportada_option3

by mitchbcn, 7 years ago

screenshoot_testportada_option4

comment:6 by mitchbcn, 7 years ago

I attached two screenshoots of the files in Groove player.

comment:7 by Carl Eugen Hoyos, 7 years ago

The console output you posted seems to indicate that both output files do contain the image.

comment:8 by mitchbcn, 7 years ago

Yes, but in the screenshots you can see that Groove player doesn't show the picture and tags with the file generated with "-id3v2_version 4" option.

comment:9 by Carl Eugen Hoyos, 7 years ago

How do you know that this is not a bug in Groove player?
Did you test other players?

by mitchbcn, 7 years ago

Attachment: screenshoot_wmp.PNG added

screenshoot wmp

comment:10 by mitchbcn, 7 years ago

Hi Cehoyos,

You're right, I tryed another player (WMP) and I see the cover, but I can't see the Album tag in the file created with "-id3v2_version 4" option. I attached a screenshoot.

I have to assume that version 4 is not compatible with all the players and it's recommenden to use version 3?

If you want to analice the mp3 I upload it drobox, and you can access it with the following link
https://www.dropbox.com/sh/7og661kynew25yy/AAD_Fk40ofpuye6H8oFkcXeEa?dl=0

If you think that the problem is not related to ffmpeg tag function I'm ok to discard the case.

Thank you for your support.

Note: See TracTickets for help on using tickets.