[FFmpeg-cvslog] cinedec: add shutter and crop metadata

Ben Hagen git at videolan.org
Sat Aug 16 19:20:44 CEST 2014


ffmpeg | branch: master | Ben Hagen <ben at kamerawerk.ch> | Sat Aug 16 16:05:04 2014 +0200| [6928ea7eb0fbb12fa1d90075495fc910fbe16971] | committer: Michael Niedermayer

cinedec: add shutter and crop metadata

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

 libavformat/cinedec.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c
index 7daf0e0..8f450fa 100644
--- a/libavformat/cinedec.c
+++ b/libavformat/cinedec.c
@@ -225,7 +225,11 @@ static int cine_read_header(AVFormatContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    avio_skip(pb, 696); // Conv8Min ... ImHeightAcq
+    avio_skip(pb, 668); // Conv8Min ... Sensor
+
+    set_metadata_int(&st->metadata, "shutter_ns", avio_rl32(pb));
+
+    avio_skip(pb, 24); // EDRShutterNs ... ImHeightAcq
 
 #define DESCRIPTION_SIZE 4096
     description = av_malloc(DESCRIPTION_SIZE + 1);
@@ -239,6 +243,14 @@ static int cine_read_header(AVFormatContext *avctx)
     else
         av_free(description);
 
+    avio_skip(pb, 1176); // RisingEdge ... cmUser
+
+    set_metadata_int(&st->metadata, "enable_crop", avio_rl32(pb));
+    set_metadata_int(&st->metadata, "crop_left", avio_rl32(pb));
+    set_metadata_int(&st->metadata, "crop_top", avio_rl32(pb));
+    set_metadata_int(&st->metadata, "crop_right", avio_rl32(pb));
+    set_metadata_int(&st->metadata, "crop_bottom", avio_rl32(pb));
+
     /* parse image offsets */
     avio_seek(pb, offImageOffsets, SEEK_SET);
     for (i = 0; i < st->duration; i++)



More information about the ffmpeg-cvslog mailing list