[FFmpeg-devel] [PATCH][RFC] add a list of generic tag names

Michael Niedermayer michaelni
Thu Oct 22 23:00:20 CEST 2009


On Thu, Oct 22, 2009 at 08:36:00AM +0200, Anton Khirnov wrote:
> Added some changes to id3v2 conversion table.
> 
> Anton Khirnov

>  asf.c             |    3 +--
>  avformat.h        |   24 +++++++++++++++++++++++-
>  id3v1.c           |    2 +-
>  id3v2.c           |   10 ++++++----
>  matroska.c        |    4 ++--
>  matroskadec.c     |    2 +-
>  metadata_compat.c |    3 +++
>  mov.c             |    4 ++--
>  movenc.c          |    8 ++++----
>  mp3.c             |    2 +-
>  oggparsevorbis.c  |    1 -
>  11 files changed, 44 insertions(+), 19 deletions(-)
> e86b0c25ff79ff95bc856ee5e89f523598662771  0001-Add-a-list-of-generic-tags.patch
> From cdd5e950dce65b3cf16af92f2cfda66943a2d508 Mon Sep 17 00:00:00 2001
> From: Anton Khirnov <wyskas at gmail.com>
> Date: Fri, 25 Sep 2009 22:50:15 +0200
> Subject: [PATCH 1/2] Add a list of generic tags and change demuxers to follow it.
> 
> ---
>  libavformat/asf.c             |    3 +--
>  libavformat/avformat.h        |   24 +++++++++++++++++++++++-
>  libavformat/id3v1.c           |    2 +-
>  libavformat/id3v2.c           |   10 ++++++----
>  libavformat/matroska.c        |    4 ++--
>  libavformat/matroskadec.c     |    2 +-
>  libavformat/metadata_compat.c |    3 +++
>  libavformat/mov.c             |    4 ++--
>  libavformat/movenc.c          |    8 ++++----
>  libavformat/mp3.c             |    2 +-
>  libavformat/oggparsevorbis.c  |    1 -
>  11 files changed, 44 insertions(+), 19 deletions(-)
> 
> diff --git a/libavformat/asf.c b/libavformat/asf.c
> index cf01e07..799bbef 100644
> --- a/libavformat/asf.c
> +++ b/libavformat/asf.c

> @@ -129,12 +129,11 @@ const ff_asf_guid ff_asf_digital_signature = {
>  };
>  
>  const AVMetadataConv ff_asf_metadata_conv[] = {
> -    { "AlbumArtist", "artist"    },

ok


>      { "AlbumTitle" , "album"     },
>      { "Author"     , "author"    },
>      { "Genre"      , "genre"     },
>      { "Copyright"  , "copyright" },
>      { "TrackNumber", "track"     },
> -    { "Year"       , "year"      },
> +    { "Year"       , "date"      },
>      { 0 }

hmm, this is not correct i think, at least on the muxer side unless
we have some code that extracts the year from a more generic date


>  };
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 19914b6..804c04d 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -99,7 +99,29 @@ int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
>  
>  /**
>   * Converts all the metadata sets from ctx according to the source and
> - * destination conversion tables.
> + * destination conversion tables. If one of the tables is NULL, then
> + * tags are converted to/from ffmpeg generic tag names. Currently defined
> + * generic tag names are:
> + * album        -- name of the set this work belongs to
> + * author       -- main author of the work
> + * comment      -- any additional description of the file
> + * composer     -- artist who composed the work, if different from author
> + * copyright    -- name of copyright holder
> + * date         -- date when the work was created, preferably in ISO 8601
> + * disc         -- number of a subset, e.g. disc in a multi-disc collection

> + * encoder      -- name/settings of the software/hardware that produced the file

this needs to be written so its clear if muxer or codec is meant


> + * encodedby    -- person who created the file

person/group


> + * filename     -- original name of the file
> + * genre        -- <self-evident>

> + * language     -- main language in which the work is performed

there are standards for language codes, see the nut spec, some of the
metadata stuff from there can likely be borrowed


> + * performer    -- artist who performed the work, if different from author.
> + *                 e.g for 'Also sprach Zarathustra', author would be 'Richard
> + *                 Strauss' and performer 'London Philharmonic Orchestra'.
> + * publisher    -- name of the label/publisher
> + * title        -- name of the work
> + * track        -- number of this work in the set, can be in form current/total
> + * Each tag type can also have a -sort variant, which contains a version of the
> + * tag that should be used for sorting.
>   * @param d_conv destination tags format conversion table
>   * @param s_conv source tags format conversion table
>   */




> diff --git a/libavformat/id3v1.c b/libavformat/id3v1.c
> index cf5cb95..f11f819 100644
> --- a/libavformat/id3v1.c
> +++ b/libavformat/id3v1.c
> @@ -189,7 +189,7 @@ static int parse_tag(AVFormatContext *s, const uint8_t *buf)
>      get_string(s, "title",   buf +  3, 30);
>      get_string(s, "author",  buf + 33, 30);
>      get_string(s, "album",   buf + 63, 30);
> -    get_string(s, "year",    buf + 93,  4);
> +    get_string(s, "date",    buf + 93,  4);
>      get_string(s, "comment", buf + 97, 30);
>      if (buf[125] == 0 && buf[126] != 0) {
>          snprintf(str, sizeof(str), "%d", buf[126]);
> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> index 9bc1d0f..c00e6d5 100644
> --- a/libavformat/id3v2.c
> +++ b/libavformat/id3v2.c
> @@ -238,16 +238,18 @@ const AVMetadataConv ff_id3v2_metadata_conv[] = {
>      { "TCON", "genre"},
>      { "TCOP", "copyright"},
>      { "TDRL", "date"},
> -    { "TENC", "encoder"},
> +    { "TENC", "encodedby"},
>      { "TIT2", "title"},
>      { "TLAN", "language"},
>      { "TPE1", "author"},
> +    { "TPE3", "performer"},
>      { "TPOS", "disc"},
>      { "TPUB", "publisher"},
>      { "TRCK", "track"},
> -    { "TSOA", "albumsort"},
> -    { "TSOP", "authorsort"},
> -    { "TSOT", "titlesort"},
> +    { "TSOA", "album-sort"},
> +    { "TSOP", "author-sort"},
> +    { "TSOT", "title-sort"},
> +    { "TSSE", "encoder"},
>      { 0 }
>  };

should be ok

[...]

> diff --git a/libavformat/mp3.c b/libavformat/mp3.c
> index 5b5e06d..e788d9f 100644
> --- a/libavformat/mp3.c
> +++ b/libavformat/mp3.c
> @@ -210,7 +210,7 @@ static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf)
>      count += id3v1_set_string(s, "title",   buf +  3, 30);
>      count += id3v1_set_string(s, "author",  buf + 33, 30);
>      count += id3v1_set_string(s, "album",   buf + 63, 30);
> -    count += id3v1_set_string(s, "year",    buf + 93,  4);
> +    count += id3v1_set_string(s, "date",    buf + 93,  4);
>      count += id3v1_set_string(s, "comment", buf + 97, 30);
>      if ((tag = av_metadata_get(s->metadata, "track", NULL, 0))) {
>          buf[125] = 0;

should be ok

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

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091022/e4bd0c21/attachment.pgp>



More information about the ffmpeg-devel mailing list