LWN.net Logo

File date order

File date order

Posted Jan 9, 2007 7:54 UTC (Tue) by ncm (subscriber, #165)
In reply to: File date order by drag
Parent article: Review: Exaile Media Player (Linux.com)

Hmm, did you mean client(s?) you use are *not* able to pull ID3 tags from your FLAC files? I wonder if it/they can handle Ogg/FLAC files...


(Log in to post comments)

File date order

Posted Jan 9, 2007 8:54 UTC (Tue) by drag (subscriber, #31333) [Link]

Yes either clients or the server (I don't know which is responsable) are not able to pull id3 tags off of flac files. They work fine for ogg files.

File date order

Posted Jan 9, 2007 10:33 UTC (Tue) by nix (subscriber, #2304) [Link]

FLAC files don't have ID3 tags, nor do Ogg files; they have Vorbis comments. (Sorry, pedantic, I know...)

Further, the same code that reads comments out of Ogg Vorbis files should be able to read them from Ogg FLAC files (but possibly not from FLAC files not in an Ogg container). If your FLACs aren't Ogg-encapsulated, try encapsulating them and see if that works. (Of course, it's possible that MPD isn't even *trying* to read Vorbis comments if the file is a FLAC file, in which case this won't help at all...)

File date order

Posted Jan 9, 2007 13:30 UTC (Tue) by drag (subscriber, #31333) [Link]

""FLAC files don't have ID3 tags, nor do Ogg files; they have Vorbis comments. (Sorry, pedantic, I know...)""

Fine with me. This could explain alot.

I went back and looked at the some of the files more closely... As it turns out it is reading the metadata from some of the flac files and not others. The only files that weren't getting picked up were flac files (and I have a mixture of Ogg Vorbis and Flac) so I assumed incorrectly that flac was the problem.

but now it seems that the problem is the program that I ripped them with. (I beleive grip, but I don't remember as I used a number of tools over the years)

When I run the 'file' command on the flac files that aren't having their metadata read by mpd are coming up as:
filename.flac: MP3 file with ID3 version 2.3.0 tag

A proper flac file shows up as:
filename.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 9766680 samples

Now the data itself is definately flac. Flac123 plays them fine (although the tags aren't showing up). They show up in other programs as flac files, but I guess the container is what mp3 uses.

Or something like that.

This kinda pisses me off. Now I have to figure out a script to reencode them to proper flac files while converting the metadata to the proper format. At least now I have a slightly better idea of what is going on.

On a side note:
Does anybody have a favorite ripping program that uses cdparanoia or at least implements a similar level of error detection and correction?

Program choices

Posted Jan 9, 2007 15:38 UTC (Tue) by tajyrink (subscriber, #2750) [Link]

I'm using SoundJuicer for random needs, and used grip when I converted my whole CD collection. Anyway, back then I had limited disk space and decided Ogg Vorbis quality 7 should be enough for everybody... and grip handled ogg vorbis files' comments just fine, _even though_ I think I had to add manually track number parameter. Don't know if the default grip settings are nowadays better.

I found out the lack of track numbers after ripping ca. 60 CDs with grip, so I did a small script to get the track number out of the file name (Artist - Album/NN-Title.ogg) and add it with vorbiscomment:

#!/bin/sh

bdir=/tmp

cd $bdir

for directory in ${bdir}/* ; do
cd "${directory}"
for file in *.ogg ; do
tracknr=`echo "${file}" | cut -b 1-2`
echo T: ${tracknr}, file: ${file}
vorbiscomment -a -t TRACKNUMBER=${tracknr} "${file}"
done
done

Looking at FLAC parameters, you have to spend some time to utilize the -T tag a lot when using grip, because flac doesn't have different options for different tags like oggenc does, but it should be possible. I seemingly haven't done that, instead ripping all my FLACs with Sound Juicer. SJ is otherwise nice but if I recall correctly it doesn't set year tag.

File date order

Posted Jan 9, 2007 16:17 UTC (Tue) by nix (subscriber, #2304) [Link]

It looks more like you have straight MP3 files with .flac extensions to me :) nothing can read MPEG files with FLAC encapsulated inside as far as I know (I doubt anyone's ever written code to do any such odd thing). (Why flac123 can handle them is a mystery.)

You may find the `metaflac' tool useful for inspecting and editing Vorbis comments. (Note that unlike ID3 they are completely freeform: you can even have multiple comments with the same name...)

File date order

Posted Jan 9, 2007 18:37 UTC (Tue) by Lockjaw (subscriber, #4611) [Link]

After a recent update on my Debian Etch machine, the grip -> cdparanoia -> flac chain started producing files that the "file" command detects as mp3's. oggenc (flac for home system, ogg vorbis for ipod) would claim they weren't the right format for encoding. They appear to be valid, but unusually crafted flac files. Careful searching will show patches to file's "magic" so that these are properly detected as flacs.

Running flac by hand on the wav files left over from grip and then using metaflac to copy the tags from the "mp3" flacs produced a usable product. Next time I have a big pile of cd's to rip I'll try and track down the exact problem - I caught the flac command spawned by grip to create the flacs, and when I type it in on the command line it does just fine - and I only have the one version of flac installed on my machine. I suspect something is going on with the character encoding used by grip.

metaflac --export-tags-to=- detects_as_mp3.flac | metaflac --import-tags-from=- hand_crafted.flac

will do the tag copy for you.

File date order

Posted Jan 10, 2007 1:11 UTC (Wed) by piman (subscriber, #8957) [Link]

This is all way simpler than you're making it. :) The FLAC files just have ID3 data prepended to them. That makes them corrupted files, but many FLAC decoders can still read them, because many broken encoders write them, because many FLAC decoders read them, etc.

File date order

Posted Jan 10, 2007 17:59 UTC (Wed) by Lockjaw (subscriber, #4611) [Link]

Yep - the "broken" flacs worked on my Sonos system (and maybe one of xmms and xine, although I don't remember exactly), but I couldn't convert them to ogg vorbis with oggenc.

Still, you must admit some there's strange voodoo going on with grip creating them broken, and everything working just fine when I cut and paste the "flac" command I catch from grip using "ps" during the encoding. If it's really ID3 prepended that's the problem, then grip must be using a different library for the encoding even though it's executing the same flac command. Hmmm...

In any case, I can't have broken files, so they have to be fixed somehow. I'm rather addicted to the grip workflow after doing 600 discs with it, so next time I need to do a bunch I'll have to at least automate the repair with a script (or go back to the version of grip that worked when I did the 600...).

BTW - while I'm on the subject of being over-the-top with getting correct rips, let me put in a plug for using secure-cdparanoia.py. It's a python script that runs cdparanoia repeatedly on each disc, checking to make sure they read the same each time (or at least letting you know if they don't); I was surprised by how many don't. Also, plextor drives are worth the extra money. There's no better way to be convinced of this than ripping 600 discs a second time because of too many audible pops in the first set.

File date order

Posted Jan 11, 2007 4:32 UTC (Thu) by piman (subscriber, #8957) [Link]

In the Grip Config/ID3 panel there is a checkbox "Only tag files ending in .mp3". Turn this on and the problem should go away. It encodes to FLAC using the command line and then does the tagging itself.

File date order

Posted Jan 11, 2007 17:18 UTC (Thu) by Lockjaw (subscriber, #4611) [Link]

Thanks - makes perfect sense. The grip upgrade caused problems with my .grip config, and it must have gotten switched somewhere along the line. I'm sure I went too fast reconstructing it and thought "of course I want the tags", not thinking of the difference between tags and comments.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds