0

I'm on 22.04 with Cinnamon but I have noticed this for a long time indeed with 20.04 and 18.04. When I open Files (Nautilus) and navigate to a directory that contains MP3 files, the thumbnails take ages to regenerate. Well that they are generic thumbnails. Has anyone else noticed this? Can someone shed some light on it? I don't really expect a solution but it will be nice to know why, and if a solution is available. My_music

5
  • 3
    You have .mp3 files, which contain audio, not any image that could generate thumbnails. Any thumbnail that are generated are actually downloaded from an album art cloud service. Cloud services usually want to limit the number of requests you are making. Someone can write an answer on how to change this limit at your own risk.
    – Daniel T
    Jan 20 at 21:29
  • @DanielT This is a misunderstanding at multiple levels. For clarification, mp3 id3 tags do support image data as of version 2.3 ( en.wikipedia.org/wiki/ID3 ) around 2000 and has been heavily used by media software on all platforms ever since. Note that id3v2+ tags are more system intensive to process as they are not a simple header with some light metadata, so that could be what the poster is asking for, given the language used.
    – orbatos
    Apr 14 at 19:32
  • What @Raffles appears to be asking is "Why does Nautilus take so long to display file type icons when that should be determined by filename." This is an entirely different question and is related to how Nautilus confirms file types using file headers.
    – orbatos
    Apr 14 at 19:32
  • @Raffles , please update your question to clearly state the issue.
    – orbatos
    Apr 14 at 19:33
  • @orbatos Its only the default MP3 thumbnails that are slow to display. I updated the question, I hope it is more clear now.
    – Raffles
    Apr 16 at 13:07

1 Answer 1

1

Add the album art to the actual files with ffmpeg.

ffmpeg -i "your_song.mp3" -i *png -map_metadata 0 -map 0 -map 1 -codec copy "your_song_with_cover.mp3"

Add art to the entire directory:

for f in *.mp3; do ffmpeg -i "$f" -i *png -map_metadata 0 -map 0 -map 1 -codec copy out-"${f#./}" && mv out-"${f#./}" "$f"; done

Here's a GUI you can use.

  • Adds artwork to a single file or all files in a folder.
  • Accepts PNG & JPG.
#!/bin/bash

yad --title="MP3 Album Art" --window-icon="applications-multimedia" --borders="15" \
--form --separator=" " --item-separator=" " --text-align="center" --image-on-top --image="insert-image" --text="Choose: File or Folder\nImage: PNG or JPG" \
--field=File:LBL "" \
--field="":FL \
--field=Folder:LBL "" \
--field="":DIR "" \
--field=Artwork:LBL "" \
--field="":FL \
--field="Backup?":CHK \
> /tmp/entries

if [ $? -ne 0 ]; then
    exit 1
fi

file_input=$(cat /tmp/entries | awk '{print $1}')
img_input=$(cat /tmp/entries | awk '{print $2}')
backup=$(cat /tmp/entries | awk '{print $3}')

if [[ $backup == TRUE ]]; then
    if [[ -d "$file_input" ]]; then
        cd "$file_input"
        mp3_files=$(find . -name "*.mp3")
        if [[ -n "$mp3_files" ]]; then
            tar cf "backup.tar" $mp3_files
        fi
    else
        cp "$file_input" "$file_input.bak"
    fi
fi

if [[ -n "$file_input" ]]; then
    if [[ ! -d "$file_input" ]]; then
        ffmpeg -i "$file_input" -i "$img_input" -map_metadata 0 -map 0 -map 1 -codec copy "out-${file_input##*/}" && mv "out-${file_input##*/}" "$file_input"
    else
        for file in "$file_input"/*.mp3; do
            ffmpeg -i "$file" -i "$img_input" -map_metadata 0 -map 0 -map 1 -codec copy "out-${file##*/}" && mv "out-${file##*/}" "$file"
        done
    fi
fi

rm /tmp/entries

exit 0

Save to: add_artwork.sh
Change mode: chmod +x add_artwork.sh
Run with: ./add_artwork.sh

6
  • Okay I got it, I make my own thumbnails and attribute them to the mp3 files. I've done this once before but with the GUI.
    – Raffles
    Jan 20 at 23:08
  • I made this script with had a few years back for ID3 editing. Here's the post. stackoverflow.com/a/54431638/7986904 Give me a second, I can update it to include album art.
    – JayCravens
    Jan 21 at 3:07
  • 1
    @Raffles There's a simple GUI to make it simple. Use sudo apt-get install yad ffmpeg for the dependencies.
    – JayCravens
    Jan 21 at 17:53
  • 1
    That's why I still answer down voted questions. I'm just trying to help someone in need, screw 'em. You're talking about using Linux on an Ubuntu forum. Umm. Yeah, exactly.
    – JayCravens
    Jan 21 at 23:17
  • 1
    @Raffles Accepting an answer will give you +2 reputation, exactly enough to offset the -2 from that one guy's downvote. Furthermore, deleting your answer will not help you avoid a question ban, and might even make the system more likely to issue one. If I were you, I would wait until at least a second downvote before I would delete a question
    – Daniel T
    Jan 22 at 10:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .