IPB

Welcome Guest ( Log In | Register )

7 Pages V   1 2 3 > »   
Reply to this topicStart new topic
m-TAGS component (foo_tags), Support for m-TAGS metadata separation
luigimercurio
post Sep 24 2012, 03:51
Post #1





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



m-TAGS (foo_tags)

I created this for my own use. I am sharing it because if I have a need for it, maybe someone else does too....

The m-TAGS format offers a simple yet powerful solution to the media-metadata separation problem, which impacts the efficience of digital music collections and media distribution services alike. An m-TAGS file is media-independent. It just contains metadata (tags) describing a certain media source and a locator which identifies the source to which the metadata applies.

The format of an m-TAGS file is very simple. Each tag is represented by a pair "<tag name>" : "<tag value>", with the special "@" tag containing the location of the media resource. This format allows the defininion of any tag name and the assignment of any value to a tag. Support for multivalued tags is included, as well as for multi-part media indexing.

Download the component here: http://m-tags.org/foo_tags.dll

For additional information and technical details please visit http://m-tags.org


Usage

For a first "taste" of how the m-TAGS mechanism works, select File / m-TAGS / Create m-TAGS (in same folder) from the main menu. Then browse to a folder where you have some audio files and press OK.

A new file will be created in your folder, named !.tags. If you open this file with any text editor, you will see that it contains the metadata of your audio files in plain text. You can edit the metadata directly if you wish.

If you drop the file into a foobar2000 playlist, it looks like your audio files are loaded into the playlist, just as if you had dropped a playlist file. However, if you look at the properties of the playlist entries, you will notice that the !.tags file was loaded instead.

Your audio files will play normally, but any changes to the metadata will be reflected in the !.tags file, and NOT in the audio files. As long as you use m-TAGS files to load your music into foobar2000, your audio files will play normally, but they never be touched by foobar2000. They will be treated as "read-only" audio sources. Even the replaygain tags will be read and written from / to the !.tags file.

Note: keep in mind that also all move / copy / delete file operations will be performed on the m-TAGS files!

This post has been edited by luigimercurio: Sep 24 2012, 04:12
Go to the top of the page
+Quote Post
hyakukv
post Sep 24 2012, 05:01
Post #2





Group: Members
Posts: 8
Joined: 12-September 12
Member No.: 103106



Wow! I was just thinking of this today. What a coincidence.

This might be what I need. So this mod does not add any tags to the audio file at all? I needed a way to tag audio files but still continue seeding them to others.

This post has been edited by hyakukv: Sep 24 2012, 05:01
Go to the top of the page
+Quote Post
romor
post Sep 24 2012, 06:54
Post #3





Group: Members
Posts: 652
Joined: 16-January 09
Member No.: 65630



Interesting idea and great file format choice
foobar2000.org CSS rip? Funny

I tried it, and it crashed foobar without crash dump (latest foobar on XP up to date)
First crash was when I hit Cancel on opened dialog to browse for mtag location, and second time when I tried to access command from context menu. No third time, I removed it.

What I noticed in this small interval, is that it asks user to browse for location to save this mtag file, while I expected that this file should be placed in same folder as audio file(s) itself.
For me this is annoying in the same way as foobar' own cover embedding, when user has to browse for location and items source folder isn't considered - that's why I never use it.


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
tpijag
post Sep 24 2012, 12:56
Post #4





Group: Members
Posts: 2337
Joined: 19-May 08
Member No.: 53637



hyakukv

After reading the OP, are you really needing someone to spend time answering your question?
QUOTE
your audio files will play normally, but they never be touched by foobar2000. They will be treated as "read-only"

Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 13:12
Post #5





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (hyakukv @ Sep 24 2012, 05:01) *
Wow! I was just thinking of this today. What a coincidence.

This might be what I need. So this mod does not add any tags to the audio file at all? I needed a way to tag audio files but still continue seeding them to others.


No, it does not touch the audio files at all.

