Fwd: Re: [Subsurface-divelog/subsurface] Help needed: Support for XMP metadata in MP4 files (#1684)

Willem Ferguson willemferguson at zoology.up.ac.za
Wed Sep 26 12:23:53 PDT 2018


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 
> (@willemferguson <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 
> <https://github.com/Subsurface-divelog/subsurface/pull/1684#issuecomment-424412624>, 
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20180926/4ffcab63/attachment-0001.html>


More information about the subsurface mailing list