[FFmpeg-cvslog] mov: parse XMP metadata on demand

Vittorio Giovara git at videolan.org
Mon Dec 8 23:00:17 CET 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Wed Dec  3 02:43:24 2014 +0000| [b704b648f9ecb830874627db958a37e004107d1b] | committer: Vittorio Giovara

mov: parse XMP metadata on demand

The Extensible Metadata Platform tag can contain various kind of data
which are not strictly related to the video file, such as history of edits
and saves from the project file. So display XMP metadata only when the
user explicitly requires it.

Based on a patch by Marek Fort <marek.fort at chyronhego.com>.

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

 libavformat/isom.h    |    1 +
 libavformat/mov.c     |    4 ++++
 libavformat/version.h |    2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 7e60d8c..c24b962 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -157,6 +157,7 @@ typedef struct MOVContext {
     int chapter_track;
     int64_t next_root_atom; ///< offset of the next root atom
     int export_all;
+    int export_xmp;
 } MOVContext;
 
 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5950c42..8124d69 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -263,6 +263,8 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     switch (atom.type) {
     case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break;
     case MKTAG( '@','P','R','Q'): key = "quicktime_version"; raw = 1; break;
+    case MKTAG( 'X','M','P','_'):
+        if (c->export_xmp) { key = "xmp"; raw = 1; } break;
     case MKTAG( 'a','A','R','T'): key = "album_artist";    break;
     case MKTAG( 'c','p','r','t'): key = "copyright"; break;
     case MKTAG( 'd','e','s','c'): key = "description"; break;
@@ -3431,6 +3433,8 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
 static const AVOption mov_options[] = {
     { "export_all", "Export unrecognized metadata entries", OFFSET(export_all),
         AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS },
+    { "export_xmp", "Export full XMP metadata", OFFSET(export_xmp),
+        AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS },
     { NULL },
 };
 
diff --git a/libavformat/version.h b/libavformat/version.h
index b4d31dd..16c5e2e 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
 #define LIBAVFORMAT_VERSION_MINOR  7
-#define LIBAVFORMAT_VERSION_MICRO  1
+#define LIBAVFORMAT_VERSION_MICRO  2
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list