I do not understand what you mean when you say "seeding them to others", so I do not know if you can accomplish that.
Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 13:29
Post #6





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (romor @ Sep 24 2012, 06:54) *
Interesting idea and great file format choice
foobar2000.org CSS rip? Funny

I tried it, and it crashed foobar without crash dump (latest foobar on XP up to date)
First crash was when I hit Cancel on opened dialog to browse for mtag location, and second time when I tried to access command from context menu. No third time, I removed it.

What I noticed in this small interval, is that it asks user to browse for location to save this mtag file, while I expected that this file should be placed in same folder as audio file(s) itself.
For me this is annoying in the same way as foobar' own cover embedding, when user has to browse for location and items source folder isn't considered - that's why I never use it.


romor:

Thanks for taking the time to tell me about the crash.

When did you download the component? I had a name clash problem and I substituted the DLL last Saturday. It should (hopefully) work now: http://m-tags.org/foo_tags,dll.

If it still crashes (or if you'd rather not bother reinstalling it), then would you please be kind enough to let me know what components do you have installed? My "name clash" issue still produced crash reports, so the problem you experience may be a different one, after all.

-------------------

As for the file location, you can choose it to be the same one where the audio files are. In fact, this is how I use it myself, and that is why I created a menu item "Create m-TAGS (in same folder)" to do just that. The location you have to browse for is the location of the audio files. If you select the root folder where all your files are, then it will create m-TAGS files in all the subfolders where it finds audio files, i.e. you can "m-tag" your whole library "in-place" in one shot. Note that if you do that, then you should also change "Preferences / Shell Intagration / Restrict incoming files to" to "*.tags" (again, that is what I do myself). Otherwise if you drop a folder in foobar2000, then both the m-TAGS file(s) and the original media files will be loaded (i.e. all your files will be duplicated). This does not happen, of course if you choose a separate folder as the location of the m-TAGS files.

The reason that it asks you to choose a folder in the context menu is that in general you can select files from your playlist that are located in different folders. If they are all in the same folder, then you just have to select that folder.

This post has been edited by luigimercurio: Sep 24 2012, 13:37
Go to the top of the page
+Quote Post
romor
post Sep 24 2012, 13:47
Post #7





Group: Members
Posts: 652
Joined: 16-January 09
Member No.: 65630



That is the version I've tried, I downloaded it couple of minutes before reporting. It's bit exact with current link you posted
Don't know, but usually foobar catches the crash and creates dump. In both cases I experienced crash, crash files are created but empty.
I'll PM you my component list.

---
Great to learn about avoiding browse dialog, I guess I didn't have enough time to see everything wink.gif
Thanks


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
Kohlrabi
post Sep 24 2012, 13:52
Post #8





Group: Super Moderator
Posts: 954
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



QUOTE (luigimercurio @ Sep 24 2012, 14:12) *
QUOTE (hyakukv @ Sep 24 2012, 05:01) *
Wow! I was just thinking of this today. What a coincidence.

This might be what I need. So this mod does not add any tags to the audio file at all? I needed a way to tag audio files but still continue seeding them to others.

I do not understand what you mean when you say "seeding them to others", so I do not know if you can accomplish that.
It's a reference to online file sharing via BitTorrent, where you offer, or "seed", files to other users via a peer to peer network. This tool will save file sharers from having to create copies of their (likely ill-begotten) gains for tagging.

This post has been edited by Kohlrabi: Sep 24 2012, 13:54


--------------------
Audiophiles live in constant fear of jitter.
Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 15:01
Post #9





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE
It's a reference to online file sharing via BitTorrent, where you offer, or "seed", files to other users via a peer to peer network. This tool will save file sharers from having to create copies of their (likely ill-begotten) gains for tagging.


Yes, you can do that, although... you shouldn't !!!


As long you use m-TAGS, foobar2000 will leave the files alone when you change tags. Playback will work as usual.

This post has been edited by luigimercurio: Sep 24 2012, 15:01
Go to the top of the page
+Quote Post
Andreasvb
post Sep 24 2012, 18:15
Post #10





Group: Members
Posts: 1330
Joined: 6-March 04
From: Sweden
Member No.: 12509



Some things I've noticed:

- The sorting in EsPlaylist is very strange (using: %album% %date%. Sort incoming files: %path%).
- The !.tags-file only list the first track with ALBUM. I guess it only shows if a track differs from a tag, (to keep it smaller and more efficient, maybe?)

Found that Waveform Seekbar didn't displayed the waveform (with analyze tracks not in media library disabled). Adding !.tags in Restrict to under File types in Media Library solved it.


--------------------
Windows 8.1 Pro x64 Media Center // foobar2000 1.3.1
Go to the top of the page
+Quote Post
MrMonkey
post Sep 24 2012, 18:27
Post #11





Group: Members
Posts: 78
Joined: 22-August 10
Member No.: 83276



QUOTE (Kohlrabi @ Sep 24 2012, 08:52) *
It's a reference to online file sharing via BitTorrent, where you offer, or "seed", files to other users via a peer to peer network. This tool will save file sharers from having to create copies of their (likely ill-begotten) gains for tagging.

BitTorrent can be and is used to distribute music legally (e.g. etree.org) just as Foobar2000 is used to play and organize music regardless of the source. Both are tools that can be used as the user sees fit.
Go to the top of the page
+Quote Post
sevenarts
post Sep 24 2012, 20:09
Post #12





Group: Members
Posts: 16
Joined: 5-September 12
Member No.: 102912



This is a great concept, and one that I'd love to implement for my own collection.

One problem comes to mind immediately: no portable MP3 player currently supports this kind of tagging, so to really be useful to anyone with one of these devices, there'd have to be some kind of on-the-fly writing of ID3/whatever tags to files transferred to the player, the same way that lossless files are often transcoded to MP3 on the fly when transferring to a portable device that can't handle lossless codecs.

Go to the top of the page
+Quote Post
Kohlrabi
post Sep 24 2012, 20:09
Post #13





Group: Super Moderator
Posts: 954
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



QUOTE (MrMonkey @ Sep 24 2012, 19:27) *
QUOTE (Kohlrabi @ Sep 24 2012, 08:52) *
It's a reference to online file sharing via BitTorrent, where you offer, or "seed", files to other users via a peer to peer network. This tool will save file sharers from having to create copies of their (likely ill-begotten) gains for tagging.

BitTorrent can be and is used to distribute music legally (e.g. etree.org) just as Foobar2000 is used to play and organize music regardless of the source. Both are tools that can be used as the user sees fit.
I'm not blaming the protocol for its users, but I wanted to make sure that the most common use of it didn't go unmentioned.


--------------------
Audiophiles live in constant fear of jitter.
Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 20:58
Post #14





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (MrMonkey @ Sep 24 2012, 18:27) *
QUOTE (Kohlrabi @ Sep 24 2012, 08:52) *
It's a reference to online file sharing via BitTorrent, where you offer, or "seed", files to other users via a peer to peer network. This tool will save file sharers from having to create copies of their (likely ill-begotten) gains for tagging.

BitTorrent can be and is used to distribute music legally (e.g. etree.org) just as Foobar2000 is used to play and organize music regardless of the source. Both are tools that can be used as the user sees fit.


I agree. It was just a comment to the "ill-begotten" gains. :-)
Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 21:42
Post #15





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (Andreasvb @ Sep 24 2012, 18:15) *
Some things I've noticed:

