[FFmpeg-devel] [PATCH] Add support for writing VBR MP3 tags

Jai Menon jmenon86
Sat May 30 18:36:15 CEST 2009


On Sat, May 30, 2009 at 11:00 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, May 30, 2009 at 10:59:21AM +0000, Jai Menon wrote:
>> On Sat, May 30, 2009 at 10:06 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Sat, May 30, 2009 at 06:39:47AM +0000, Jai Menon wrote:
>> >> On Fri, May 29, 2009 at 9:24 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> >> > On Fri, May 29, 2009 at 07:51:08PM +0000, Jai Menon wrote:
>> >> >> On Fri, May 29, 2009 at 7:22 PM, Jai Menon <jmenon86 at gmail.com> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > As in subject.
>> >> >>
>> >> >> Slightly modified version attached.
>> >> >
>> >> > I dont see how this code could work
>> >> > example, stream copy from mpeg-ps -> .mp3
>> >>
>> >> Well, that would require a vbr tag writer which constructs the avg.
>> >> bitrate toc. During my experiments, the bitrate changes were not
>> >> visible in the muxer. So this, I think would require more work.
>> >
>> > AVPacket.size and duration should provide the rate ...
>>
>> Stream duration is zero in this case so this doesnt work. or is there
>> some other duration value?
>
> AVPacket.duration is 0 ?

No, but since it in stream timebase units, i scale it into seconds. In
any case, this approach doesn't seem to be correct. This is the reason
I abandoned this idea initially and let lame do the bitrate
calculations.

[...]

>> Okay, so is this acceptable :
>>
>> - mp3_write_header checks if the input stream is vbr and writes an
>> empty frame after the header
>
> how would mp3_write_header() do that?

Since most encoders put the audio frame with the vbr tag right after
the id3v2(if it is present), I thought lavf should also store these in
a "co-located" manner. Is that okay?

[...]

>> also, where should this code be? in a separate file?
>
> is there a disadvantage putting it in libavforat/mp3(enc).c ?

Okay, will put this into mp3.c.

-- 
Regards,

Jai



More information about the ffmpeg-devel mailing list