Help needed: Support for XMP metadata in MP4 files#1684
Help needed: Support for XMP metadata in MP4 files#1684dirkhh merged 2 commits intosubsurface:masterfrom
Conversation
|
Maybe a stupid remark, but isn't there some open source library that does 95% of the work you now want to implement? We use all kinds of external sources in the project, so adding one should not be a fundamental issue. |
|
I'm sure that such a thing exists. But for me it is easier to write a simple parser than to include an external library in the build system (Travis, Packages, etc). Moreover, we have more control [e.g. prioritize XMP over native, etc]. On the flip side, an external library will be more complete. Some problems will remain: which of the numerous dates that one can find in a video file do we use..? I certainly wouldn't be offended with someone replacing either the XMP-parser with Qt's XML-parser or the whole metadata parsing by an external library. Personally, I just feel too lazy to even start checking the options. |
|
Some cosmetic changes. Notably, don't use the ugly "blank-out uuid" hack. |
dd4fb4f to
172be47
Compare
|
@bstoeger i must admit i concur with @janmulder 's observation. re-inventing the wheel is often an excellent brain exercise, but maintenance is an issue here. who has the time to review such a change and co-maintain it?
i do not like the idea of a custom parser, for the sake of not using Qt's XML parser.
if this is flash video, no need. the format is as dead as flash.
is this https://en.wikipedia.org/wiki/Motion_JPEG ? |
I don't know. I tried to use an easy-to-follow imperative C-style approach. A user (@willemferguson) reported a problem and I tried to fix it in the easiest possible way for me. Though I haven't heard of a confirmation that it works. If someone wants to replace the XML-parser with Qt's implementation that's fine. Personally, I just have too many other open issues. If the general feeling is that this brings more pain than gain - let's dump it. Also fine.
Using Qt's XML parser was the first plan, but after failing to add it to the project and seeing the interface I decided that it's easier for me to write my own. XML is annoying but not rocket science after all.
Note that this is not support of FLV, but support of embedded XMP data. We already have an FLV parser. :) Feel free to remove. No. I'm talking about XMP in standard JPEG still images. That's the whole point of XMP: Have a "standard" (haha - in 10 minutes I found two different kinds of embedded creation dates) metadata format for all common media formats. |
1d500d2 to
c176a36
Compare
|
So here's what I don't understand. We already use |
Nothing. I simply wasn't aware of it. :) |
|
What's the point of the URL argument to |
3066746 to
af6726b
Compare
|
Huh? whereas the docs say: Are we compiling against an outdated version? Btw: the libxml2 documentation/reference is not very good. |
|
Update: now using Still no confirmation that this works with real data apart from my synthetic dummy-videos. Such data would also be necessary for tests. :( |
e14c6d2 to
806f721
Compare
|
Ping...? This now uses Code is not nice, but I see no point in polishing it until we try to extract more usable data from the XMP block [e.g. GPS?]. But here too, working on that makes little sense until we get access to real-world examples. If there is no interest in this feature - let's dump it. |
dirkhh
left a comment
There was a problem hiding this comment.
A couple of small comments, but I think this looks good.
| // Parse content, if not blank node. Content can only be at the second level, | ||
| // since it is always contained in a tag. | ||
| // TODO: We have to cast node to pointer to non-const, since we're supporting | ||
| // old libxml2 versions, where xmlIsBlankNode takes such a pointer. Remove |
There was a problem hiding this comment.
how old? we build libxml2 on some platforms from source, anyway. But in order to understand how realistic it is to say "never mind", I'd need to know how old (or better, "how new") libxml2 has to be...
There was a problem hiding this comment.
I don't know - one of the Travis builds failed for this reason - but I don't remember which. I will push a private branch to find out.
There was a problem hiding this comment.
It's the linux and linux2 builds that fail. See https://travis-ci.org/Subsurface-divelog/subsurface/jobs/433133627
[ 48%] Building CXX object core/CMakeFiles/subsurface_corelib.dir/xmp_parser.cpp.o
/home/travis/build/Subsurface-divelog/subsurface/core/xmp_parser.cpp: In function ‘timestamp_t extract_timestamp(const xmlNode*)’:
/home/travis/build/Subsurface-divelog/subsurface/core/xmp_parser.cpp:95:27: error: invalid conversion from ‘const xmlNode* {aka const _xmlNode*}’ to ‘xmlNodePtr {aka _xmlNode*}’ [-fpermissive]
if (!xmlIsBlankNode(node) && stack_depth >= 2) {
^
In file included from /usr/include/libxml2/libxml/parser.h:16:0,
from /home/travis/build/Subsurface-divelog/subsurface/core/xmp_parser.cpp:4:
/usr/include/libxml2/libxml/tree.h:922:3: error: initializing argument 1 of ‘int xmlIsBlankNode(xmlNodePtr)’ [-fpermissive]
xmlIsBlankNode (xmlNodePtr node);
^
make[2]: *** [core/CMakeFiles/subsurface_corelib.dir/xmp_parser.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Apparently failing version:
Setting up libxml2-dev:amd64 (2.9.1+dfsg1-3ubuntu4.13)
Windows works, which is:
libxml-2.0, version 2.9.4
I guess keeping the cast is just the simple thing to do...
Edit: qt55 also works, which is 2.9.3. So the first version without the issue is 2.9.2 or 2.9.3.
There was a problem hiding this comment.
Well, but that means that as of 16.04 (the oldest we actually support), we should have the right version: https://packages.ubuntu.com/search?keywords=libxml2-dev
I'm fine with keeping the cast. It's annoying that Travis still doesn't offer an out of the box 16.04 or newer.
| // having to unwind the call-stack. We only recurse to a fixed depth, | ||
| // since the data we are interested in are at a shallow depth. | ||
| // This can be increased on demand. | ||
| static const int max_recursion_depth = 16; |
There was a problem hiding this comment.
interesting choice. I assume that made it easier? Faster? ??? i.e. what drove the decision to do this with a fixed stack?
(I'm not saying this is wrong, I just want to understand it better)
There was a problem hiding this comment.
i.e. what drove the decision to do this with a fixed stack?
Laziness. Always suspect laziness first. :-P
It means that we can simple return once we have the datum that we're interested in and don't have to check at higher levels if the lower levels found what they're after.
The interface will have to be adapted anyway once we extract more than one datum, so my reasoning is that it's not worth doing this correctly now.
There was a problem hiding this comment.
In case you ask why it's fixed depth: at first I had an automatically growing std::vector<>, but then changed it to a C-array, because I figured it would be easier to stomach. :)
| @@ -0,0 +1,137 @@ | |||
| #include "xmp_parser.h" | |||
| #include "subsurface-string.h" | |||
| #include "dive.h" // TODO: monster-include file only for utc_mktime. | |||
There was a problem hiding this comment.
hrmpf - just copy the one element that you need? that seems overkill.
XMP is a media-metadata standard based on XML which may be used across a variety of media formats. Some video-processing software writes XMP data without updating the native metadata fields. Therefore, we should aim at reading XMP metadata and give priority of XMP data over native fields. Pros: - Support for *all* common media formats. Cons: - XML (complex, verbose, chaotic). - Does not even come close to fulfilling its promise of being well defined (see below). Implement a simple XMP-parser using libxml2. Connect the XMP-parser to the existing Quicktime/MP4 parser. First problem encountered: According to the spec, XMP data supposed to be put in the 'XMP_' atom. But for example exiftools instead writes an 'uuid' atom with a special 16-byte uid. Implement both, more options will probably follow. Second problem: two versions of recording the creation date were found 1) The content of a <exif:DateTimeOriginal> tag. 2) The xmp::CreateDate attribute of a <rdf:Description> tag. Here too, more versions are expected to surface and will have to be supported in due course (with an obvious priority problem). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
|
On 25/09/2018 18:38, bstoeger wrote:
Ping...?
This now uses |libxml2| (dislike the interface and documentation, but
what can you do) instead of a hand-crafted parser. This seems very low
risk. I tested it on 2 synthetic examples and ran it on a directory of
~100 videos. No issues. No confirmation on real-world data though
***@***.*** <https://github.com/willemferguson>?).
Code is not nice, but I see no point in polishing it until we try to
extract more usable data from the XMP block [e.g. GPS?]. But here too,
working on that makes little sense until we get access to real-world
examples.
If there is no interest in this feature - let's dump it.
— You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub
<#1684 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE1-snJCn6vUZSy7WNgA9YRJa7z47Gm1ks5uelwQgaJpZM4WqdZk>.
Berthold,
Great apologies for you having to ping me.
The video file does not have any date-time attributes defined because it
comprises a merger of a number of small videos All of the same date but
of different times of day). Consequently OpenShot cannot assign
date-times to the combined video and they all appear as zero values. I
messed around with the video file, defining different dates to all the
relevant data attributes of the video. (1) Using Subsurface Version
4.8.2 (public release) =================================== Selected dive
date/time: Sat Sep 8 15:23:19 2018 GMT Files with inappropriate
date/time:
/home/willem/Downloads/exiftool/Image-ExifTool-11.10/whaleshark.mp4 -
Fri Sep 28 12:05:05 2018 GMT This is the *Media Create Date* attribute.
(2) Using Subsurface Version 8.8.2-71
===================================== Selected dive date/time: Sat Sep 8
15:23:19 2018 GMT Files with inappropriate date/time:
/home/willem/Downloads/exiftool/Image-ExifTool-11.10/whaleshark.mp4 -
Tue Sep 25 12:01:05 2018 GMT This is possibly the *Date/Time Original*
attribute, but all the date-time values are the same in the original
file so it is pretty ambiguous. Here are the attributes for the video
file as seen by ExifTool:
(3) Using original video:
================ Here are the results using Subsurface Version 8.8.2-71
on one of the original video files:
Selected dive date/time: Sun Jul 1 12:17:37 2018 GMT
Files with inappropriate date/time:
/home/willem/Downloads/exiftool/Image-ExifTool-11.10/whaleshark.MOV_original
- Mon Jul 2 18:02:10 2018 GMT
Here are the metadata for the combined video file (.mp4): $ exiftool
whaleshark.mp4 ExifTool Version Number : 11.10File Name :
whaleshark.mp4Directory : .File Size : 106 MBFile Modification Date/Time
: 2018:09:26 19:48:32+02:00File Access Date/Time : 2018:09:26
19:48:34+02:00File Inode Change Date/Time : 2018:09:26
19:48:33+02:00File Permissions : rwxrwxrwxFile Type : MP4File Type
Extension : mp4MIME Type : video/mp4Major Brand : MP4 Base Media v1 [IS0
14496-12:2003]Minor Version : 0.2.0Compatible Brands : isom, iso2, avc1,
mp41Movie Data Size : 111009714Movie Data Offset : 48Movie Header
Version : 0Time Scale : 1000Duration : 0:00:57Preferred Rate :
1Preferred Volume : 100.00%Preview Time : 0 sPreview Duration : 0
sPoster Time : 0 sSelection Time : 0 sSelection Duration : 0 sCurrent
Time : 0 sNext Track ID : 3Track Header Version : 0Track Create Date :
2018:09:29 12:05:05Track Modify Date : 0000:00:00 00:00:00Track ID :
1Track Duration : 0:00:57Track Layer : 0Track Volume : 0.00%Image Width
: 1280Image Height : 720Graphics Mode : srcCopyOp Color : 0 0
0Compressor ID : avc1Source Image Width : 1280Source Image Height : 720X
Resolution : 72Y Resolution : 72Bit Depth : 24Video Frame Rate :
24Matrix Structure : 1 0 0 0 1 0 0 0 1Media Header Version : 0Media
Create Date : 2018:09:28 12:05:05Media Modify Date : 0000:00:00
00:00:00Media Time Scale : 44100Media Duration : 0:00:57Media Language
Code : undHandler Description : SoundHandlerBalance : 0Audio Channels :
2Audio Bits Per Sample : 16Audio Sample Rate : 44100Handler Type :
MetadataHandler Vendor ID : AppleEncoder : Lavf57.83.100XMP Toolkit :
Image::ExifTool 11.10Date/Time Original : 2018:09:25 12:01:05Date/Time
Modified : 2018:09:26 12:05:05Create Date : 2018:09:27 12:05:05Modify
Date : 2018:09:09 06:55:00Avg Bitrate : 15.3 MbpsImage Size :
1280x720Megapixels : 0.922Rotation : 0
The way that Subsurface handles it appears pretty logical. I will be
diving for the following week and will do some more video photography
and do some more tests when I am back on Oct 7th.
Here are the metadata for the original video file:
$ exiftool whaleshark.MOV
ExifTool Version Number : 11.10File Name : whaleshark.MOVDirectory :
.File Size : 210 MBFile Modification Date/Time : 2018:09:13
07:44:41+02:00File Access Date/Time : 2018:09:13 07:44:54+02:00File
Inode Change Date/Time : 2018:09:13 07:44:42+02:00File Permissions :
rwxrwxrwxFile Type : MOVFile Type Extension : movMIME Type :
video/quicktimeMajor Brand : Apple QuickTime (.MOV/QT)Minor Version :
2007.9.0Compatible Brands : qt , CAEPMovie Data Size : 219992360Movie
Data Offset : 98312Compressor Version :
CanonAVC0010/02.00.00/00.00.00Exif Byte Order : Little-endian (Intel,
II)Orientation : Horizontal (normal)Resolution Unit : inchesY Cb Cr
Positioning : Co-sitedExposure Time : 0F Number : undefExposure Program
: Program AESensitivity Type : Recommended Exposure IndexRecommended
Exposure Index : 0Exif Version : 0230Date/Time Original : 2018:07:02
18:02:10Components Configuration : Y, Cb, Cr, -Shutter Speed Value :
1Aperture Value : 9.5Exposure Compensation : 0Metering Mode :
Center-weighted averageFlash : Off, Did not fireFocal Length : 18.0
mmMacro Mode : NormalSelf Timer : OffQuality : n/aCanon Flash Mode :
n/aContinuous Drive : MovieFocus Mode : Movie Servo AFRecord Mode :
MOVCanon Image Size : 1920x1080 MovieEasy Mode : ManualDigital Zoom :
NoneContrast : NormalSaturation : NormalCamera ISO : AutoFocus Range :
Not KnownCanon Exposure Mode : Program AELens Type : Canon EF-S 18-55mm
f/3.5-5.6 IS STMMax Focal Length : 55 mmMin Focal Length : 18 mmFocal
Units : 1/mmMax Aperture : 3.6Min Aperture : 23Flash Activity : 0Flash
Bits : (none)Zoom Source Width : 0Zoom Target Width : 0Manual Flash
Output : n/aColor Tone : NormalAuto ISO : 100Measured EV : 11.25Target
Exposure Time : 1White Balance : AutoSlow Shutter : NoneShot Number In
Continuous Burst : 0Optical Zoom Code : n/aCamera Temperature : 36
CFlash Guide Number : 0Flash Exposure Compensation : 0Auto Exposure
Bracketing : OffAEB Bracket Value : 0Control Mode : Camera Local
ControlMeasured EV 2 : 11.25Bulb Duration : 0Camera Type : EOS
High-endND Filter : n/aCanon Image Type : MVI:Canon EOS REBEL SL1Canon
Firmware Version : Firmware Version 1.0.0Owner Name : Canon Model ID :
EOS Rebel SL1 / 100D / Kiss X7Thumbnail Image Valid Area : 0 159 16
103Time Zone : +00:00Time Zone City : LondonDaylight Savings :
OffBracket Mode : OffBracket Value : 0Bracket Shot Number : 0Raw Jpg
Size : LargeWB Bracket Mode : OffWB Bracket Value AB : 0WB Bracket Value
GM : 0Live View Shooting : OnFocus Distance Upper : 0.38 mFocus Distance
Lower : 0.35 mFlash Exposure Lock : OffLens Model : EF-S18-55mm
f/3.5-5.6 IS STMInternal Serial Number : HA0252828Crop Left Margin :
0Crop Right Margin : 0Crop Top Margin : 0Crop Bottom Margin : 0Exposure
Level Increments : 1/2 StopISO Expansion : OffHighlight Tone Priority :
DisableAF Assist Beam : EmitsMirror Lockup : DisableShutter Button AF On
Button : Metering + AF startSet Button When Shooting : Normal
(disabled)LCD Display At Power On : DisplayTone Curve :
StandardSharpness : 5Sharpness Frequency : n/aSensor Red Level : 0Sensor
Blue Level : 0White Balance Red : 0White Balance Blue : 0Color
Temperature : 5200Picture Style : StandardDigital Gain : 0WB Shift AB :
0WB Shift GM : 0Color Space : sRGBVRD Offset : 0Sensor Width :
5280Sensor Height : 3528Sensor Left Border : 84Sensor Top Border :
64Sensor Right Border : 5267Sensor Bottom Border : 3519Black Mask Left
Border : 0Black Mask Top Border : 0Black Mask Right Border : 0Black Mask
Bottom Border : 0Picture Style User Def : Auto; Auto; AutoPicture Style
PC : None; None; NoneCustom Picture Style File Name : Peripheral
Illumination Corr : OffAuto Lighting Optimizer : LowLong Exposure Noise
Reduction : OffHigh ISO Noise Reduction : StandardLens Serial Number :
000026e87bUser Comment : Sub Sec Time : 46Sub Sec Time Original : 46Sub
Sec Time Digitized : 46Flashpix Version : 0100Exif Image Width : 160Exif
Image Height : 120Interoperability Index : THM - DCF thumbnail
fileInteroperability Version : 0100Related Image Width : 1920Related
Image Height : 1080Focal Plane X Resolution : 178.9709172Focal Plane Y
Resolution : 201.0050251Focal Plane Resolution Unit : inchesCustom
Rendered : NormalExposure Mode : AutoScene Capture Type : StandardSerial
Number : 022070018769Lens Info : 18-55mm f/0Encoding Process : Baseline
DCT, Huffman codingBits Per Sample : 8Color Components : 3Y Cb Cr Sub
Sampling : YCbCr4:2:2 (2 1)Thumbnail Image : (Binary data 8879 bytes,
use -b option to extract)XMP Toolkit : Image::ExifTool 11.10Make :
CanonModel : Canon EOS REBEL SL1User Rating : 0Movie Header Version :
0Create Date : 2018:09:09 18:02:10Modify Date : 2018:09:09 18:02:10Time
Scale : 25000Duration : 0:00:41Preferred Rate : 1Preferred Volume :
100.00%Preview Time : 0 sPreview Duration : 0 sPoster Time : 0
sSelection Time : 0 sSelection Duration : 0 sCurrent Time : 0 sNext
Track ID : 3Track Header Version : 0Track Create Date : 2018:07:02
18:02:10Track Modify Date : 2018:07:02 18:02:10Track ID : 1Track
Duration : 0:00:41Track Layer : 0Track Volume : 0.00%Image Width :
1920Image Height : 1080Graphics Mode : srcCopyOp Color : 0 0 0Compressor
ID : avc1Source Image Width : 1920Source Image Height : 1080X Resolution
: 72Y Resolution : 72Bit Depth : 24Video Frame Rate : 25Matrix Structure
: 1 0 0 0 1 0 0 0 1Media Header Version : 0Media Create Date :
2018:07:02 18:02:10Media Modify Date : 2018:07:02 18:02:10Media Time
Scale : 48000Media Duration : 0:00:41Balance : 0Handler Class : Data
HandlerHandler Type : Alias DataAudio Format : sowtAudio Bits Per Sample
: 16Audio Sample Rate : 48000Layout Flags : StereoAudio Channels :
2Aperture : undefAvg Bitrate : 42.5 MbpsDrive Mode : Continuous
ShootingImage Size : 1920x1080Lens : 18.0 - 55.0 mmLens ID : Canon EF-S
18-55mm f/3.5-5.6 IS STMMegapixels : 2.1Rotation : 0Scale Factor To 35
mm Equivalent: 1.6Shooting Mode : Program AEShutter Speed : 0Create Date
: 2018:07:02 18:02:10.46Date/Time Original : 2018:07:02
18:02:10.46Modify Date : 2018:07:02 18:02:10.46Circle Of Confusion :
0.019 mmDepth Of Field : 0.00 m (0.36 - 0.36 m)Field Of View : 64.5
degFocal Length : 18.0 mm (35 mm equivalent: 28.5 mm)Hyperfocal Distance
: Inf mLens : 18.0 - 55.0 mm (35 mm equivalent: 28.5 - 87.2 mm) $
Kind regards,
willem
…--
This message and attachments are subject to a disclaimer.
Please refer to
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf
<http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf> for
full
details.
|
|
Please ignore my previous email. I got some text mixed up. Here is an
improvement:
On 25/09/2018 18:38, bstoeger wrote:
Ping...?
This now uses |libxml2| (dislike the interface and documentation, but
what can you do) instead of a hand-crafted parser. This seems very low
risk. I tested it on 2 synthetic examples and ran it on a directory of
~100 videos. No issues. No confirmation on real-world data though
***@***.*** <https://github.com/willemferguson>?).
Code is not nice, but I see no point in polishing it until we try to
extract more usable data from the XMP block [e.g. GPS?]. But here too,
working on that makes little sense until we get access to real-world
examples.
If there is no interest in this feature - let's dump it.
— You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub
<#1684 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE1-snJCn6vUZSy7WNgA9YRJa7z47Gm1ks5uelwQgaJpZM4WqdZk>.
Berthold,
Great apologies for you having to ping me.
The video file does not have any date-time attributes defined because it
comprises a merger of a number of small videos All of the same date but
of different times of day). Consequently OpenShot cannot assign
date-times to the combined video and they all appear as zero values. I
messed around with the video file, defining different dates to all the
relevant data attributes of the video. (1) Using Subsurface Version
4.8.2 (public release) =================================== Selected dive
date/time: Sat Sep 8 15:23:19 2018 GMT Files with inappropriate
date/time:
/home/willem/Downloads/exiftool/Image-ExifTool-11.10/whaleshark.mp4 -
Fri Sep 28 12:05:05 2018 GMT This is the *Media Create Date* attribute.
(2) Using Subsurface Version 8.8.2-71
===================================== Selected dive date/time: Sat Sep 8
15:23:19 2018 GMT Files with inappropriate date/time:
/home/willem/Downloads/exiftool/Image-ExifTool-11.10/whaleshark.mp4 -
Tue Sep 25 12:01:05 2018 GMT
This is the *Date/Time Original* attribute Here are the attributes for
the video file as seen by ExifTool:
(3) Using original video:
================ Here are the results using Subsurface Version 8.8.2-71
on one of the original video files:
Selected dive date/time: Sun Jul 1 12:17:37 2018 GMT
Files with inappropriate date/time:
/home/willem/Downloads/exiftool/Image-ExifTool-11.10/whaleshark.MOV_original
- Mon Jul 2 18:02:10 2018 GMT
This is possibly the *Date/Time Original* attribute, but all the
date-time values are the same in the original file so it is pretty
ambiguous.
Here are the metadata for the combined video file (.mp4): $ exiftool
whaleshark.mp4 ExifTool Version Number : 11.10File Name :
whaleshark.mp4Directory : .File Size : 106 MBFile Modification Date/Time
: 2018:09:26 19:48:32+02:00File Access Date/Time : 2018:09:26
19:48:34+02:00File Inode Change Date/Time : 2018:09:26
19:48:33+02:00File Permissions : rwxrwxrwxFile Type : MP4File Type
Extension : mp4MIME Type : video/mp4Major Brand : MP4 Base Media v1 [IS0
14496-12:2003]Minor Version : 0.2.0Compatible Brands : isom, iso2, avc1,
mp41Movie Data Size : 111009714Movie Data Offset : 48Movie Header
Version : 0Time Scale : 1000Duration : 0:00:57Preferred Rate :
1Preferred Volume : 100.00%Preview Time : 0 sPreview Duration : 0
sPoster Time : 0 sSelection Time : 0 sSelection Duration : 0 sCurrent
Time : 0 sNext Track ID : 3Track Header Version : 0Track Create Date :
2018:09:29 12:05:05Track Modify Date : 0000:00:00 00:00:00Track ID :
1Track Duration : 0:00:57Track Layer : 0Track Volume : 0.00%Image Width
: 1280Image Height : 720Graphics Mode : srcCopyOp Color : 0 0
0Compressor ID : avc1Source Image Width : 1280Source Image Height : 720X
Resolution : 72Y Resolution : 72Bit Depth : 24Video Frame Rate :
24Matrix Structure : 1 0 0 0 1 0 0 0 1Media Header Version : 0Media
Create Date : 2018:09:28 12:05:05Media Modify Date : 0000:00:00
00:00:00Media Time Scale : 44100Media Duration : 0:00:57Media Language
Code : undHandler Description : SoundHandlerBalance : 0Audio Channels :
2Audio Bits Per Sample : 16Audio Sample Rate : 44100Handler Type :
MetadataHandler Vendor ID : AppleEncoder : Lavf57.83.100XMP Toolkit :
Image::ExifTool 11.10Date/Time Original : 2018:09:25 12:01:05Date/Time
Modified : 2018:09:26 12:05:05Create Date : 2018:09:27 12:05:05Modify
Date : 2018:09:09 06:55:00Avg Bitrate : 15.3 MbpsImage Size :
1280x720Megapixels : 0.922Rotation : 0
The way that Subsurface handles it appears pretty logical. I will be
diving for the following week and will do some more video photography
and do some more tests when I am back on Oct 7th.
Here are the metadata for the original video file:
$ exiftool whaleshark.MOV
ExifTool Version Number : 11.10File Name : whaleshark.MOVDirectory :
.File Size : 210 MBFile Modification Date/Time : 2018:09:13
07:44:41+02:00File Access Date/Time : 2018:09:13 07:44:54+02:00File
Inode Change Date/Time : 2018:09:13 07:44:42+02:00File Permissions :
rwxrwxrwxFile Type : MOVFile Type Extension : movMIME Type :
video/quicktimeMajor Brand : Apple QuickTime (.MOV/QT)Minor Version :
2007.9.0Compatible Brands : qt , CAEPMovie Data Size : 219992360Movie
Data Offset : 98312Compressor Version :
CanonAVC0010/02.00.00/00.00.00Exif Byte Order : Little-endian (Intel,
II)Orientation : Horizontal (normal)Resolution Unit : inchesY Cb Cr
Positioning : Co-sitedExposure Time : 0F Number : undefExposure Program
: Program AESensitivity Type : Recommended Exposure IndexRecommended
Exposure Index : 0Exif Version : 0230Date/Time Original : 2018:07:02
18:02:10Components Configuration : Y, Cb, Cr, -Shutter Speed Value :
1Aperture Value : 9.5Exposure Compensation : 0Metering Mode :
Center-weighted averageFlash : Off, Did not fireFocal Length : 18.0
mmMacro Mode : NormalSelf Timer : OffQuality : n/aCanon Flash Mode :
n/aContinuous Drive : MovieFocus Mode : Movie Servo AFRecord Mode :
MOVCanon Image Size : 1920x1080 MovieEasy Mode : ManualDigital Zoom :
NoneContrast : NormalSaturation : NormalCamera ISO : AutoFocus Range :
Not KnownCanon Exposure Mode : Program AELens Type : Canon EF-S 18-55mm
f/3.5-5.6 IS STMMax Focal Length : 55 mmMin Focal Length : 18 mmFocal
Units : 1/mmMax Aperture : 3.6Min Aperture : 23Flash Activity : 0Flash
Bits : (none)Zoom Source Width : 0Zoom Target Width : 0Manual Flash
Output : n/aColor Tone : NormalAuto ISO : 100Measured EV : 11.25Target
Exposure Time : 1White Balance : AutoSlow Shutter : NoneShot Number In
Continuous Burst : 0Optical Zoom Code : n/aCamera Temperature : 36
CFlash Guide Number : 0Flash Exposure Compensation : 0Auto Exposure
Bracketing : OffAEB Bracket Value : 0Control Mode : Camera Local
ControlMeasured EV 2 : 11.25Bulb Duration : 0Camera Type : EOS
High-endND Filter : n/aCanon Image Type : MVI:Canon EOS REBEL SL1Canon
Firmware Version : Firmware Version 1.0.0Owner Name : Canon Model ID :
EOS Rebel SL1 / 100D / Kiss X7Thumbnail Image Valid Area : 0 159 16
103Time Zone : +00:00Time Zone City : LondonDaylight Savings :
OffBracket Mode : OffBracket Value : 0Bracket Shot Number : 0Raw Jpg
Size : LargeWB Bracket Mode : OffWB Bracket Value AB : 0WB Bracket Value
GM : 0Live View Shooting : OnFocus Distance Upper : 0.38 mFocus Distance
Lower : 0.35 mFlash Exposure Lock : OffLens Model : EF-S18-55mm
f/3.5-5.6 IS STMInternal Serial Number : HA0252828Crop Left Margin :
0Crop Right Margin : 0Crop Top Margin : 0Crop Bottom Margin : 0Exposure
Level Increments : 1/2 StopISO Expansion : OffHighlight Tone Priority :
DisableAF Assist Beam : EmitsMirror Lockup : DisableShutter Button AF On
Button : Metering + AF startSet Button When Shooting : Normal
(disabled)LCD Display At Power On : DisplayTone Curve :
StandardSharpness : 5Sharpness Frequency : n/aSensor Red Level : 0Sensor
Blue Level : 0White Balance Red : 0White Balance Blue : 0Color
Temperature : 5200Picture Style : StandardDigital Gain : 0WB Shift AB :
0WB Shift GM : 0Color Space : sRGBVRD Offset : 0Sensor Width :
5280Sensor Height : 3528Sensor Left Border : 84Sensor Top Border :
64Sensor Right Border : 5267Sensor Bottom Border : 3519Black Mask Left
Border : 0Black Mask Top Border : 0Black Mask Right Border : 0Black Mask
Bottom Border : 0Picture Style User Def : Auto; Auto; AutoPicture Style
PC : None; None; NoneCustom Picture Style File Name : Peripheral
Illumination Corr : OffAuto Lighting Optimizer : LowLong Exposure Noise
Reduction : OffHigh ISO Noise Reduction : StandardLens Serial Number :
000026e87bUser Comment : Sub Sec Time : 46Sub Sec Time Original : 46Sub
Sec Time Digitized : 46Flashpix Version : 0100Exif Image Width : 160Exif
Image Height : 120Interoperability Index : THM - DCF thumbnail
fileInteroperability Version : 0100Related Image Width : 1920Related
Image Height : 1080Focal Plane X Resolution : 178.9709172Focal Plane Y
Resolution : 201.0050251Focal Plane Resolution Unit : inchesCustom
Rendered : NormalExposure Mode : AutoScene Capture Type : StandardSerial
Number : 022070018769Lens Info : 18-55mm f/0Encoding Process : Baseline
DCT, Huffman codingBits Per Sample : 8Color Components : 3Y Cb Cr Sub
Sampling : YCbCr4:2:2 (2 1)Thumbnail Image : (Binary data 8879 bytes,
use -b option to extract)XMP Toolkit : Image::ExifTool 11.10Make :
CanonModel : Canon EOS REBEL SL1User Rating : 0Movie Header Version :
0Create Date : 2018:09:09 18:02:10Modify Date : 2018:09:09 18:02:10Time
Scale : 25000Duration : 0:00:41Preferred Rate : 1Preferred Volume :
100.00%Preview Time : 0 sPreview Duration : 0 sPoster Time : 0
sSelection Time : 0 sSelection Duration : 0 sCurrent Time : 0 sNext
Track ID : 3Track Header Version : 0Track Create Date : 2018:07:02
18:02:10Track Modify Date : 2018:07:02 18:02:10Track ID : 1Track
Duration : 0:00:41Track Layer : 0Track Volume : 0.00%Image Width :
1920Image Height : 1080Graphics Mode : srcCopyOp Color : 0 0 0Compressor
ID : avc1Source Image Width : 1920Source Image Height : 1080X Resolution
: 72Y Resolution : 72Bit Depth : 24Video Frame Rate : 25Matrix Structure
: 1 0 0 0 1 0 0 0 1Media Header Version : 0Media Create Date :
2018:07:02 18:02:10Media Modify Date : 2018:07:02 18:02:10Media Time
Scale : 48000Media Duration : 0:00:41Balance : 0Handler Class : Data
HandlerHandler Type : Alias DataAudio Format : sowtAudio Bits Per Sample
: 16Audio Sample Rate : 48000Layout Flags : StereoAudio Channels :
2Aperture : undefAvg Bitrate : 42.5 MbpsDrive Mode : Continuous
ShootingImage Size : 1920x1080Lens : 18.0 - 55.0 mmLens ID : Canon EF-S
18-55mm f/3.5-5.6 IS STMMegapixels : 2.1Rotation : 0Scale Factor To 35
mm Equivalent: 1.6Shooting Mode : Program AEShutter Speed : 0Create Date
: 2018:07:02 18:02:10.46Date/Time Original : 2018:07:02
18:02:10.46Modify Date : 2018:07:02 18:02:10.46Circle Of Confusion :
0.019 mmDepth Of Field : 0.00 m (0.36 - 0.36 m)Field Of View : 64.5
degFocal Length : 18.0 mm (35 mm equivalent: 28.5 mm)Hyperfocal Distance
: Inf mLens : 18.0 - 55.0 mm (35 mm equivalent: 28.5 - 87.2 mm) $
Kind regards,
willem
…--
This message and attachments are subject to a disclaimer.
Please refer to
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf
<http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf> for
full
details.
|
Describe the pull request:
Pull request long description:
As @willemferguson noted, some video-manipulation software updates the XMP-metadata, but not the native metadata of MP4s. Therefore, we'll have to support XMP-metadata. This is a first rudimentary attempt.
It follows the bad practice of implementing a pseudo-XML parser instead of using a real, robust XML parser. I was too lazy to get Qt's XML parser to work. Moreover, Qt's parser is rumored to be slow and therefore it might be a problem if directories with thousands of pictures are imported (though without measurement this is purely speculation).
In any case it turns out the XMP metadata is not standardized at all. Unfortunately I don't possess videos with such metadata. Therefore I would need help:
If you have such files, please give this a try and if it doesn't work, send me the appropriate metadata-block. It usually is at the end of the file and starts with something like
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>. The few bytes before the start probably help too.Thanks.
I will then try to add support for the other file types [FLV, AVI, JPG].
Changes made:
Related issues:
Additional information:
Release note:
Done.
Documentation change:
Perhaps? Or too detailed?
Mentions: