- Timestamp:
- 2021-02-26T19:39:51+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cpan/Image/ExifTool/DV.pm
r24107 r34921 16 16 use Image::ExifTool qw(:DataAccess :Utils); 17 17 18 $VERSION = '1.0 0';18 $VERSION = '1.02'; 19 19 20 20 # DV profiles (ref 1) … … 25 25 FrameSize => 120000, 26 26 VideoFormat => 'IEC 61834, SMPTE-314M - 525/60 (NTSC)', 27 VideoScanType => 'Progressive',28 27 Colorimetry => '4:1:1', 29 28 FrameRate => 30000/1001, … … 35 34 FrameSize => 144000, 36 35 VideoFormat => 'IEC 61834 - 625/50 (PAL)', 37 VideoScanType => 'Progressive',38 36 Colorimetry => '4:2:0', 39 37 FrameRate => 25/1, … … 45 43 FrameSize => 144000, 46 44 VideoFormat => 'SMPTE-314M - 625/50 (PAL)', 47 VideoScanType => 'Progressive',48 45 Colorimetry => '4:1:1', 49 46 FrameRate => 25/1, … … 55 52 FrameSize => 240000, 56 53 VideoFormat => 'DVCPRO50: SMPTE-314M - 525/60 (NTSC) 50 Mbps', 57 VideoScanType => 'Progressive',58 54 Colorimetry => '4:2:2', 59 55 FrameRate => 30000/1001, … … 65 61 FrameSize => 288000, 66 62 VideoFormat => 'DVCPRO50: SMPTE-314M - 625/50 (PAL) 50 Mbps', 67 VideoScanType => 'Progressive',68 63 Colorimetry => '4:2:2', 69 64 FrameRate => 25/1, … … 75 70 FrameSize => 480000, 76 71 VideoFormat => 'DVCPRO HD: SMPTE-370M - 1080i60 100 Mbps', 77 VideoScanType => 'Interlaced',78 72 Colorimetry => '4:2:2', 79 73 FrameRate => 30000/1001, … … 85 79 FrameSize => 576000, 86 80 VideoFormat => 'DVCPRO HD: SMPTE-370M - 1080i50 100 Mbps', 87 VideoScanType => 'Interlaced',88 81 Colorimetry => '4:2:2', 89 82 FrameRate => 25/1, … … 95 88 FrameSize => 240000, 96 89 VideoFormat => 'DVCPRO HD: SMPTE-370M - 720p60 100 Mbps', 97 VideoScanType => 'Progressive',98 90 Colorimetry => '4:2:2', 99 91 FrameRate => 60000/1001, … … 105 97 FrameSize => 288000, 106 98 VideoFormat => 'DVCPRO HD: SMPTE-370M - 720p50 100 Mbps', 107 VideoScanType => 'Progressive',108 99 Colorimetry => '4:2:2', 109 100 FrameRate => 50/1, … … 115 106 FrameSize => 144000, 116 107 VideoFormat => 'IEC 61883-5 - 625/50 (PAL)', 117 VideoScanType => 'Progressive',118 108 Colorimetry => '4:2:0', 119 109 FrameRate => 25/1, … … 137 127 NOTES => 'The following tags are extracted from DV videos.', 138 128 DateTimeOriginal => { 129 Description => 'Date/Time Original', 139 130 Groups => { 2 => 'Time' }, 140 131 PrintConv => '$self->ConvertDateTime($val)', … … 160 151 sub ProcessDV($$) 161 152 { 162 my ($e xifTool, $dirInfo) = @_;153 my ($et, $dirInfo) = @_; 163 154 local $_; 164 155 my $raf = $$dirInfo{RAF}; … … 180 171 return 0 if $start + 80 * 6 > $len; 181 172 182 $e xifTool->SetFileType();173 $et->SetFileType(); 183 174 184 175 my $pos = $start; 185 my $dsf = Get8u(\$buff, $pos + 3) & 0x80>> 7;176 my $dsf = (Get8u(\$buff, $pos + 3) & 0x80) >> 7; 186 177 my $stype = Get8u(\$buff, $pos + 80*5 + 48 + 3) & 0x1f; 187 178 … … 195 186 last; 196 187 } 197 $profile or $e xifTool->Warn("Unrecognized DV profile"), return 1;188 $profile or $et->Warn("Unrecognized DV profile"), return 1; 198 189 } 199 190 my $tagTablePtr = GetTagTable('Image::ExifTool::DV::Main'); … … 201 192 # calculate total bit rate and duration 202 193 my $byteRate = $$profile{FrameSize} * $$profile{FrameRate}; 203 my $fileSize = $$e xifTool{VALUE}{FileSize};194 my $fileSize = $$et{VALUE}{FileSize}; 204 195 $$profile{TotalBitrate} = 8 * $byteRate; 205 196 $$profile{Duration} = $fileSize / $byteRate if defined $fileSize; … … 208 199 delete $$profile{DateTimeOriginal}; 209 200 delete $$profile{AspectRatio}; 210 my ($date, $time, $is16_9); 201 delete $$profile{VideoScanType}; 202 my ($date, $time, $is16_9, $interlace); 211 203 for ($i=1; $i<6; ++$i) { 212 204 $pos += 80; … … 220 212 my $t = Get8u(\$buff, $p + 2); 221 213 $is16_9 = (($t & 0x07) == 0x02 or (not $apt and ($t & 0x07) == 0x07)); 214 $interlace = Get8u(\$buff, $p + 3) & 0x10; # (ref 2) 222 215 } elsif ($type == 0x62) { # date 223 216 # mask off unused bits … … 245 238 if ($date and $time) { 246 239 $$profile{DateTimeOriginal} = "$date $time"; 247 $$profile{AspectRatio} = $is16_9 ? '16:9' : '5:4' if defined $is16_9; 240 if (defined $is16_9) { 241 $$profile{AspectRatio} = $is16_9 ? '16:9' : '4:3'; 242 $$profile{VideoScanType} = $interlace ? 'Interlaced' : 'Progressive'; 243 } 248 244 } 249 245 … … 271 267 foreach $tag (@dvTags) { 272 268 next unless defined $$profile{$tag}; 273 $e xifTool->HandleTag($tagTablePtr, $tag, $$profile{$tag});269 $et->HandleTag($tagTablePtr, $tag, $$profile{$tag}); 274 270 } 275 271 … … 296 292 =head1 AUTHOR 297 293 298 Copyright 2003-20 11, Phil Harvey (phil at owl.phy.queensu.ca)294 Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com) 299 295 300 296 This library is free software; you can redistribute it and/or modify it
Note:
See TracChangeset
for help on using the changeset viewer.