[FFmpeg-cvslog] mov: parse @PRM and @PRQ metadata tags

Peter Ross git at videolan.org
Mon Dec 10 11:32:38 CET 2012


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sat Dec  8 17:34:11 2012 +1100| [f540851ce320bc69621ea70b89857c54129c82c2] | committer: Peter Ross

mov: parse @PRM and @PRQ metadata tags

These tags describe the product and quicktime library version respectively.
Originate from Adobe Premier, but some other products use them.

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

 libavformat/mov.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 046e9b8..715e200 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -278,6 +278,17 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
     return 0;
 }
 
+static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
+                            unsigned len, const char *key)
+{
+    char *value = av_malloc(len + 1);
+    if (!value)
+        return AVERROR(ENOMEM);
+    avio_read(pb, value, len);
+    value[len] = 0;
+    return av_dict_set(&c->fc->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
+}
+
 static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 #ifdef MOV_EXPORT_ALL_METADATA
@@ -334,6 +345,10 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         parse = mov_metadata_int8_no_padding; break;
     case MKTAG( 'p','g','a','p'): key = "gapless_playback";
         parse = mov_metadata_int8_no_padding; break;
+    case MKTAG( '@','P','R','M'):
+        return mov_metadata_raw(c, pb, atom.size, "premiere_version");
+    case MKTAG( '@','P','R','Q'):
+        return mov_metadata_raw(c, pb, atom.size, "quicktime_version");
     }
 
     if (c->itunes_metadata && atom.size > 8) {



More information about the ffmpeg-cvslog mailing list