Mopidy Raspberry Pi Cover Art

I’m using Mopidy on my Pi Zero with the web front end and even though there are images embedded into the music files, the images don’t appear. I should mention that these files are locally stored on the Pi.

I saw some similar issues on GitHub which go back to 2014, but I wondered if this had been resolved yet?

I did install try and install https://docs.mopidy.com/en/latest/ext/web/#mopidy-local-images but it delivered a huge bunch of errors during installation. I can paste this on PasteBin if that helps.

Thanks

Hi, I have looked online and can’t find an answer to this one. Any assistance much appreciated. Cheers

Hi. Which web frontend? Please post your mopidy config. Mopidy-local-sqlite will return image data and mopidy-musicbox-webclient (amongst others) will display it.

Hi. I’m using ‘Mopidy-MusicBox-Webclient’, I will post the config and the errors I get when installing https://docs.mopidy.com/en/latest/ext/web/#mopidy-local-images tonight.

I was able to fix the installation of Local Images by updating PIP

sudo apt-get remove python-pip

and

sudo easy_install pip

My problem now is that cover art is shown of MP3 files but not M4A files (although both file types play since I installed gstreamer1.0-plugins-bad. The images for M4A files (downloaded with get_iplayer) show when I play them in VLC.

This is the content of my mopidy config

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[local]
data_dir = /var/lib/mopidy/local
media_dir = /var/lib/mopidy/media

[m3u]
playlists_dir = /var/lib/mopidy/playlists

[http]
hostname = 0.0.0.0

[local]
library = images

Can anyone help with this? Should images be pulled from M4A files or does Local Images only support MP3? Thanks

Mopidy-Local-Images should support all file formats from which gstreamer can extract image metadata. I tested this with an .m4a file (AAC-encoded) I got from iTunes several years ago, and it was able to extract the embedded cover art:

$ mopidy -v local scan
...
INFO     2016-12-18 11:52:37,090 [4946:MainThread] mopidy.local.commands
  Scanning...
INFO     2016-12-18 11:52:37,114 [4946:MainThread] mopidy_local_images.library
  Creating file /home/tkem/.local/share/mopidy/local-images/caa787c8e4c83a25dcf40c5fe36300e9-600x600.jpeg
DEBUG    2016-12-18 11:52:37,116 [4946:MainThread] mopidy.local.commands
  Added local:track:The%20First%20Four%20Years/01%20-%20Nervous%20Breakdown.m4a
...

To check whether gstreamer is able to find an embedded image in a specific file, you may try

gst-launch-1.0 -v -t filesrc location=filename.m4a ! qtdemux ! fakesink

With the file above, this prints

FOUND TAG      : found by element "fakesink0".
   preview image: buffer of 160788 bytes, type: image/jpeg, width=(int)600, height=(int)600, sof-marker=(int)0

Thank you for replying.

This is what I get when I run that command, so it looks as though it has an image in it, but it’s still not being extracted

preview image: buffer of 4125 bytes, type: image/jpeg, width=(int)150, heigh$
QT atom: buffer of 25 bytes
container format: ISO MP4/M4A
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".

I then run sudo mopidyctl local scan and sudo service mopidy restart which results in:

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.c$
INFO     Starting Mopidy 2.0.1
INFO     Loading config from builtin defaults
INFO     Loading config from /etc/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Disabled extension alsamixer: Dependency The 'pyalsaaudio' distributio$
INFO     Enabled extensions: mpd, local-images, stream, m3u, material-webclient$
INFO     Disabled extensions: alsamixer
INFO     Found 12 files in media_dir.
INFO     Checking 12 tracks from library.
INFO     Removing 0 missing tracks.
INFO     Found 0 tracks which need to be updated.
INFO     Scanning...
INFO     Scanned 0 of 0 files in 0s.
INFO     Cleaning up image directory
INFO     Done scanning.

I checked the images directory again and I still only have the four for the MP3 files. The only odd thing I see is the message about alsa mixer.

I have installed what I think are all the gstreamer plugins needed with sudo apt-get install gstreamer0.10-plugins-bad gstreamer1.0-plugins-bad gstreamer0.10-plugins-ugly

This is the output of sudo mopidyctl config

pi@raspberrypi:~ $ sudo mopidyctl config
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging.conf

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[websettings]
enabled = true
musicbox = false
config_file = /etc/mopidy/mopidy.conf

[musicbox_webclient]
enabled = true
musicbox = false
websocket_host =
websocket_port =
on_track_click = PLAY_ALL

[material-webclient]
enabled = true
config_file = /etc/mopidy/mopidy.conf

[local-images]
enabled = true
library = json
base_uri = /images/
image_dir =
album_art_files =
  *.jpg
  *.jpeg
  *.png

[alsamixer]
enabled = false  ; Extension disabled by self check.

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist =
  listall
  listallinfo
default_playlist_scheme = m3u

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

[stream]
enabled = true
protocols =
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist =
timeout = 5000

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = /var/lib/mopidy/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs =
  $XDG_MUSIC_DIR|Music
  ~/|Home
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = images
media_dir = /var/lib/mopidy/media
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .png
  .txt

mopidyctl local scan will skip files already in the database, hence the

So your command didn’t actually do anything :wink:
Please run mopidyctl local clean first, or try mopidyctl local scan --force to re-import all files. If that would take too long, you may also try to explicitly touch filename.m4a, which should make sure that filename.m4a gets uptdated next time you do a local scan.

Thank you, doing that did re scan the files again but still no images. I have done some further testing and it’s not all .m4a files only certain ones. However they all show images in VLC.

Is there anywhere I could possibly privately upload the file to you, if you would be willing to test it on your set-up?