IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
editing gapless mp3 header information, foobar 0.8 vs. 0.9, to to easily get ENC_PADDING value of zero?
timcupery
post Jan 19 2009, 00:31
Post #1





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



I really appreciate foobar2000's ability to edit the LAME-style gapless playback information stored in the header. I'm referring to the ENC_DELAY and ENC_PADDING information, the type automatically written by LAME.

This tool can be reached through the context menu (right-click for most people), and is called "Edit MP3 Gapless Playback Information" in foobar2000 0.9. In foobar2000 0.8, it was combined with the "Fix MP3 Header" dialog, which had the option to rebuild the mp3 stream as well as editing the gapless information.

There are a couple of differences in how foobar2000 versions 0.8 and 0.9 handle editing the ENC_DELAY and ENC_PADDING values.

First, 0.8 can't read or write ENC_DELAY values higher than 1152. foobar2000 0.9 can handle this just fine, which was useful when I bought mp3's of a live album which happened to have a delay of 1679 samples - with foobar2000 0.9, I could edit these. But when foobar2000 0.8 sees these files, it reads the ENC_DELAY value as zero.

Secondly, foobar2000 0.9 has lots more ability to handle the ENC_PADDING value. 0.9 has nifty "up" and "down" buttons that let you adjust the desired length of the track in increments of 588 samples. this is convenient because any track ripped from a cd will be in increments of 588 samples (75 sectors of 588 samples = 44,100 samples, or 1 second)

However, while the dialog boxes from both 0.8 and 0.9 say "enter 0 to disable padding", this only works in 0.8.
- in 0.8, entering 0 would mean that the ENC_PADDING value was zero
- in 0.9, entering 0 puts a default delay value of 4095 samples (which foobar2000 0.8 cannot read). If there is already a value written for ENC_PADDING, entering 0 leaves that value.

In a lot of cases I would like to just leave the ENC_PADDING value at zero. This is useful for mp3's that don't any added silence at the end of their stream.

Back when I was using foobar2000 0.8, I could just enter 0 to disable padding, and I would get an ENC_PADDING value of zero.
But with 0.9, this becomes much more difficult. The initial value is at 4095, and you can click the nifty "up" button to get the value smaller, in increments of 588 samples per click.
It turns out that an ENC_PADDING value of 529 or lower decodes the same as if it were zero. So for some mp3's, editing their gapless information in foobar2000 0.9, I just click until the ENC_PADDING value shows somewhere between 0 and 529.

But it seems like there should be a cleaner way to do this.
I don't know all the ins and outs of writing gapless playback information, but I'm curious if there is a way to do what I want to do (enter 0 to disable padding), or perhaps I'm just trying to do the wrong thing?
Thanks for any help here.


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
timcupery
post Jan 19 2009, 18:34
Post #2





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



I wrote the previous post both because I'm honestly curious how the LAME gapless standard works (how the number-values are stored, how interpreted, and why some are more impervious to mp3-editing software than others.

The final reason is also the proximate and practical cause of my writing the post.
I've been looking at how mptrim, mp3val, and mp3packer affect gapless values.

mptrim strips ENC_DELAY and ENC_PADDING written by LAME, but usually doesn't strip values written by foobar2000

I wrote the previous post both because I'm honestly curious how the LAME gapless standard works (how the number-values are stored, how interpreted, and why some are more impervious to mp3-editing software than others.

The final reason is also the proximate and practical cause of my writing the post.
I've been looking at how mptrim, mp3val, and mp3packer affect gapless values.

mptrim strips ENC_DELAY and ENC_PADDING values written by LAME in the encoding process, but usually doesn't strip values written in by foobar2000.

in mp3val, files with foobar-edited gapless values often show up as having a problem (Wrong number of MPEG data bytes specified in Xing header) but when I fix these files with mp3val, the gapless info remains, mp3val has just written the correct number of bytes into the Xing header to correspond with the ENC_DELAY and ENC_PADDING values.
This implies that foobar2000, when editing the gapless values in an mp3 file, doesn't change the specified file length in the Xing header.

