[FFmpeg-devel] [PATCH] avi metadata conv table
Michael Niedermayer
michaelni
Fri Feb 5 21:55:09 CET 2010
On Fri, Feb 05, 2010 at 09:11:22PM +0100, Anton Khirnov wrote:
> On Fri, Feb 05, 2010 at 08:48:53PM +0100, Michael Niedermayer wrote:
> > On Fri, Feb 05, 2010 at 08:36:56PM +0100, Anton Khirnov wrote:
> > > On Fri, Feb 05, 2010 at 07:43:22PM +0100, Michael Niedermayer wrote:
> > > >
> > > > char key[5]={0}
> > > > AV_WL32(key, tag);
> > > > (simpler IMHO)
> > > >
> > > done
> > > >
> > > > nothing in there uses AVFormatContext thus the changes is pointless
> > > >
> > > right, fixed
> > > >
> > > > [...]
> > > > > @@ -378,15 +366,13 @@ static int avi_write_header(AVFormatContext *s)
> > > > >
> > > > > list2 = ff_start_tag(pb, "LIST");
> > > > > put_tag(pb, "INFO");
> > > > > - avi_write_info_tag2(s, NULL, "INAM", "Title", NULL);
> > > > > - avi_write_info_tag2(s, NULL, "IART", "Artist", "Author");
> > > > > - avi_write_info_tag2(s, NULL, "ICOP", "Copyright", NULL);
> > > > > - avi_write_info_tag2(s, NULL, "ICMT", "Comment", NULL);
> > > > > - avi_write_info_tag2(s, NULL, "IPRD", "Album", NULL);
> > > > > - avi_write_info_tag2(s, NULL, "IGNR", "Genre", NULL);
> > > > > - avi_write_info_tag2(s, NULL, "IPRT", "Track", NULL);
> > > >
> > > > > - if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
> > > > > - avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT);
> > > >
> > > > you seem to be loosing this in your patch
> > > >
> > > fixed
> > >
> > > btw i was wondering if it really belongs here and not in the client app.
> >
> > it absolutely belongs in the muxer
>
> maybe it should be set at some higher level then, for example in
> av_metadata_conv(). adding special case like this to each muxer
> is quite ugly.
maybe
> >
> > mixing cosmetics with functional changes
> >
> oops, sorry. fixed
>
> Anton Khirnov
> Makefile | 4 ++--
> avi.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
> avi.h | 9 +++++++++
> avidec.c | 42 ++++++++++++++++++------------------------
> avienc.c | 38 ++++++++++++++------------------------
> 5 files changed, 88 insertions(+), 50 deletions(-)
> 81f42d423de5ebd02c82886ba8950c86eee2c516 0001-Add-AVI-metadata-conversion-table.patch
> From 2585c1e5dd85ffc3fc527b34b4ad8c3398a70482 Mon Sep 17 00:00:00 2001
> From: Anton Khirnov <wyskas at gmail.com>
> Date: Fri, 5 Feb 2010 14:22:24 +0100
> Subject: [PATCH] Add AVI metadata conversion table.
>
> ---
> libavformat/Makefile | 4 ++--
> libavformat/avi.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
> libavformat/avi.h | 9 +++++++++
> libavformat/avidec.c | 42 ++++++++++++++++++------------------------
> libavformat/avienc.c | 38 ++++++++++++++------------------------
> 5 files changed, 88 insertions(+), 50 deletions(-)
> create mode 100644 libavformat/avi.c
>
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 612e982..29412c3 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -35,8 +35,8 @@ OBJS-$(CONFIG_ASS_DEMUXER) += assdec.o
> OBJS-$(CONFIG_ASS_MUXER) += assenc.o
> OBJS-$(CONFIG_AU_DEMUXER) += au.o raw.o
> OBJS-$(CONFIG_AU_MUXER) += au.o
> -OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o riff.o
> -OBJS-$(CONFIG_AVI_MUXER) += avienc.o riff.o
> +OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o riff.o avi.o
> +OBJS-$(CONFIG_AVI_MUXER) += avienc.o riff.o avi.o
> OBJS-$(CONFIG_AVISYNTH) += avisynth.o
> OBJS-$(CONFIG_AVM2_MUXER) += swfenc.o
> OBJS-$(CONFIG_AVS_DEMUXER) += avs.o vocdec.o voc.o
> diff --git a/libavformat/avi.c b/libavformat/avi.c
> new file mode 100644
> index 0000000..9cefa0a
> --- /dev/null
> +++ b/libavformat/avi.c
> @@ -0,0 +1,45 @@
> +/*
> + * AVI common data
> + * Copyright (c) 2010 Anton Khirnov
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include "avi.h"
> +
> +const AVMetadataConv ff_avi_metadata_conv[] = {
> + { "IART", "artist" },
> + { "ICMT", "comment" },
> + { "ICOP", "copyright" },
> + { "ICRD", "date" },
> + { "IGNR", "genre" },
> + { "ILNG", "language" },
> + { "INAM", "title" },
> + { "IPRD", "album" },
> + { "IPRT", "track" },
> + { "ISFT", "encoder" },
> + { "ITCH", "encoded_by"},
> + { "strn", "title" },
> + { 0 },
> +};
does this actually work?
i mean titles for the file ->INAM and for streams strn ?
if so and its otherwise also tested then ok
[..]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.
-------------- 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/20100205/ff69c8e8/attachment.pgp>
More information about the ffmpeg-devel
mailing list