LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 01-18-2012, 01:39 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
ID3 tags in FLAC files.


Hi: I have a set of FLAC files which includes a .nfo file saying:

Tags.................: ID3 v1.1, ID3 v2.3VorbisComment

I guess (wikipedia has a 24-hr blackout right now) each of the FLAC files of the set contains info about the performer, orchestra, and so on. But does the FLAC format support ID3 tags, if any tag at all? Because in the negative case, I would not bother to begin investigating how to extract the info.

EDIT
I ran 'metaflac --list foo.flac' and a part of the output was this:

Code:
METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 172
  vendor string: reference libFLAC 1.2.1 20070917
  comments: 7
    comment[0]: ARTIST=Unknown Artist
    comment[1]: TITLE=01. Kyrie - Gloria
    comment[2]: ALBUM=Unknown Title
    comment[3]: DATE=
    comment[4]: TRACKNUMBER=01
    comment[5]: GENRE=
    comment[6]: COMMENT=Track 1
METADATA block #3
  type: 1 (PADDING)
  is last: true
  length: 8192
Notice how the name 'VorbisComment' in the line at the beginning of this post reappears in this metadata block (VORBIS_COMMENT). Still, I have no right to think these metadata blocks are the ID3 tags mentioned in the .nfo file.

Last edited by stf92; 01-18-2012 at 03:07 AM.
 
Old 01-18-2012, 03:50 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
As I understand it, FLAC does not support ID3 in any way. It is part of an MP3 file only. FLAC tags are supported, which are, as you can see there, identical to Vorbis Tags, but they technically are not ID3 tags at all. You can naturally coalesce the data between the different comment mechanisms though.
 
Old 01-18-2012, 04:42 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thanks. I may add that one of the files is a .MD5 file. The file command, when run on it says

Code:
semoi@darkstar:/hdaal/mozart/Mozart Mass in C minor$ file 00.Wolfgang\ Amadeus\ Mozart.MD5 
00.Wolfgang Amadeus Mozart.MD5: MPEG ADTS, layer I, v1,  96 kBits, 32 kHz, Stereo
semoi@darkstar:/hdaal/mozart/Mozart Mass in C minor$
I think the file command guessed the wrong way. The file has size = 2.3K. But all MD5 files I have ever seen are ascii files. This is even more mysterious to me. Nevertheless, your post has made me walk the first step in the way to uncover it. Perhaps the explanation is simple: the person who authored the FLAC files had previously made MP3 files and made a mess of it all.

EDIT
This could help me clarify the mess. There are three times asociated with a file: atime, mtime, ctime.
Code:
    atime         time of last access
    mtime         time of last modification
    ctime         time of last status change
Which of these is shown by 'ls -l'? I'm not sure I'm interpreting ls manual correctly.

Last edited by stf92; 01-19-2012 at 02:08 PM.
 
Old 01-19-2012, 06:35 AM   #4
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,753

Rep: Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935
@ stf92- tried checking the MD5 checksum manually, rather than running it through a script?

I would guerss that whoever ripped the .flac files took a 'everything, including the kitchen sink' approach. ID3 v1.X, v2.X, and vorbis comments? Rendundant. Md5 checksum? Almost useless. Whoever ripped the file/files either doesnt know about the internal checksumming (better than MD5 in all ways IMO) or uploaded it to a site that requires ID3tags and MD5 checksumming, even in cases where it isnt needed. Seen it happen before, and I'll see it happen again.....

Quote:
Originally Posted by acid_kewpie View Post
As I understand it, FLAC does not support ID3 in any way. It is part of an MP3 file only. FLAC tags are supported, which are, as you can see there, identical to Vorbis Tags, but they technically are not ID3 tags at all. You can naturally coalesce the data between the different comment mechanisms though.
Depends on what you mean by 'supported'.

Flac files can be tagged with ID3 tags. It can cause problems with some decoders/players, and IMO there isnt any reason to use ID3 tags with flac, apart from album art.

Last edited by cascade9; 01-19-2012 at 06:37 AM.
 
Old 01-19-2012, 10:25 AM   #5
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,186

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
Quote:
Originally Posted by cascade9 View Post
Flac files can be tagged with ID3 tags. It can cause problems with some decoders/players, and IMO there isnt any reason to use ID3 tags with flac, apart from album art.
Files encoded in FLAC these days do not even need ID3 for album art, they shouldn't. I have always had album art displayed while listening to music encoded in FLAC. Just make sure you have a cover.jpg file in the directory and you're good.
 
Old 01-19-2012, 11:17 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
id3 tags can be theoretically added to just about anything, as it's just a block of metadata tacked onto the end of the file. Some encoders decided to add id3 tags to flac files in the early days of the codec, before the flac comment format was finalized, and even now you'll still sometimes find ones with them.

Unfortunately most player and transcoding programs choke in some way when they find an id3-included flac file, so they need to be removed/converted to flac format first.

I've found that the easytag tag editor is one of the best ways to deal with these. Turn off the "id3 for flac" setting in the preferences, and it will rewrite the data into flac comments.
 
Old 01-19-2012, 02:03 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
How interesting.

The last track of certain audio CD (CDDA) originated from a set of FLAC files, is not seen by some players but is visible for some others. I guess, from your remark,
Quote:
Unfortunately most player and transcoding programs choke in some way when they find an id3-included flac file, so they need to be removed/converted to flac format first.
that there was some trouble in the transcoding stage. Getting this easytag may therefore be a solution. The set of FLAC files I mentioned above and the "invisibility" issue is what made get the set of FLAC files one of whose metadata blocks is shown in post #1. But only to fall into the metadata issue!

