Changeset 27529
- Timestamp:
- 2013-06-04T11:07:21+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/video-and-audio/trunk/src/perllib/plugins/SimpleVideoPlugin.pm
r27527 r27529 133 133 my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_; 134 134 135 if (!&FileUtils::isFilenameAbsolute($file) && $base_dir ne '') 136 { 137 $file = &FileUtils::filenameConcatenate($base_dir, $file); 138 } 139 135 140 print STDERR "[A:" . time() . "] SimpleVideoPlugin processing: " . $file . "\n"; 136 141 … … 161 166 $separate_io = 'true'; 162 167 } 168 ###rint STDERR "[DEBUG] separate_io:" . $separate_io . "\n"; 163 169 164 170 my $process_dir = $ENV{'GSDLCOLLECTDIR'}; … … 206 212 print STDERR "[B2:" . time() . "] Complete\n"; 207 213 } 214 else 215 { 216 print "Not gonna work!\n"; 217 exit; 218 } 208 219 209 220 # 1. Use MediaInfo to extract important metadata … … 212 223 my $mi_metadata = $self->getMetadata($ivideo_path); 213 224 $doc_obj->add_utf8_metadata($topsection,"Format", 'multimedia (' . $mi_metadata->{'General'}->{'Format'} . ')'); 214 $doc_obj->set_metadata_element($topsection,"FileSize",$mi_metadata->{'General'}->{'File_size'}); 225 if (defined $mi_metadata->{'General'}->{'File_size'}) 226 { 227 $doc_obj->set_metadata_element($topsection, "FileSize", $mi_metadata->{'General'}->{'File_size'}); 228 } 229 else 230 { 231 $doc_obj->set_metadata_element($topsection, "FileSize", &FileUtils::fileSize($ivideo_path)); 232 } 215 233 $doc_obj->add_utf8_metadata($topsection,"Duration",$mi_metadata->{'General'}->{'Duration'}); 216 234 if (defined $mi_metadata->{'Video'}->{'Format_Info'} && defined $mi_metadata->{'Video'}->{'Format'}) … … 283 301 { 284 302 $attempt_count++; 285 print "[DEBUG: Video conversion attempt #" . $attempt_count . ": |" . $cmd . "|]\n";303 ###rint "[DEBUG: Video conversion attempt #" . $attempt_count . ": |" . $cmd . "|]\n"; 286 304 `$cmd`; 287 305 } … … 349 367 my ($self, $ivideo_path) = @_; 350 368 my $cmd = 'mediainfo --Output=XML "' . $ivideo_path . '" 2>&1'; 351 ### print "Cmd: " . $cmd . "\n";369 ###rint "[DEBUG] command: " . $cmd . "\n"; 352 370 my $metadata_xml = `$cmd`; 371 ###rint "[DEBUG] result: " . $metadata_xml . "\n\n"; 353 372 my @lines = split(/\r?\n/, $metadata_xml); 354 373 my $metadata = {'Unknown'=>{}};
Note:
See TracChangeset
for help on using the changeset viewer.