Closed xinyazhang closed 8 years ago
I'm fairly sure that it is possible to get the content of this "video" track, and it will be a simple JPEG file. But it's hard to say for sure without having the file.
Anyway, no, deadbeef can't read album art from mp4 files (yet). But should be possible.
After taking a look of the plugins there are two approaches to implement this.
The first one is to call ffmpeg to address this issue Pros: handles all formats, e.g. an MKV file with XviD video stream. (for real video stream I'm planning to sample an arbitrary frame) Cons: replying on ffmpeg to work, if user disabled or doesn't have ffmpeg then it doesn't work.
The other one is to relay the request to aac plugin, which parses the m4a file. Pros: Works fine for users who wants aac artwork support but doesn't have ffmpeg. Cons: only works for m4a files, only works for limited image formats.
I prefer the first one but OK with both. What do you think of it?
How about solution 3: call libmp4ff directly to get to the album art?
Do you have a real example of an audio file with album art encoded as a video stream?
Yes I have, but all of them are copyrighted, but I think I can craft one with iTunes.
Here it is: 01 Short1.m4a.zip
Crafted from MediaCoder Files Test 5, with a doge image from Google images.
Btw, solution 3 has the same pros and cons as solution 2.
Ah, so you're interested in supporting all the various containers, which in deadbeef are only supported by ffmpeg, right?
Then I don't see many other options, than exposing some sort of album art API from ffmpeg plugin.
I looked in your file -- the cover art image embedded in it is a regular PNG file, which could be loaded by album art plugin, if the offset was known (this can be relatively easily obtained via libmp4ff)
My motivation is to support artworks tagged by iTunes. However, the tricky part is, it seems iTunes prefers to store album artwork as a video track.
I tried to add cover arts to several mp3 files and ended up with getting an mp3 file with a video track.
I think I'll take the ffmpeg approach since it covers more cases.
How can you add a video track to a MP3 file?
[deleted the file]
There's a standard embedded APIC frame with PNG file in the ID3v2 tag of your MP3 file. I can't find any indication that this file contains a video track. BTW, deadbeef can read that.
Sorry, I should verify it before claiming.
It seems we only need to solve the m4a problem for now.
On Apr 15, 2016, at 12:49 AM, Alexey Yakovenko notifications@github.com wrote:
There's a standard embedded APIC frame with PNG file in the ID3v2 tag of your MP3 file. I can't find any indication that this file contains a video track.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub
Yes. And I think the best way to solve this is to use libmp4ff, and not ffmpeg.
I found the code is already there in libmp4ff, but failed to work due to a bug. I'll fix it later.
That's, unfortunately, the case with most of the functionality in libmp4ff.. Do you need any help with fixing the problem? I'm quite familiar with the code.
Thanks. I think I can do it.
Since we figured out that we're talking about only supporting album art in mp4 files -- this issue is a duplicate of #1038
I have several m4a files tagged by iTunes, but I found iTunes embedded cover artworks as the video track. For example, ffprobe outputs the following info for one of these m4a files.
Can we parse the video track and use its image as the artwork?
P.S. I'll handle this if nobody else are working on it.