@cascade9:
but when did you see an MD5 file which was not an ascii file? I can't understand who generated the file. And of course, the file command could never say a binary file is an MD5 file; its confusion is understandable.

I think this filename extension is the result of the uploader or I having renamed the file.

Last edited by stf92; 01-19-2012 at 02:19 PM.
 
Old 01-22-2012, 12:46 AM   #8
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,753

Rep: Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935
Quote:
Originally Posted by Jeebizz View Post
Files encoded in FLAC these days do not even need ID3 for album art, they shouldn't. I have always had album art displayed while listening to music encoded in FLAC. Just make sure you have a cover.jpg file in the directory and you're good.
That works for a lot of the computer media players, but not with most portable media players. Not that adding an ID3 v2.X tag with album art will work with most portable media players anyway.......

As an aside, I _hate_ 'cover.jpeg'. I always use 'artist-album-XXXxXXX'(eg, 'Miserylab-From.Which.No.Light.Escapes-485x480.png'). I also prefer .png if I can find the album art in that format.

Quote:
Originally Posted by stf92 View Post
How interesting.

The last track of certain audio CD (CDDA) originated from a set of FLAC files, is not seen by some players but is visible for some others. I guess, from your remark,


that there was some trouble in the transcoding stage. Getting this easytag may therefore be a solution. The set of FLAC files I mentioned above and the "invisibility" issue is what made get the set of FLAC files one of whose metadata blocks is shown in post #1. But only to fall into the metadata issue!

@cascade9:
but when did you see an MD5 file which was not an ascii file? I can't understand who generated the file. And of course, the file command could never say a binary file is an MD5 file; its confusion is understandable.

I think this filename extension is the result of the uploader or I having renamed the file.
I'm fairly sure I've seen a binary MD5 checksum before. Been a long time since it happened, and it was only once though.

What other files are there? I'd expect a .log file of some description if you've got .md5 and .nfo files.

It might be a good idea to try one of the 'lossless testing' programs,. They can give you a good indication if the files are lossless or transcoded from a lossy source. No point keeping some bunch of 'lossless' files if they are just transcoded from MP3 320/VBR V0, etc..
 
Old 12-13-2013, 08:12 AM   #9
totedati
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: Disabled
Talking

in linux is actually simple to repair id3 tainted flacs! first strange thing in the linux world is that id3 tagged flacs will not bite you in any way until you try to use oggenc! you can play the flacs just fine, you can tag it in programs like kid3-qt and vorbis tags will coexist with id3 tags! ugh! ... commands like
Code:
flac -t music.flac
or
Code:
flac -t music.flac
will not give you any hint that is something wrong with you flacs! then you will try something like
Code:
oggenc --utf8 -q 4 music.flac
and bang!

Code:
ERROR: Input file "music.flac" is not a supported format
WHAT!?

and finally, you do, at years distance of the original ripping movements, that final check you forgot to do:

Code:
file *.flac
music.flac:  Audio file with ID3 version 2.3.0, unsynchronized frames, contains: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 13427568 samples
WTF!? from where is this alien bug landed on my hdd!? and what to do now? i want my flacs back! well, in linux world is simple:

Code:
for input in $(find . -maxdepth 1 -type f -name '*.flac'); \
do temp=$(basename $input .flac); \
metaflac --export-tags-to=$temp.metaflac $input; \
id3v2 -D $input; \
metaflac --dont-use-padding --remove-all $input; \
metaflac --import-tags-from=$temp.metaflac $input; \
rm -v $temp.metaflac; \
done
and voila, all you flacs is back and sane:

Code:
file *.flac
music.flac:  FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 13427568 samples
caveats emperors:
Code:
rm -v $temp.metaflac; \
is dangerous, use only if my bash programming skills look strong enough, or else is safe to edit my code snipets and delete this line
Code:
metaflac --export-tags-to
export only metadata tags, embeded pictures and imported cuesheets will be lost

Last edited by totedati; 12-14-2013 at 01:17 PM. Reason: script corrected
 
Old 12-13-2013, 08:35 AM   #10
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thank you, totedati.
 
Old 12-13-2013, 11:30 AM   #11
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,226

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
I only skimmed the thread, but Puddletag is my favorite tagger and it works transparently with FLACs.
 
Old 12-14-2013, 01:16 PM   #12
totedati
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: Disabled
o yeah, and the chances for puddletag to work also very transparently and quietly with Audio file with ID3 version 2.3.0, unsynchronized frames, contains: FLAC audio bitstream data, 16 bit, stereo, 44.1 kH is very high!

i make a little correction to my script, original solution can end in flacs with doubled vorbis tags because id3v2 strip only id3 tags
 
Old 12-14-2013, 09:28 PM   #13
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,326
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
There was a podcast last week about metadata in audio files at Hacker Public Radio. It might help.
 
Old 12-14-2013, 09:34 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I've been using easytag for a while to add titles, author... and album art to FLAC files and my portable media player is fine with them too.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script for sorting and renaming multiple mp3 files by id3 tags simonloach Linux - General 8 02-16-2013 09:07 AM
LXer: MP3 And FLAC Metadata Information (ID3 Tags) In Nautilus List View LXer Syndicated Linux News 0 01-26-2010 11:50 PM
Converting ID3 tags from v2.3 to v2.4 dotancohen Linux - Software 2 02-17-2006 02:41 PM
id3 tags don't seem to appear Valhalla Linux - Software 1 12-13-2005 11:17 AM
Program for ID3 Tags Boffy Linux - General 1 02-17-2005 02:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 05:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration