[FFmpeg-devel] [BUG] Storage of 3gpp metadata in 3gp files
Aurelien Jacobs
aurel
Fri May 29 14:36:08 CEST 2009
On Fri, May 29, 2009 at 11:21:57AM +0200, Larbi Joubala wrote:
> Baptiste Coudurier a ?crit :
>> Hi,
>>
>> Larbi Joubala wrote:
>>
>>> Hi guys!
>>>
>>> I recently found that when I set metadata in 3gp files that the
>>> metadata are not displayed by any players or tools. I tested with
>>> QuickTime player and an other mp4/3gp/mov file analyzer
>>> tool("scenescope"). Then, to see where the issue comes from, I digged in
>>> the source code in paricularly "movenc.c" and I found out that the
>>> metadata are stored in UTF16 way but without the BOM(Byte Order Marker)
>>> to indicate the endianness. The 3gp standard say that the metadata value
>>> can be stored in UTF8 way or UTF16 way but for UTF16 the string value
>>> shall start with the following BOM 0xFFFE for big-endian.
>>>
>>> Is this issue known and why don't store the metadata value with UTF8
>>> encoding characters to avoid to add the BOM in the beginning of the string?
>>>
>>
>> UTF8 is prefered I think.
>>
>>
> Ok, so here is a patch which allows MOV muxer to store 3gpp metadata
> value in a UTF8 way.
>
> Index: movenc.c
> ===================================================================
> --- movenc.c (revision 18980)
> +++ movenc.c (working copy)
> @@ -1437,7 +1437,8 @@
> put_be16(pb, atoi(t->value));
> else {
> put_be16(pb, language_code("eng")); /* language */
> - ascii_to_wc(pb, t->value);
> + put_buffer(pb, t->value, strlen(t->value)); /* string value */
> + put_byte(pb, 0); /* string NULL-terminated */
Just use:
put_buffer(pb, t->value, strlen(t->value)+1);
so that you don't need to manually add the 0 byte at the end.
Aurel
More information about the ffmpeg-devel
mailing list