Finally, mp3packer. This is the most difficult to figure out.
MP3Packer strips gapless info (both delay and padding set to zero) when
- timing value is off (so if I've fixed with mp3val already, no problem)
- padding value between 1 and 528, over over 2000

others that don't fit this description are sometimes messed up, but all such are files that had values edited in foobar2000 0.9

Usually, original tags from LAME encoding aren't stripped

gapless values written by foobar2000 are less likely to be stripped my mp3packer if the file was run through mp3val (and fixed if necessary).


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
timcupery
post Jan 23 2009, 16:23
Post #3





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



I'm blatantly bumping this. I realize I wrote a lot here, and maybe no one wants to wade through it, but I'm kinda surprised that no-one has comments on the various ways that LAME's gapless-playback info gets written to files.
* why some gapless info gets stripped by certan programs, and others isn't
* the differences between info written (and capabilities to write info) by fb2k 0.8 and 0.9

To me, the issues I've mentioned here are kind of a black hole - I really don't know what is going on, and am curious. I'd be pleased if anyone knows. Thanks.


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Mix3dmessagez
post Jun 23 2009, 17:48
Post #4





Group: Members
Posts: 87
Joined: 22-March 09
Member No.: 68252



Funny thing i just found out what it does, i just dont know how to set or use it...so i dont know any of these problems you experience...
Go to the top of the page
+Quote Post
gfxnow
post Feb 16 2010, 06:02
Post #5





Group: Members
Posts: 95
Joined: 21-July 07
Member No.: 45510



Has the ability to edit ENC_DELAY and ENC_PADDING information been removed from 1.0?
Go to the top of the page
+Quote Post
timcupery
post Feb 16 2010, 06:07
Post #6





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



QUOTE (gfxnow @ Feb 16 2010, 00:02) *
Has the ability to edit ENC_DELAY and ENC_PADDING information been removed from 1.0?

Not at all, the functionality appears the same as it was in the 0.9 versions of fb2k. I've used it since updating to 1.0 and have had no problems.


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
gfxnow
post Feb 16 2010, 17:29
Post #7





Group: Members
Posts: 95
Joined: 21-July 07
Member No.: 45510



QUOTE (timcupery @ Feb 16 2010, 00:07) *
Not at all, the functionality appears the same as it was in the 0.9 versions of fb2k. I've used it since updating to 1.0 and have had no problems.


I only see "Fix VBR MP3 Header" and "Rebuild MP3 Stream" in utilities (fb2k 1.0). There's no "Edit MP3 Gapless Playback Information."
Go to the top of the page
+Quote Post
timcupery
post Feb 16 2010, 17:40
Post #8





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



The option is still there, it just isn't enabled to show in the context menus (right-click) by default. You'll need to go into preferences --> display --> context menu --> utilities and check the box.

I forgot about this because I have a keyboard shortcut programmed for the utility, that carried over when I updated to 1.0 (so I never set it to display in the context menu).


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
kode54
post Feb 16 2010, 20:38
Post #9





Group: Admin
Posts: 4664
Joined: 15-December 02
Member No.: 4082



It will also show if you hold the shift key when opening the context menu.
Go to the top of the page
+Quote Post
gfxnow
post Feb 17 2010, 17:45
Post #10





Group: Members
Posts: 95
Joined: 21-July 07
Member No.: 45510



QUOTE (kode54 @ Feb 16 2010, 14:38) *
It will also show if you hold the shift key when opening the context menu.

wow great tip!
Go to the top of the page
+Quote Post
alexeysp
post Apr 11 2010, 09:11
Post #11





Group: Members
Posts: 141
Joined: 3-April 09
Member No.: 68627



Sorry for bumping, but I'm also interested in some of the questions timcupery asked and couldn't find the answers.

Why the default ENC_PADDING value foobar sets when fixing VBR header is 4095, why not zero?
Why it can not be automatically set to zero, although the edit dialog says "enter 0 to disable padding"?
Should this behaviour be considered a bug or is there some reasoning behind this?
Go to the top of the page
+Quote Post

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: 27th November 2014 - 01:38