Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Cover images not loaded for all albums
#1
I have created a music database consisting of music albums that live in separate directories on a USB stick, that is attached to the Raspberry that runs the Moode player. A cover art image is embedded in each mp3 file of the albums, but almost 50% of the albums do not show an image in the album view.

When taking a look into the  "/var/local/www/imagesw/thmcache" folder, one can see that placeholder images are stored for the files from which the covers could not be loaded.

I cleared and rebuilt the database and recreated the thumbnail cache a couple of times, but the issue remained unchanged. I also tried the different settings for the thumbnail resolutions plus a cache rebuild, but the same difference.
Since the covers show up in other players like VLC i. e., I wonder if there are some criteria that prevent certain covers from being pulled from the mp3 files?
Reply
#2
Your best bet is to zip up one of the files whose album cover is not shown and PM a download link to myself, @TheOldPresbyope and @Nutul. One of us will analyze the file.

You might also want to take a look at the statistics printed in the moOde log after the Thumbnail generator runs.

View the log by either SSH command

Code:
moodeutl -l
 
Or download it from the Logs section of System Config.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(05-07-2023, 10:49 AM)Tim Curtis Wrote: Your best bet is to zip up one of the files whose album cover is not shown and PM a download link to myself, @TheOldPresbyope and @Nutul. One of us will analyze the file.

You might also want to take a look at the statistics printed in the moOde log after the Thumbnail generator runs.

View the log by either SSH command

Code:
moodeutl -l
 
Or download it from the Logs section of System Config.


I've extracted the picture of a file with ffmpeg, which is an png file

Here's the meta data from the ffmpeg log:

###
  Metadata:
    title           : Show Me Something Good
    artist          : 23 Spirit
    album           : The Homegrown Edition
    track           : 1
    genre           : Pop/Funk
    iTunNORM        :  00000688 0000071E 00005784 0000692A 000349E7 000349E7 0000798F 00007AD3 00024A4D 0000FA28
    encoder         : Lavf58.45.100
    Stream #0:0: Video: png, rgb24(pc), 200x150 [SAR 2834:2834 DAR 4:3], q=2-31, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other
###

The log that I pulled with "moodeutl -l" didn't state any errors in the thumbnail section
Reply
#4
(05-09-2023, 07:03 PM)haeckse Wrote:
(05-07-2023, 10:49 AM)Tim Curtis Wrote: Your best bet is to zip up one of the files whose album cover is not shown and PM a download link to myself, @TheOldPresbyope and @Nutul. One of us will analyze the file.

You might also want to take a look at the statistics printed in the moOde log after the Thumbnail generator runs.

View the log by either SSH command

Code:
moodeutl -l
 
Or download it from the Logs section of System Config.


I've extracted the picture of a file with ffmpeg, which is an png file

Here's the meta data from the ffmpeg log:

###
  Metadata:
    title           : Show Me Something Good
    artist          : 23 Spirit
    album           : The Homegrown Edition
    track           : 1
    genre           : Pop/Funk
    iTunNORM        :  00000688 0000071E 00005784 0000692A 000349E7 000349E7 0000798F 00007AD3 00024A4D 0000FA28
    encoder         : Lavf58.45.100
    Stream #0:0: Video: png, rgb24(pc), 200x150 [SAR 2834:2834 DAR 4:3], q=2-31, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other
###

The log that I pulled with "moodeutl -l" didn't state any errors in the thumbnail section

I am not familiar with extracting the albumart with ffmpeg, so I cannot say if it looks into the vorbis comment or not; but it seems to me that the image is indeed encoded as a video stream...

Your best bet is, as @Tim Curtis said, to manage to send a non-working file to me, him and @TheOldPresbyope.
Reply
#5
(05-09-2023, 07:12 PM)Nutul Wrote:
(05-09-2023, 07:03 PM)haeckse Wrote:
(05-07-2023, 10:49 AM)Tim Curtis Wrote: Your best bet is to zip up one of the files whose album cover is not shown and PM a download link to myself, @TheOldPresbyope and @Nutul. One of us will analyze the file.

You might also want to take a look at the statistics printed in the moOde log after the Thumbnail generator runs.

View the log by either SSH command

Code:
moodeutl -l
 
Or download it from the Logs section of System Config.


