[FFmpeg-cvslog] avformat/movenc: XMP metadata support.

Marek Fort git at videolan.org
Thu Aug 7 20:19:43 CEST 2014


ffmpeg | branch: master | Marek Fort <marek.fort at chyronhego.com> | Wed Aug  6 16:48:21 2014 +0200| [4e70104aba4269770c36fc6e0ec975b7a061d028] | committer: Michael Niedermayer

avformat/movenc: XMP metadata support.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e70104aba4269770c36fc6e0ec975b7a061d028
---

 libavformat/movenc.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 20006ef..86dbe7f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2395,6 +2395,26 @@ static int mov_write_meta_tag(AVIOContext *pb, MOVMuxContext *mov,
     return size;
 }
 
+static int mov_write_raw_metadata_tag(AVFormatContext *s, AVIOContext *pb,
+                                      const char *name, const char *key)
+{
+    int len;
+    AVDictionaryEntry *t;
+
+    if (!(t = av_dict_get(s->metadata, key, NULL, 0)))
+        return 0;
+
+    len = strlen(t->value);
+    if (len > 0) {
+        int size = len + 8;
+        avio_wb32(pb, size);
+        ffio_wfourcc(pb, name);
+        avio_write(pb, t->value, len);
+        return size;
+    }
+    return 0;
+}
+
 static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
 {
     int val;
@@ -2494,6 +2514,7 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
         mov_write_string_metadata(s, pb_buf, "\251cmt", "comment",     0);
         mov_write_string_metadata(s, pb_buf, "\251gen", "genre",       0);
         mov_write_string_metadata(s, pb_buf, "\251cpy", "copyright",   0);
+        mov_write_raw_metadata_tag(s, pb_buf, "XMP_", "xmp");
     } else {
         /* iTunes meta data */
         mov_write_meta_tag(pb_buf, mov, s);



More information about the ffmpeg-cvslog mailing list