[FFmpeg-devel] [PATCH] mp3enc: avoid truncating id3v1 tags by one byte

Michael Niedermayer michaelni at gmx.at
Tue Nov 1 00:53:31 CET 2011


On Mon, Oct 31, 2011 at 03:11:37PM +0100, Tobias Rapp wrote:
> Avoid writing the trailing null-byte for id3v1 tags if length reaches max length.
> 
> To reproduce the issue one can use a command like:
> 
> $ ffmpeg -i /tmp/test01.wav \
> -metadata title=MyTitle89012345678901234567890 \
> -metadata artist=MyArtist9012345678901234567890 \
> -metadata album=MyAlbum89012345678901234567890 \
> -metadata comment=MyComment012345678901234567890 \
> -metadata track=01/10 -metadata date=2001-01-01 \
> -write_id3v1 1 /tmp/test01.mp3
> 
> the desired output is (see http://id3.org/ID3v1):
> 
> $ tail --bytes=128 /tmp/test01.mp3 | xxd
> 0000000: 5441 474d 7954 6974 6c65 3839 3031 3233  TAGMyTitle890123
> 0000010: 3435 3637 3839 3031 3233 3435 3637 3839  4567890123456789
> 0000020: 304d 7941 7274 6973 7439 3031 3233 3435  0MyArtist9012345
> 0000030: 3637 3839 3031 3233 3435 3637 3839 304d  678901234567890M
> 0000040: 7941 6c62 756d 3839 3031 3233 3435 3637  yAlbum8901234567
> 0000050: 3839 3031 3233 3435 3637 3839 3032 3030  8901234567890200
> 0000060: 314d 7943 6f6d 6d65 6e74 3031 3233 3435  1MyComment012345
> 0000070: 3637 3839 3031 3233 3435 3637 3800 01ff  6789012345678...

patch applied
thanks for this excellent explanation

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111101/4ce237fa/attachment.asc>


More information about the ffmpeg-devel mailing list