1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
#------------------------------------------------------------------------------
# File: dji.config
#
# Description: This config file defines Composite tags to convert embedded
# metadata in videos from DJI drones
#
# Usage: exiftool -config dji.config -ee FILE
#
# Example command to create .gpx log file from DJI video
# (requires gpx.fmt available in the full Exiftool distribution):
#
# exiftool -config dji.config -p gpx.fmt -ee -api QuickTimeUTC FILE
#
# Requires: ExifTool version 10.75 or later
#
# Revisions: 2018/03/23 - P. Harvey Created
#------------------------------------------------------------------------------
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
GROUPS => { 2 => 'Location' },
#
# Example embedded "Text" from a DJI FC6310:
#
# "F/3.5, SS 1000, ISO 100, EV 0, GPS (8.6499, 53.1665, 18), D 24.26m,
# H 6.00m, H.S 2.10m/s, V.S 0.00m/s \n"
#
# F/ = F Number
# SS = shutter speed
# ISO = ISO
# GPS = (longitude, latitude, ???)
# D = horizontal distance from home point
# H = vertical distance from home point
# H.S = horizontal speed
# V.S = vertical speed
#
# Note: SubDoc flag is set for all these tags so they will be generated for
# all embedded documents
#
GPSDateTime => {
Description => 'GPS Date/Time',
Groups => { 2 => 'Time' },
SubDoc => 1,
Require => {
0 => 'Text',
1 => 'SampleTime',
2 => 'Main:CreateDate',
3 => 'Main:Duration',
},
# (assuming CreateDate is the end time of the video, we subtract
# Duration because a SampleTime of zero is at the start of the video)
ValueConv => q{
my $diff = $val[1] - $val[3];
my $sign = $diff =~ s/^-// ? '-' : '';
my $time = $val[2] . '.000';
ShiftTime($time, "${sign}0:0:$diff");
return $time;
},
PrintConv => '$self->ConvertDateTime($val)',
},
GPSLatitude => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /GPS \(\S+,\s*([-+]?\d*\.\d+)/ ? $1 : undef',
PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "N")',
},
GPSLongitude => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /GPS \(([-+]?\d*\.\d+),/ ? $1 : undef',
PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "E")',
},
GPSAltitude => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /,\s*H\s+([-+]?\d+\.?\d*)m/ ? $1 : undef',
},
GPSSpeed => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /,\s*H.S\s+([-+]?\d+\.?\d*)/ ? $1 * 3.6 : undef',
},
GPSSpeedRef => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /,\s*H.S\s+([-+]?\d+\.?\d*)m\/s/ ? "K" : undef',
PrintConv => { K => 'km/h', M => 'mph', N => 'knots' },
},
Distance => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /,\s*D\s+(\d+\.?\d*)m/ ? $1 * 3.6 : undef',
PrintConv => '"$val m"',
},
VerticalSpeed => {
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /,\s*V.S\s+([-+]?\d+\.?\d*)/ ? $1 : undef',
PrintConv => '"$val m/s"',
},
FNumber => {
Groups => { 2 => 'Camera' },
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /\bF\/(\d+\.?\d*)/ ? $1 : undef',
PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
},
ExposureTime => {
Groups => { 2 => 'Camera' },
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /\bSS\s+(\d+\.?\d*)/ ? 1/$1 : undef',
PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
},
ExposureCompensation => {
Groups => { 2 => 'Camera' },
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /\bEV\s+([-+]?\d+\.?\d*)(\/\d+)?/ ? ($1 / ($2 || 1)) : undef',
PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
},
ISO => {
Groups => { 2 => 'Camera' },
SubDoc => 1,
Require => { 0 => 'Text' },
RawConv => '$val[0] =~ /\bISO\s+(\d+\.?\d*)/ ? $1 : undef',
},
},
);
1; #end
|