INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MC doesn't recognize FLAC embedded URL pictures  (Read 3497 times)

DarkSpace

  • Junior Woodchuck
  • **
  • Posts: 60
MC doesn't recognize FLAC embedded URL pictures
« on: June 06, 2015, 08:25:11 am »

A while ago, I found out about the possibility to store Cover Art in FLAC files also as a URL rather than to store the file itself. Further research showed that it should be possible to use relative paths to files on the computer itself instead of a URL pointing to some web address.
Unfortunately it seems that there are very few entries on the Internet about doing that (I found only the one I linked to), so I cannot be 100% certain that I Did It Right, but I created a very small sample file to try this out (it would be nice if I could explicitly tell software to use image A as cover without having to attach the whole image to every file, especially with multiple files), and I failed.
What I did was to encode 5 seconds of silence to FLAC, then remove all metadata blocks (except StreamInfo), and use that file as a base.
I then created a Picture block with its MIME set to '-->' and its data portion (supposedly) pointing to 'Protected Memory/background.png' [I chose nonstandard names to avoid accidental detection]. I made sure that in the audio file's folder, a directory called 'Protected Memory' exists and that it contains a file called 'background.png', which is a valid PNG image. I used dimensions 0x0 which I believe* to have seen used as default for 'unknown' in some files.
I tried encoding the filepath directly from UTF-8 into binary format, as well as URL-escaping [transforming any special characters into the %xx versions] the path before conversion into binary format, but none of the two worked. (Admittedly, there is nothing to escape in the example path, but I was going to test Unicode next…)
I tried both normal playback in MC without importing the file, and importing the file into my library, but both showed no cover.

I realize that using picture blocks with URLs is discouraged, but I reason that this is due to the likelihood of 'accidental' Internet access to arbitrary sites, so I see little harm in using it to (in the end) store images used as Album Art only once rather than in each file.

Are URL-based Pictures not supported in MC? If so, is there a possibility to support them?
Or did I do something wrong?
I'll gladly help in any way I can, just let me know what to do, please!

* I believe to have seen it because I don't remember which file(s) I've seen it use, and therefore can't just cough up samples. In fact, I'm reasonably certain, and could test this rather quickly if so requested.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #1 on: June 06, 2015, 10:03:20 am »

While I can appreciate the technical knowledge required to test this, why in the world would you want to do it??  You're just asking for trouble.  Images should be embedded inside of song files for the highest portability and concise representation of the data.  If you want them outside, have them in the file system, pointed to by your music player.

URLs for embedded images is at best questionable and at worst completely ridiculous.

Brian.
Logged

DarkSpace

  • Junior Woodchuck
  • **
  • Posts: 60
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #2 on: June 06, 2015, 10:52:47 am »

My reason is that, typically, I use the highest-quality images I can find of the covers. If those happen to be several MB each, and the album has, say, 12 tracks, then that is (assuming front, back, and disc label, 2 MB each file) 72 MB of storage space, 60 MB of which are wasted. Additionally, when storing the image files separately from the audio files, I can, should I wish to, look at them at my leisure without first having to extract them*. Plus, assuming that the bit about 0x0 resolution is true, I can simply switch one file on the HDD instead of rewriting all the affected audio tracks should I happen to find a higher quality version of whatever Album Art image I was previously using.

I just re-read my first post, and I realize that I probably didn't stress enough that I was asking whether this was (going to be) supported (and if, how), rather than requesting that it be supported.
Personally, I think it is rather fancy, and rather than embedding the images in each file (I've got some Albums with rather many tracks), I'd simply not embed the files. However, I occasionally reinstall my computer, and even though I can backup the library files, to me, it seems much cleaner to just rebuild the library and have the files magically point to their Album Art. (Plus, it's more portable across different OS than just copying the library files, while it still takes little storage space.)

* I could, of course, just embed the images into the files and store them on the HDD, but that, once again, takes away storage space. I'm not too dependent on space savings, but I'm also averse to wasting space just like that.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #3 on: June 06, 2015, 10:56:44 am »

I don't think it is supported, and I wouldn't expect it to be.
Opening arbitrary URLs listed in some music files also comes with a certain security risk.
Logged
~ nevcairiel
~ Author of LAV Filters

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #4 on: June 06, 2015, 11:20:45 am »

Opening arbitrary URLs listed in some music files also comes with a certain security risk.

Yep. That's a great way to take over someone's computer.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

DarkSpace

  • Junior Woodchuck
  • **
  • Posts: 60
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #5 on: June 06, 2015, 12:45:52 pm »

Opening arbitrary URLs listed in some music files also comes with a certain security risk.
Yep. That's a great way to take over someone's computer.
I know, and I'm aware of that. I'd only use it on purely private files, too.
using picture blocks with URLs is discouraged, but I reason that this is due to the likelihood of 'accidental' Internet access to arbitrary sites

I don't think it is supported, and I wouldn't expect it to be.
Thanks for the info. To be honest, I didn't think it was supported when my tests failed, and I reasoned it was precisely because of the loading of arbitrary data.
In case someone actually considers implementing this into MC, I've been thinking about not only making it an option, but to extend the option to include a setting that allows only access to local paths (not sure if/how that would work for files stored e.g. on a NAS, though. I suppose allowing only local paths is not an option in this case? </rambling>). Anyway, HA! As if, judging by the amount of results I got from Google when I searched for a solution! ;)

I just thought I should try, so that I wouldn't have to bite myself when I someday found out that it worked all along, or that I would have had but to ask…
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #6 on: June 06, 2015, 06:30:48 pm »

OP, you seem to have an X-Y problem.  It seems like just storing a single copy of the album art as "folder.jpg" in the folder with your files (instead of embedding) is the solution to your problem.  It would a) eliminate the storage redundancy and b) would allow for easy swapping out or viewing of album art. The files might "lose" their art if you moved them somewhere else piecemeal, but with your URL approach they'd lose it too.  

The folder.jpg approach also has the advantage of being supported by virtually every music player and device on the planet including MC. Personally, I'd never want to do anything other than embed the art in the files (certainty is lovely), but the "old way" of putting an image in the folder still works and actually appears to address all of your issues with embedding art.
Logged

SandsOfArrakis

  • Recent member
  • *
  • Posts: 35
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #7 on: June 07, 2015, 01:26:16 am »

OP, you seem to have an X-Y problem.  It seems like just storing a single copy of the album art as "folder.jpg" in the folder with your files (instead of embedding) is the solution to your problem.  It would a) eliminate the storage redundancy and b) would allow for easy swapping out or viewing of album art. The files might "lose" their art if you moved them somewhere else piecemeal, but with your URL approach they'd lose it too.  

The folder.jpg approach also has the advantage of being supported by virtually every music player and device on the planet including MC. Personally, I'd never want to do anything other than embed the art in the files (certainty is lovely), but the "old way" of putting an image in the folder still works and actually appears to address all of your issues with embedding art.

I've done this as well. Place the cover art picture in the same folder as the album. And have MC save the image to each of the tracks. Not only does MC recognize the album art. All the other music players I've tried over the years accept this as well, and show the covert art as well.
Logged

DarkSpace

  • Junior Woodchuck
  • **
  • Posts: 60
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #8 on: June 07, 2015, 04:19:50 am »

OP, you seem to have an X-Y problem.
Well, I do appear to have a disturbing tendency to overcomplicate problems before I find a (naturally overcomplicated) solution to them. ::) For what it's worth, I'm usually open to suggestions how to improve my solutions.

It seems like just storing a single copy of the album art as "folder.jpg" in the folder with your files (instead of embedding) is the solution to your problem.  It would a) eliminate the storage redundancy and b) would allow for easy swapping out or viewing of album art.
I've done this as well. Place the cover art picture in the same folder as the album. And have MC save the image to each of the tracks. Not only does MC recognize the album art. All the other music players I've tried over the years accept this as well, and show the covert art as well.
That's right, I haven't thought of the folder.{jpg|png|…} approach, thanks!
However, can that also somehow work when I have several images (e.g. front and back cover, several booklet scans, …), and how will I tell MC (or, better yet, any player) which image is which, and if necessary in which order (e.g. pages 1-5)?

The files might "lose" their art if you moved them somewhere else piecemeal, but with your URL approach they'd lose it too.
I actually consider this a non-issue, because when I think about how I'd move my files, I always reach the conclusion that moving/copying an entire folder structure is the simplest way. And I'd most likely store the image files close to the corresponding audio anyway (such as Disk1/, Disk2/ and Images/ or Album/ and Album/Images/).
In the case that I was moving files individually, I'd have to clean the files anyway, because already-processed files in my personal collection might contain all kinds of stuff that I find useful but that others don't (example: those image tags).
Logged

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #9 on: June 07, 2015, 03:23:23 pm »

BTW, there is also the aspect that if you are playing these files on a mobile device, then each URL - for some people - will add to their Data Used charges.  :o

Lastly, I have been using URLs since they were first created, and probably 90-99% of all URLs every made, now point to nothing.  ;D

So, it seems like a profoundly bad idea for many reasons.

DarkSpace

  • Junior Woodchuck
  • **
  • Posts: 60
Re: MC doesn't recognize FLAC embedded URL pictures
« Reply #10 on: June 07, 2015, 04:44:26 pm »

if you are playing these files on a mobile device, then each URL - for some people - will add to their Data Used charges.  :o

probably 90-99% of all URLs every made, now point to nothing.  ;D
Well, what I want to do is to use the URL feature to point to a relative path (e.g. files in an 'Images' subfolder) instead of accessing the Internet. I already acknowledged that accessing the Internet because some music file says so is a Bad Idea.

I have been using URLs since they were first created
Can you tell me whether that works in MC? And how did you create those URLs (just used a tagger - which one? metaflac? - or did you do it yourself - how? did you have to escape special characters, or does simply using a UTF-8-encoded string as the data section suffice?), even if now they point to nothing?
Logged
Pages: [1]   Go Up