- The sorting in EsPlaylist is very strange (using: %album% %date%. Sort incoming files: %path%).
- The !.tags-file only list the first track with ALBUM. I guess it only shows if a track differs from a tag, (to keep it smaller and more efficient, maybe?)

Found that Waveform Seekbar didn't displayed the waveform (with analyze tracks not in media library disabled). Adding !.tags in Restrict to under File types in Media Library solved it.


Andreas:

- I cannot be too specific about the esPlaylist issue, because I do not know what you mean for "strange". But maybe the following will help.

By default, m-tags generates ONE m-tags file per folder, and foobar2000 treats that as a multitrack file (with subindexes for each track). If you sort by %path%, your results may be "weird" because the %path% does not contain the track index. That is why it is recommended to always sort by %path_sort% (which understands indexes) rather than by %path% in foobar2000. If this is the problem, as I suspect, then you may avoid it either by changing the sorting rule from %path% to %path_sort%, or by cheking the option "Preferences / Advanced / Tagging / m-TAGS / Create a separate m-TAGS file for each source file". This way, rather than seeing a "!.tags" file, you should end up with one ".tags" file per audio file.

- You are right about your observation. The m-TAGS file obeys the following rule:

"If a tag set does not contain a tag, the value of that tag is the same as that tag's value in the previous set" (see http://m-tags.org/Overview.html)

That is because, conceivably, you could create an m-TAGS file manually and it would be quite tedious (and error-prone) to write the same things over and over.

- I do not know much about the Waveform Seekbar, but I am glad that the solution was simple.


Thanks a lot for the comments.

This post has been edited by luigimercurio: Sep 24 2012, 21:45
Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 21:56
Post #16





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (sevenarts @ Sep 24 2012, 20:09) *
This is a great concept, and one that I'd love to implement for my own collection.

One problem comes to mind immediately: no portable MP3 player currently supports this kind of tagging, so to really be useful to anyone with one of these devices, there'd have to be some kind of on-the-fly writing of ID3/whatever tags to files transferred to the player, the same way that lossless files are often transcoded to MP3 on the fly when transferring to a portable device that can't handle lossless codecs.


If you transcode your files before copying them onto the portable device, then you do not have a problem, because if you transcode a file loaded into foobar2000 via an m-TAGS file, then the transcoded (output) file will indeed contain the same tag values present in the m-TAGS file.

If you do NOT transcode, then you will have to copy the tags back into the media files. With foobar2000 you can do that by simply copying and pasting the tags from and to the respective "Metadata" tabs of the "Properties" window. You can also do it in batch (all-at-once).
Go to the top of the page
+Quote Post
Andreasvb
post Sep 24 2012, 22:51
Post #17





Group: Members
Posts: 1330
Joined: 6-March 04
From: Sweden
Member No.: 12509



Works with %path_sort%, thanks.


--------------------
Windows 8.1 Pro x64 Media Center // foobar2000 1.3.1
Go to the top of the page
+Quote Post
BenB
post Sep 24 2012, 23:03
Post #18





Group: Members
Posts: 627
Joined: 17-April 12
Member No.: 98921



I'll preface all of this by saying I use Columns UI.


Very promising plugin but it has issues with folders with names containing letters with diacritical marks or punctuation.

If said folder is opened as the source folder using File > m-TAGS > Create m-TAGS (in same folder), it will fail. (Interestingly, if you open a folder as source without diacritics in its name but containing subfolders that do have them, it works).

If said folder is opened as the source folder using File > m-TAGS > Create m-TAGS (in separate folder), it will fail to create a file but will create a destination folder with a name cut off at where it encounters diacritics or punctuation. (Unfortunately, I could only delete the folders using an elevated command prompt veryangry.gif I believe this may have been caused by selecting a destination folder which had diacritics in its name. I'm not really interested in trying to re-create this).

If contents of said folder are selected in a playlist by clicking on a Grouping or by selecting them, using right-click Tagging > Create m-TAGS file resulted in a file containing all tracks, all of which loaded and played in foobar if I selected a destination folder which didn't contain diacritics or punctuation in its name (Oddly however, it seems to cause foobar to immediately add the tags file to the library. I have to investigate this further to be sure). Selecting the contents folder as the destination folder results in failure to create a file but will create a destination folder (again with a name cut off at where it encounters diacritics or punctuation) in the parent folder (Luckily I was able to simply delete the folders).

Other things I noticed:

Using right-click Tagging > Create m-TAGS file in Album List Panel has varying degrees of success. Selecting various parent nodes usually resulted in 1) creation of a file containing all tracks of which either only the first album/folder or random tracks from various albums/folders loaded in foobar 2) creation of a file which either did not contain all tracks or did not contain all albums/folders 3) failure to create a file.

