cmus-notify icon indicating copy to clipboard operation
cmus-notify copied to clipboard

Configuration option enabling waiting for uncached album art

Open synackd opened this issue 4 years ago • 9 comments
trafficstars

According to the README:

the placeholder image is shown if art has not yet been cached (e.g. on first play of a file), this is because ffmpeg takes anywhere between 1-5+ seconds to perform the extraction, so whatever is available is shown instead of waiting an indeterminate amount of time

Would you consider adding a configuration option to allow waiting until ffmpeg has completed processing the cover art for uncached images? There could be a warning in the documentation about the delay when enabling this option.

synackd avatar Feb 07 '21 23:02 synackd

Sure, I can look into it this week. I've been thinking of adding some kind of precaching to solve the waiting problem, haven't settled on the best way to implement it but I'm thinking maybe based on playlists.

dcx86r avatar Feb 09 '21 19:02 dcx86r

Has there been a development on this?

tilleule avatar Apr 01 '22 17:04 tilleule

Has there been a development on this?

Not yet.

I'm planning to start on a rewrite the program soon, which will include a solution to this.

dcx86r avatar Apr 02 '22 19:04 dcx86r

That's great to hear, I like this useful tool. Thank you for your work.

Somehow, the album covers get cached per song and not per album, so every song of an album will display the album art only if called a second time (by pausing/resuming, for example). Is this the expected behaviour? I thought the cache would be per album, so that one song is enough to have the correct album art cached for the rest of the album's songs.

tilleule avatar Apr 02 '22 19:04 tilleule

That's great to hear, I like this useful tool. Thank you for your work.

Somehow, the album covers get cached per song and not per album, so every song of an album will display the album art only if called a second time (by pausing/resuming, for example). Is this the expected behaviour? I thought the cache would be per album, so that one song is enough to have the correct album art cached for the rest of the album's songs.

Thanks, I appreciate the feedback :)

Yes, unfortunately, the problem you mention is expected behavior. It is caused by the program not knowing about possible relationships between files, so ffmpeg is run to avoid making incorrect guesses.

The reason these relationships are difficult to predict is because of how inconsistent music metadata can be.

For the future I'm planning to use the Audio::Scan module to parse text metadata, as it supports a number of formats. That should improve the reliability of finding relationships between files.

dcx86r avatar Apr 02 '22 20:04 dcx86r

This sounds very promising. In the meantime, is there a way to run the cover generating script so it batch-creates and caches all covers in one go?

tilleule avatar Apr 03 '22 08:04 tilleule

This sounds very promising. In the meantime, is there a way to run the cover generating script so it batch-creates and caches all covers in one go?

Yes, that sounds like a good workaround. It is now available in the new testing branch.

To use it, first create and save a playlist file via cmus, then call from command line cmus-notify <filename> and it will start loading ffmpeg instances.

This was just hacked into the existing mess with minimal testing so there's nothing fancy like queuing, may hit resource limits trying to process too large a playlist...

dcx86r avatar Apr 03 '22 20:04 dcx86r

This worked like a charm, thank you!

tilleule avatar Apr 04 '22 16:04 tilleule

This worked like a charm, thank you!

I'm glad it's working for you, thanks for the feedback.

dcx86r avatar Apr 05 '22 00:04 dcx86r