Repository navigation
[API Request] Animated cover art (video sidecars for albums) #273
acealone
started this conversation in
API requests
Replies: 1 comment 1 reply
|
Hello! Thanks for he proposal. I have two remarks:
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Type of change
API extension
Proposal description
Apple Music ("motion artwork") and Spotify ("Canvas") show short looping videos in place of a still album cover. Self-hosted users have started collecting these for their own libraries: tools such as
fetchanimated(beets) andanimated-artwork-downloaderfetch Apple's motion artwork and put it next to the music.Right now there is no way to serve those files through the Subsonic API, so everyone converts them into animated WebP or GIF and serves them through
getCoverArt. That works, but it is the wrong format for this in every way that matters:MPMediaItemAnimatedArtwork) accepts only a local video file, not an animated image. An iOS client today has to download the WebP and re-encode every cover to H.264 on the device, which takes minutes of CPU time per album and runs on battery. Android and desktop clients would also rather hand a video to their native player than decode WebP frame by frame.This proposal adds an optional, separate endpoint for animated cover art, and a field on albums that tells clients whether one exists. Clients that don't know the extension behave exactly as before, and
getCoverArtstill returns the still image.Who benefits: clients with a Now Playing screen or Lock Screen integration (iOS, Android, desktop) and servers whose users already collect this artwork. Demand is spread across several places: navidrome/navidrome#3039, navidrome/navidrome#4790 and navidrome/navidrome#5862, and jeffvli/feishin#1156.
Backward compatibility impact
None. The extension adds a new endpoint and a new optional field.
getCoverArtis unchanged, including for servers that already pass animated WebP/GIF/APNG through it.Backward compatibility
API details
Extension
getOpenSubsonicExtensionslists{ "name": "animatedCoverArt", "versions": [1] }.New field on
AlbumID3(and onChild, taken from the song's album)animatedCoverArt: an array of the videos available for that album. The field is left out when there are none, so a client can check whether an album animates without an extra request.idgetAnimatedCoverArt. Should change when the file changes, so clients can cache by id.aspectRatio"W:H".1:1(square cover) and3:4(tall, full-screen) are the common ones; servers may report others.contentTypecodecsparameter (video/mp4; codecs="avc1.640028") so clients can skip what they can't decode.width,heightNew endpoint
getAnimatedCoverArtididfromanimatedCoverArt.Returns the file as it is stored, with the
Content-Typegiven above. Servers:Accept-Ranges: bytes), so clients can probe and stream.id, with the usual Subsonic error body.Authentication and authorization work as they do for
getCoverArt.How a server finds these files is up to the implementation and not part of the spec. The obvious approach for file-based servers is a sidecar next to the album, for example
cover-animated.mp4/cover-animated-3x4.mp4, matched the waycover.*is today.Guidance for clients (non-normative)
coverArtwhile the video loads, and wherever video is turned off (low data mode, reduced motion).Security impacts
getCoverArt. Ids are opaque and resolved by the server, so no client-supplied paths reach the filesystem.Potential issues
codecsincontentTypelets clients skip variants they can't play; H.264 is the safe default for anyone generating files.Alternative solutions
getCoverArt(for examplegetCoverArt?id=...&animated=true). Rejected: every client treatsgetCoverArtas returning an image, caches it as one and passes it to an image decoder. A parameter that sometimes changes the response to video is easy to get wrong on both sides. It also gives no way to ask whether an album animates without downloading it.getCoverArt, as some servers do now. Works for display, but has the size, quality and platform problems above. Clients that need video still have to encode it on the device.path. Works for one person's setup, but needs real paths to be exposed, a second authentication setup, and client code that is specific to one server.All reactions