I've extracted the picture of a file with ffmpeg, which is an png file

Here's the meta data from the ffmpeg log:

###
  Metadata:
    title           : Show Me Something Good
    artist          : 23 Spirit
    album           : The Homegrown Edition
    track           : 1
    genre           : Pop/Funk
    iTunNORM        :  00000688 0000071E 00005784 0000692A 000349E7 000349E7 0000798F 00007AD3 00024A4D 0000FA28
    encoder         : Lavf58.45.100
    Stream #0:0: Video: png, rgb24(pc), 200x150 [SAR 2834:2834 DAR 4:3], q=2-31, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other
###

The log that I pulled with "moodeutl -l" didn't state any errors in the thumbnail section

I am not familiar with extracting the albumart with ffmpeg, so I cannot say if it looks into the vorbis comment or not; but it seems to me that the image is indeed encoded as a video stream...

Your best bet is, as @Tim Curtis said, to manage to send a non-working file to me, him and @TheOldPresbyope.

Just to clarify, the file should be a complete, unaltered song file that is not showing album art in the Library.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
moOde provides a handy tool named mediainfo which works for a number of format types.

Here's the output I get for a valid MP3 file with a valid embedded cover image

Code:
pi@test:~ $ mediainfo '01 The Count 1.mp3'
General
Complete name                            : 01 The Count 1.mp3
Format                                   : MPEG Audio
File size                                : 1.83 MiB
Duration                                 : 3 min 13 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 64.0 kb/s
Album                                    : 1930-1932
Track name                               : The Count
Track name/Position                      : 01
Performer                                : Bennie Moten
Genre                                    : CLC
Recorded date                            : 1930
Cover                                    : Yes
Cover MIME                               : image/png
Comment                                  : CLC 591

Audio
Format                                   : MPEG Audio
Format version                           : Version 2
Format profile                           : Layer 3
Format settings                          : Joint stereo / Intensity Stereo + MS Stereo
Duration                                 : 3 min 13 s
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 22.05 kHz
Frame rate                               : 38.281 FPS (576 SPF)
Compression mode                         : Lossy
Stream size                              : 1.48 MiB (81%)


Here's the output from ffmpeg -i applied to the same file


Code:
pi@test:~ $ ffmpeg -i '01 The Count 1.mp3'
ffmpeg version 4.3.5-0+deb11u1+rpt3 Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 10 (Debian 10.2.1-6)
 configuration: --prefix=/usr --extra-version=0+deb11u1+rpt3 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-mmal --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --enable-sand --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil      56. 51.100 / 56. 51.100
 libavcodec     58. 91.100 / 58. 91.100
 libavformat    58. 45.100 / 58. 45.100
 libavdevice    58. 10.100 / 58. 10.100
 libavfilter     7. 85.100 /  7. 85.100
 libavresample   4.  0.  0 /  4.  0.  0
 libswscale      5.  7.100 /  5.  7.100
 libswresample   3.  7.100 /  3.  7.100
 libpostproc    55.  7.100 / 55.  7.100
[mp3 @ 0x55a8f06f70] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '01 The Count 1.mp3':
 Metadata:
   title           : The Count
   artist          : Bennie Moten
   track           : 01
   album           : 1930-1932
   date            : 1930
   genre           : CLC
   TLEN            : 193332
   comment         : CLC 591
 Duration: 00:03:13.44, start: 0.000000, bitrate: 79 kb/s
   Stream #0:0: Audio: mp3, 22050 Hz, stereo, fltp, 64 kb/s
   Stream #0:1: Video: png, rgb24(pc), 504x487 [SAR 2834:2834 DAR 504:487], 90k tbr, 90k tbn, 90k tbc (attached pic)
   Metadata:
     comment         : Other
At least one output file must be specified

Comparing the latter to your post, I'm puzzled that your output doesn't show any audio stream, only the stream for the cover image. However, you obviously elided a lot of the diagnostic output. Please don't do that if you intend us to guess what's wrong at a distance.

Regards,
Kent
Reply
#7
@Nutul @TheOldPresbyope thank you guys for looking into the issue. I have put a file whose album art does not show up here:


https://drive.google.com/file/d/1Lv_1sp2...share_link