Selecting a parent Grouping (%album artist% in this case) in NG Playlist and using right-click Tagging > Create m-TAGS file resulted in a file that contained all tracks from all albums/folders, all of which loaded and played in foobar smile.gif.

A person cannot access network files/folders using File > m-TAGS > Create m-TAGS (in same folder) or File > m-TAGS > Create m-TAGS (in separate folder) if using a limited account.

One question:

I'm not too familiar with foobar. Is the file path not accessible for use with File > m-TAGS > Create m-TAGS (in same folder)? I'm wondering why one has to set the source and destination with this option.

EDIT:
I am using an administrative account on W7 64.

This post has been edited by BenB: Sep 25 2012, 00:01
Go to the top of the page
+Quote Post
luigimercurio
post Sep 24 2012, 23:49
Post #19





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



Ben:

The first problem (diacritical marks) should be fixed: http://m-tags.org/foo_tags.dll

It was due to the fact that I had removed the transcoding to UTF-8 of file paths selected through the main window (and that should also explain why diacritical marks were working in subdirs: they were still properly transcoded to UTF-8). UTF-8 transcoding is back.....

Thanks for pointing out the Album List panel issue. I had never used the file creator within that panel. I confirm the odd behaviour and I will look into it.

I am not sure about your comment on the "limited accounts". If you have a limited account on the network, then I assume it is just right that you cannot access the network files. Maybe I am not understanding, though....

Regarding your final question: Yes the file path is accessible, but the "Create m-TAGS (in same folder)" does not use information on the playlist or album list. They may be all empty, at that. The "right click" version uses the paths. The main menu commands can create m-TAGS files from a folder, traversing all the subdirectories, whatever this folder is. You can select your C:\ folder and it will create m-TAGS files for ALL your media in the C disk. Again, I hope I understood the question!

This post has been edited by db1989: Oct 27 2012, 16:21
Reason for edit: deleting pointless full quote of above post
Go to the top of the page
+Quote Post
luigimercurio
post Sep 25 2012, 00:55
Post #20





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (BenB @ Sep 24 2012, 23:03) *
Other things I noticed:

Using right-click Tagging > Create m-TAGS file in Album List Panel has varying degrees of success. Selecting various parent nodes usually resulted in 1) creation of a file containing all tracks of which either only the first album/folder or random tracks from various albums/folders loaded in foobar 2) creation of a file which either did not contain all tracks or did not contain all albums/folders 3) failure to create a file.


Ben:

It looks like foobar2000 does not like modeless operations when it comes to the album list handles. I changed the operation to modal (i.e. blocking) and it seems to work. The random results were due to f2k releasing the handle list before the operation was completed, with obvious random results.

You can download the (hopefully) fixed version: http://m-tags.org/foo_tags.dll

This post has been edited by luigimercurio: Sep 25 2012, 01:06
Go to the top of the page
+Quote Post
BenB
post Sep 25 2012, 01:25
Post #21





Group: Members
Posts: 627
Joined: 17-April 12
Member No.: 98921



Thanks for the UTF-8 fix. Good deal.

The network folders are accessible but not with your component via m-TAGS File menu entries. What I meant by "limited" account was someone using a Standard user account on their computer instead of an Administrator account. The dialog that opens when using m-TAGS File menu entries doesn't allow for choosing a source folder beyond the user account which renders them useless to a Standard user whose media is stored on the network. (Conversely, the dialog that opens when using m-TAGS right-click menu does allow one to select a destination folder on the network when using a Standard account).

