[FFmpeg-devel] [PATCH] Add four metadata tags to 3gp files

Horacio Sanson hsanson
Tue Sep 9 10:15:32 CEST 2008


On Tue, Sep 9, 2008 at 10:13 AM, Baptiste Coudurier
<baptiste.coudurier at smartjog.com> wrote:
> Horacio Sanson wrote:
>> On Tue, Sep 9, 2008 at 4:16 AM, Baptiste Coudurier
>> <baptiste.coudurier at smartjog.com> wrote:
>>> Hi,
>>>
>>> Horacio Sanson wrote:
>>>> Japanese mobile phones (Au, Softbank and Docomo) display these four tags when
>>>> accessing 3gp and 3g2 files properties. Our content providers mandate we put
>>>> these on all media we distribute, specially copyright.
>>> Humm I understand.
>>>
>>>> I would like to ask how to support other languages in the text strings?? I
>>>> really need this to support Japanese characters so any tips on how to do this
>>>> are welcome...
>>> You could set AVStream->language and use it.
>>>
>>
>> Correct me if wrong but this AVStream->language would be per track in
>> the case of MP4 based files. These tags I need are general to the
>> whole presentation so I think this would not be useful for my
>> purposes.
>
> Well, in the mean time, you could just set all tracks to your language,
> You could have a different artist per track anyway, metadata might be
> per track too ...
>
>>>> ------------------------------------------------------------------------
>>>>
>>>> Index: libavformat/movenc.c
>>>> ===================================================================
>>>> --- libavformat/movenc.c      (?????"????????? 15260)
>>>> +++ libavformat/movenc.c      (???????????"???)
>>>> @@ -1315,13 +1315,17 @@
>>>>          put_be32(pb, 0); /* size */
>>>>          put_tag(pb, "udta");
>>>>
>>>> -        if (mov->mode & MODE_3GP) {
>>>> +        if (mov->mode & MODE_3GP || mov->mode & MODE_3G2) {
>>> This is a different issue, and must be submited as a different patch,
>>> can you confirm these metadata tags are allowed in 3g2 and quote the
>>> specs ? Thanks.
>>>
>>
>> Never seen the spec for 3g2 file format, I assumed it is not too
>> different from the 3GPP file format (TS 26.244) if it is not please
>> information about the 3g2 spec name is appreciated.
>
> 3GPP2 C.S0050-B, some minor differences. If you find anything related to
> tags in udta, I'll check it.
>
>>
>>>>              mov_write_3gp_udta_tag(pb, s, "titl", s->title);
>>>>              mov_write_3gp_udta_tag(pb, s, "auth", s->author);
>>>>              mov_write_3gp_udta_tag(pb, s, "gnre", s->genre);
>>>>              mov_write_3gp_udta_tag(pb, s, "dscp", s->comment);
>>>>              mov_write_3gp_udta_tag(pb, s, "albm", s->album);
>>>>              mov_write_3gp_udta_tag(pb, s, "yrrc", "nil");
>>>> +            mov_write_string_tag(pb, "\251nam", s->title, 0);
>>>> +            mov_write_string_tag(pb, "\251aut", s->author, 0);
>>>> +            mov_write_string_tag(pb, "\251des", s->comment, 0);
>>>> +            mov_write_string_tag(pb, "\251cpy", s->copyright, 0);
>>> Are these standardized in 3gp ? I don't think so, 3gp uses differents
>>> tags IIRC like coded. Doesn't your content providers support 3gp tags ?
>>> I might be inclined to allow this if not...
>>>
>>
>> Believe me I wish I could quote the standard and tell you these tags
>> are there but I can't. Blame Quicktime pro that is the defacto
>> authoring tool used by all content creators here in Japan. Quicktime's
>>  property editor allows to add these four tags to MOV, 3gpp and 3g2
>> files that are displayed on all mobile phones in Japan (i.e. a lot of
>> devices) so pretty much is a standard here.
>
> Well, 3GPP is the only _standard_.
>
> Humm hopefully I quickly checked with quicktime player before answering,
> and here my quicktime player display correctly title (using -title) and
> copyright (using -copyright) in my 3gp file.
>
> Do you still have a problem ? I added -copyright support just today did
> you try again ?
>

Yes I tried several times and indeed the title, author and copyright
appear correctly in Quicktime inspectror (i.e. Ctrl-I) but they do not
appear in the property editor (i.e. Ctrl-J) and unfortunately
the tags that are displayed on the phones are those created in the
property editor.

Doing some research I found that that AtomicParsley generates
identical tags (boxes) as ffmpeg but the contents differ, maybe
encoding??. The thing is that these tags generated by AtomicParsley do
appear in the Quicktime property editor.

# FFMpeg Command:

ffmpeg -i test.avi -author 'ME SAN' -comment '??????' -copyright 'MY
COPYRIGHT' -title 'MY TITLE' test.3gp

# AtomicParsley Command:

AtomicParsley test.3gp --3gp-copyright 'MY COPYRIGHT' lang=jpn
--3gp-description '???
???' lang=jpn --3gp-title 'MY TITLE' lang=jpn --3gp-author 'ME SAN' lang=jpn


# FFMpeg generated tags (mp4dump)

  type udta
   type titl
    data = <24 bytes>
    00 00 00 00 15 c7 00 4d 00 59 00 20 00 54 00 49
    00 54 00 4c 00 45 00 00
   type auth
    data = <20 bytes>
    00 00 00 00 15 c7 00 4d 00 45 00 20 00 53 00 41
    00 4e 00 00
   type dscp
    data = <20 bytes>
    00 00 00 00 15 c7 65 e5 67 2c 8a 9e 30 c6 30 b9
    30 c8 00 00
   type cprt
    type ?
     data = <24 bytes>
     00 59 00 20 00 43 00 4f 00 50 00 59 00 52 00 49
     00 47 00 48 00 54 00 00
   type yrrc
    data = <6 bytes> 00 00 00 00 00 00

# AtomicParsley generated tags (mp4dump)

  type udta
   type cprt
    type ?MY
     data = <11 bytes> 20 43 4f 50 59 52 49 47 48 54 00
   type dscp
    data = <25 bytes>
    00 00 00 00 2a 0e e6 97 a5 e6 9c ac e8 aa 9e e3
    83 86 e3 82 b9 e3 83 88 00
   type titl
    data = <15 bytes> 00 00 00 00 15 c7 4d 59 20 54 49 54 4c 45 00
   type auth
    data = <13 bytes> 00 00 00 00 2a 0e 4d 45 20 53 41 4e 00
 type free
 type mdat


If someone can point me the difference and/or how to generate
AtomicParsley format I will try to patch ffmpeg to generate similar
tags.


>> On the other hand these tags are exactly the same tags used in
>> MODE_MOV, I simply add them to 3gp and 3g2 files. Maybe it would be
>> better to not differentiate between these three modes at all and add
>> all those tags to the files (3gp, 3p2, mov, mp4) so the tags can be
>> seen in as many devices/programs as possible.... just an idea.
>
> I'd prefer being standard here.
>
> --
> Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
> Smartjog USA Inc.                                http://www.smartjog.com
> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



More information about the ffmpeg-devel mailing list