A note that might be helpful: It's been many years since I sampled my CD collection, but I seem to remember that among other tools I used iTunes to sample a lot of CDs. I also added cover images to the songs with iTunes, which maybe is the reason that in some songs the album art images are strangely attached in mjpeg format:


Code:
Input #0, mp3, from '01 Wolken ziehen vorbei.mp3':
  Metadata:
    title           : Wolken ziehen vorbei
    artist          : 2raumwohnung
    album           : Es wird Morgen
    track           : 1
    genre           : Dance
    iTunNORM        :  000006AD 00000437 00004FCC 000033AA 0003EEFB 0003EEFB 00008000 00008000 000074A4 000092C1
  Duration: 00:04:36.17, start: 0.000000, bitrate: 89 kb/s
    Stream #0:0: Audio: mp3, 22050 Hz, stereo, fltp, 80 kb/s
    Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x600 [SAR 300:300 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other

Regards,
Andrea
Reply
#8
(05-10-2023, 07:02 AM)haeckse Wrote: @Nutul @TheOldPresbyope thank you guys for looking into the issue. I have put a file whose album art does not show up here:


https://drive.google.com/file/d/1Lv_1sp2...share_link

A note that might be helpful: It's been many years since I sampled my CD collection, but I seem to remember that among other tools I used iTunes to sample a lot of CDs. I also added cover images to the songs with iTunes, which maybe is the reason that in some songs the album art images are strangely attached in mjpeg format:


Code:
Input #0, mp3, from '01 Wolken ziehen vorbei.mp3':
  Metadata:
    title           : Wolken ziehen vorbei
    artist          : 2raumwohnung
    album           : Es wird Morgen
    track           : 1
    genre           : Dance
    iTunNORM        :  000006AD 00000437 00004FCC 000033AA 0003EEFB 0003EEFB 00008000 00008000 000074A4 000092C1
  Duration: 00:04:36.17, start: 0.000000, bitrate: 89 kb/s
    Stream #0:0: Audio: mp3, 22050 Hz, stereo, fltp, 80 kb/s
    Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x600 [SAR 300:300 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other

Regards,
Andrea

Hi,

I have tried several adjustments, to see what eventually was wrong, and found that the file uses a ID3v2.2.0 tag format.
I changed the track number to 2, then back to 1, and saved the changes (using Kid3), and this was enough to have Kid3 convert the TAG in ID3v2.3.0, and moOde is now happy displaying the album art.


It has also this (marked invalid by Kid3, probably unrecognised...) tag entry: iTunNORM, containing the following string:

00000688 0000071E 00005784 0000692A 000349E7 000349E7 0000798F 00007AD3 00024A4D 0000FA28

which gets into the COMMENT tag and may result annoying in the TAG view of moOde... Anyway, this is not the cause of the issue.


I'll have a look into the ID3 tag parser, to see if it is the library we use being not able to parse the v2.2.0 version, or just a flag looking specifically for a v2.3.0 and higher.

ETA:
Indeed, the Zend library ID3 parser wants either a version 3 or 4 tag:
Code:
if ($this->_header->getVersion() < 3 ||
           $this->_header->getVersion() > 4) {
           require_once 'Zend/Media/Id3/Exception.php';
           throw new Zend_Media_Id3_Exception
               ('File does not contain ID3v2 tag of supported version: v2.' .
                $this->_header->getVersion());
       }

and the file header is as follows (note 02 00 declaring a v2.2 version):

Code:
49 44 33 02 00 ...

The differences between v2.2.0 and v2.3.0+ render the two tags almost completely incompatible (the main thing being the frame identifiers 3 bytes long for v2.2.0, and 4 bytes long for v2.3.0+ requiring the whole set of frame parsers to be re-implemented or, in the best scenario, at least re-mapped), and, IMHO, it's not worth the effort of extending the library, also considering how easy it is to convert the tags themselves.


So, to be on the safest side, I suggest you convert all the tags to v2.3.0. Even better to v2.4.0, as it will allow for multiple genre tracks to be properly parsed and categorized by moOde, as I see from this file you probably are using.

I don't know what OS you are under (the tags suggest Win32), but you better search for command-line tools allowing for that, as it might be tedious to do it by hand on a graphical tool.
Reply
#9
A quick test and the error below from the thumb cache generator appears in the log.

Code:
20230510 074337 thumb-gen: Error: File does not contain ID3v2 tag of supported version: v2.2: USB/VFAT4/Haeckse/01 Show Me Something Good.mp3

The message is a bit misleading but as @Nutul showed, the file header specifies tag version 2.2 which btw is quite old and considered obsolete, but the id3 tag parsing library used by moOde supports only id3 version 2.3 or 2.4 which are the most widely used id3 tag formats. Note that adding id3v2.2.0 support to the parsing library is not feasible.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
(05-10-2023, 09:47 AM)Nutul Wrote:
(05-10-2023, 07:02 AM)haeckse Wrote: @Nutul @TheOldPresbyope thank you guys for looking into the issue. I have put a file whose album art does not show up here:


https://drive.google.com/file/d/1Lv_1sp2...share_link

A note that might be helpful: It's been many years since I sampled my CD collection, but I seem to remember that among other tools I used iTunes to sample a lot of CDs. I also added cover images to the songs with iTunes, which maybe is the reason that in some songs the album art images are strangely attached in mjpeg format:


Code:
Input #0, mp3, from '01 Wolken ziehen vorbei.mp3':
  Metadata:
    title           : Wolken ziehen vorbei
    artist          : 2raumwohnung
    album           : Es wird Morgen
    track           : 1
    genre           : Dance
    iTunNORM        :  000006AD 00000437 00004FCC 000033AA 0003EEFB 0003EEFB 00008000 00008000 000074A4 000092C1
  Duration: 00:04:36.17, start: 0.000000, bitrate: 89 kb/s
    Stream #0:0: Audio: mp3, 22050 Hz, stereo, fltp, 80 kb/s
    Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x600 [SAR 300:300 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other

Regards,
Andrea

Hi,

I have tried several adjustments, to see what eventually was wrong, and found that the file uses a ID3v2.2.0 tag format.
I changed the track number to 2, then back to 1, and saved the changes (using Kid3), and this was enough to have Kid3 convert the TAG in ID3v2.3.0, and moOde is now happy displaying the album art.


It has also this (marked invalid by Kid3, probably unrecognised...) tag entry: iTunNORM, containing the following string:

00000688 0000071E 00005784 0000692A 000349E7 000349E7 0000798F 00007AD3 00024A4D 0000FA28

which gets into the COMMENT tag and may result annoying in the TAG view of moOde... Anyway, this is not the cause of the issue.


I'll have a look into the ID3 tag parser, to see if it is the library we use being not able to parse the v2.2.0 version, or just a flag looking specifically for a v2.3.0 and higher.

ETA:
Indeed, the Zend library ID3 parser wants either a version 3 or 4 tag:
Code:
if ($this->_header->getVersion() < 3 ||
           $this->_header->getVersion() > 4) {
           require_once 'Zend/Media/Id3/Exception.php';
           throw new Zend_Media_Id3_Exception
               ('File does not contain ID3v2 tag of supported version: v2.' .
                $this->_header->getVersion());
       }

and the file header is as follows (note 02 00 declaring a v2.2 version):

Code:
49 44 33 02 00 ...

The differences between v2.2.0 and v2.3.0+ render the two tags almost completely incompatible (the main thing being the frame identifiers 3 bytes long for v2.2.0, and 4 bytes long for v2.3.0+ requiring the whole set of frame parsers to be re-implemented or, in the best scenario, at least re-mapped), and, IMHO, it's not worth the effort of extending the library, also considering how easy it is to convert the tags themselves.


So, to be on the safest side, I suggest you convert all the tags to v2.3.0. Even better to v2.4.0, as it will allow for multiple genre tracks to be properly parsed and categorized by moOde, as I see from this file you probably are using.

I don't know what OS you are under (the tags suggest Win32), but you better search for command-line tools allowing for that, as it might be tedious to do it by hand on a graphical tool.

Hi Al,

Thanks again for looking into it and finding the root cause.

As mentioned, back in days I've used many different tools for ripping my CDs on a Windows machine, which seemingly led to a pretty messed up audio library. The iTunNORM entry has been presumably created by iTunes and is somehow related to volume levels respectively normalisation. 

Anyways, the sad days of working on Windows machines are long over, so I will have a look for a neat command line tool to perform some batch conversion of the ID3 versions and structures.

Cheers,
Andrea
Reply


Forum Jump: