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

Jai Menon jmenon86
Sat May 30 12:59:21 CEST 2009


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?

>> Anyway, patch was meant to address one issue for the time being. I
>> hope someone can write a more general solution.
>
> i cannot accept the hack in the lame mp3 encoding wraper, its not part
> of a correct solution, its just a step in the wrong direction, that is
> code we would have to remove later.

Okay, so is this acceptable :

- mp3_write_header checks if the input stream is vbr and writes an
empty frame after the header
- mp3_write_packet updates the bitrate toc for the vbr tag
- mp3_write_trailer patches in the vbr tag

also, where should this code be? in a separate file?

-- 
Regards,

Jai



More information about the ffmpeg-devel mailing list