Yes, you answered my question regarding Create m-TAGS (in same folder). Thank you.

EDIT:

The Album list issues appear to be gone. Thanks again for another fix.

This post has been edited by BenB: Sep 25 2012, 01:54
Go to the top of the page
+Quote Post
luigimercurio
post Sep 25 2012, 02:20
Post #22





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (BenB @ Sep 25 2012, 01:25) *
The network folders are accessible but not with your component via m-TAGS File menu entries. What I meant by "limited" account was someone using a Standard user account on their computer instead of an Administrator account. The dialog that opens when using m-TAGS File menu entries doesn't allow for choosing a source folder beyond the user account which renders them useless to a Standard user whose media is stored on the network. (Conversely, the dialog that opens when using m-TAGS right-click menu does allow one to select a destination folder on the network when using a Standard account).


Ben:

The main difference between the "context" operation and the "main menu" operations is that the first uses "GetSaveFileName" to browse for files, while the second uses "SHBrowseForFolder". It looks like something that works in the first does not work in the second. I am not a Windows networking super-expert, so you may know better than me. I played a bit with the BROWSEINFO flags used by SHBrowseForFolder and I changed them to "BIF_SHAREABLE | BIF_NEWDIALOGSTYLE | BIF_NONEWFOLDERBUTTON" (I had "BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_NONEWFOLDERBUTTON"). Alas, I have no way to test the changes on my network (everything works on mine). If you know what I should change, or if you can test the DLL with the new flags (http://m-tags.org/foo_tags.dll), I will welcome your help and feedback.
Go to the top of the page
+Quote Post
BenB
post Sep 25 2012, 04:50
Post #23





Group: Members
Posts: 627
Joined: 17-April 12
Member No.: 98921



No, I still cannot access network folders on the NAS from a Standard account. My knowledge is rather limited. I'm sorry I cannot help you beyond testing. Someone may be able to help you with the problem if you posted an inquiry in the Development forum.

I'm using W7 64 bit.

Go to the top of the page
+Quote Post
romor
post Sep 25 2012, 10:28
Post #24





Group: Members
Posts: 652
Joined: 16-January 09
Member No.: 65630



FYI I run m-tags in local encoding (reason: it does not crash here), but looking forward to working utf-8 version

Wanted to show off with this idea of storing foobar library data in portable format as json is, which can be handled by any decent environment or trivially converted to XML and what not
Check it out: http://nbviewer.ipython.org/url/dl.dropbox...nb/m-tags.ipynb


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
luigimercurio
post Sep 25 2012, 13:58
Post #25





Group: Developer
Posts: 49
Joined: 23-January 11
Member No.: 87562



QUOTE (romor @ Sep 25 2012, 10:28) *
FYI I run m-tags in local encoding (reason: it does not crash here), but looking forward to working utf-8 version

Wanted to show off with this idea of storing foobar library data in portable format as json is, which can be handled by any decent environment or trivially converted to XML and what not
Check it out: http://nbviewer.ipython.org/url/dl.dropbox...nb/m-tags.ipynb


The UTF-8 version is the currently downloadable one: http://m-tags.org/foo_tags.dll

You may very well have downloaded it already without knowing.

As for your python scripting demo, I find it very interesting. You point out that if the tags are in a single file, as opposed to "one-per-media-file", then things need to be approached differently. This is VERY MUCH the case, and it is because, by way of optimization, m-TAGS does not store all tag values for all entries, but "cascades" the values through the entries. This means that you would have to write a special algorithm to read the m-TAGS file.

I have the algorithm, of course. Let me know if you need it. But I wonder if I should add an option to create m-TAGS files WITHOUT cascading the values, for people who would like to take advantage of their JSON format for scripting. The inpact in space and loading time would probably be minimal anyway.

This post has been edited by luigimercurio: Sep 25 2012, 13:59
Go to the top of the page
+Quote Post

7 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th April 2014 - 22:42