HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: cpaqf1 on 2013-03-08 04:18:11

Title: how does foobar handle metadata/tags ?
Post by: cpaqf1 on 2013-03-08 04:18:11
Hi,

I've got a pretty massive music library and I decided I'd be interested in using Replay gain. Thing is I never ripped my music with the track volume entry which means I'd have to scan my whole library, which is fine with me. Thing is, I sometimes got the feeling that when modifying a track name, or album title, or artist name, it would rewrite the file instead of modifying the info which caused fragmentation. So, my question is how does foobar handle this stuff, does it only add it or does it erase and recopy/rewrite the file on the hard drive ? I wouldn't want my whole library fragmented because I added replaygain values..

My library is in flac if that makes a difference

thanks
Title: how does foobar handle metadata/tags ?
Post by: Case on 2013-03-09 18:49:51
If your FLAC files have enough padding for the metadata then they are modified in place. This is fast and doesn't cause any fragmentation or unnecessary disk writes. If they do not have the required space for the tags then foobar will have to re-create the files. This is done by writing the required headers and metadata+padding blocks into new temporary files followed by copying the encoded audio data from the original files into the temp files. Upon success the original files are destroyed and the temp files are renamed to replace them. The rewrite method currently does not utilize any methods to prevent fragmentation.
If your files are encoded with the official FLAC encoder with default settings they will have at least 8192 bytes of padding. This is enough to store regular text metadata but not for album art.
Title: how does foobar handle metadata/tags ?
Post by: Porcus on 2013-03-09 21:20:28
Upon success

... how does it verify, BTW?

I have not yet had any issues where fb2k has left tmp files though. (mp3tag sometimes does, when it encounters issues.)



When it comes to fragmentation: Is that really anything to worry about for audio? CD quality files do not require much more than 1411 on average, and I'd be surprised if fragmentation would be any nuissance except maybe with batch processing on a near-full drive.  (Would it even be an issue on video files? In the very least, what if one uses a defragger and sorts by fragmentation, taking out those few files which are worse than [insert number]?)
Title: how does foobar handle metadata/tags ?
Post by: Case on 2013-03-09 22:36:25
Checking is simple: WriteFile (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365747%28v=vs.85%29.aspx) function returns error or writes less bytes than it should. If this happens the temp file creation is aborted, the file is removed and the user is shown an error message that tagging failed.
Fragmentation doesn't of course cause playback to slow down enough to cause glitches. But it does affect transcoding and replaygain scanning speeds.
Title: how does foobar handle metadata/tags ?
Post by: cpaqf1 on 2013-03-09 23:48:18
Checking is simple: WriteFile (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365747%28v=vs.85%29.aspx) function returns error or writes less bytes than it should. If this happens the temp file creation is aborted, the file is removed and the user is shown an error message that tagging failed.
Fragmentation doesn't of course cause playback to slow down enough to cause glitches. But it does affect transcoding and replaygain scanning speeds.



awesome, thanks a lot