-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for external cover art #3056
Comments
You can do it with |
Yeah, exactly.. :/ Embedded cover art is handled so nicely; it would be great to be able to ~James On Sat, Apr 16, 2016 at 11:35 AM, V. Lang notifications@github.com wrote:
|
My idea is related but explained differently. I think it solves the same problem but allows for more uses: |
I don't know if the seek code was ever change or not but using --external-file does seem to work for me now. osc and seeking seems functional |
Im on master b0951d7 and playing an audio file with external album art with this command |
You also need --vid=1. |
Great! Thanks! |
seems fixed. |
So is it supposed to work now with |
no, you need to specify |
Is there some way to make it a default for audio in mpv config file? I'd like to reproduce vlc's behavior in this, without the need to make scripts or type that explicitly. Or may be such config option can be added if it doesn't exist yet? |
If you tag the audio file's metadata with cover art, mpv will open that up automatically. |
I guess it'd be possible to automatically pick up an external file, but not sure how popular this would be. (And whether people would come up with dozens of alternative filenames that would "need" to be loaded.) |
You mean to embed the image into the audio file? I've done that before, but it bloats the result, since you end up with the same image in each file from the album. |
I don't necessarily propose a given default, but just an ability to explicitly configure the name, that will be then picked up without extra parameters. I.e. something like this in mpv config file:
Whoever wants will be able to set it to whatever name they want. |
Yeah that's a valid point. I don't really care much about filesize myself, but it's certainly not very efficient. |
I found an edge case: I have albums made up of multiple FLAC files, all of them have the respective cover art embedded into them. When I open the album's Cue Sheet, the cover art in the FLAC files is ignored. For reference, I'm using the version currently available in Chocolatey, 0.32.0 built on Mon Jan 27 12:34:40 +08 2020. |
when I play a cuesheet it displays embedded images but it only displays the image in the first file. |
These are all edge cases and have nothing to do with the original case. |
Hm, putting this in config file works:
but it's also not correct for cases which already have an embedded cover for example and where you wouldn't have a cover file, so you'll get a message like:
What would be good to have is an option of using that only as a default and in case the file exists. Not as a mandatory option. |
I have been using a script with If you want to load the cover only when it exists, this will work: local utils = require 'mp.utils'
mp.register_event('file-loaded', function()
for _, track in pairs(mp.get_property_native('track-list')) do
if track.type == 'video' and not track.albumart then
do return end
end
end
local dir, _ = utils.split_path(mp.get_property('path'))
local cover = dir .. '/cover.jpg'
if file_exists(cover) then
mp.commandv('video-add', cover)
end
end)
function file_exists(name)
local file = io.open(name)
if file then
io.close(file)
end
return not not file
end If you don't want to override embedded cover arts, remove This seems to be the code VLC uses to load cover art: https://code.videolan.org/chouquette/vlc/-/blob/master/modules/meta_engine/folder.c |
Everyone here is suggesting hacks over hacks instead of helping with how this could be implemented properly and |
Picks up files like "cover.jpg". It's made part of normal external file loading, so I'm adding 3 new options that are direct equivalents for the options that control loading of external subtitle and audio files. Even though I bet nobody wants them and they just increase confusion... I guess the world is actually hell, so this outcome should be fine. It prefers non-specific external files like "cover.jpg" over embedded cover art. Not sure if that's wanted or unwanted. There's some pain over explicitly marking such files as external pictures. This is basically an optimization: in most cases, a heuristic would treat an image file loaded with --external-file the same (it's a heuristic because ffmpeg can't tell us whether something is an image or a video). However, even with this heuristic, it would decode the cover art picture again on each seek, which would essentially slow down seeking in audio files. This bothered me greatly, which is why I'm adding these additional options at all, and bothered with the previous commit. Fixes: #3056
There's now external cover art loading by default in git master, using a hard-coded list: https://github.com/mpv-player/mpv/blob/master/player/external_files.c#L45 Make new issues on problems. |
Picks up files like "cover.jpg". It's made part of normal external file loading, so I'm adding 3 new options that are direct equivalents for the options that control loading of external subtitle and audio files. Even though I bet nobody wants them and they just increase confusion... I guess the world is actually hell, so this outcome should be fine. It prefers non-specific external files like "cover.jpg" over embedded cover art. Not sure if that's wanted or unwanted. There's some pain over explicitly marking such files as external pictures. This is basically an optimization: in most cases, a heuristic would treat an image file loaded with --external-file the same (it's a heuristic because ffmpeg can't tell us whether something is an image or a video). However, even with this heuristic, it would decode the cover art picture again on each seek, which would essentially slow down seeking in audio files. This bothered me greatly, which is why I'm adding these additional options at all, and bothered with the previous commit. Fixes: mpv-player#3056
Oftentimes, music will have its cover art stored as
folder.jpg
orcover.jpg
either in its folder or in the parent folder (in the case of multi-disc albums), rather than separate copies of the cover art being embedded in each and every track in an album.MPV currently neither automatically detects these files (VLC currently does do this, though only for same-folder cover art) nor has even a flag to specify the location of external cover art. This means that to play a song with its cover art being displayed by the music playing window, it must be converted/muxed to a temporary file containing the audio and cover art in one.
It would be a nice feature if MPV supported external cover art at some level; if not by detecting
[Ff]older.jpg
/cover.jpg
, then at least by allowing a flag to be passed to specify the art to be displayed.The text was updated successfully, but these errors were encountered: