Changeset 27552

Show
Ignore:
Timestamp:
05.06.2013 13:08:47 (6 years ago)
Author:
jmt12
Message:

Altering the debug comments to provide IO boundary timings a little more machine readable

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video-and-audio/trunk/src/perllib/plugins/SimpleVideoPlugin.pm

    r27529 r27552  
    138138  } 
    139139 
    140   print STDERR "[A:" . time() . "] SimpleVideoPlugin processing: " . $file . "\n"; 
     140  print STDERR " * SimpleVideoPlugin processing: " . $file . "\n"; 
    141141 
    142142  # - I have to add some text (yay, back to needing dummy text) otherwise the 
     
    206206  if ($separate_io eq 'true') 
    207207  { 
    208     print STDERR "[B1:" . time() . "] Creating local copy of file: " . $ivideo_path . "\n"; 
     208    my $io_start = time(); 
     209    print " - creating local copy of file: " . $ivideo_path . " [IOS:" . time() . "]\n"; 
    209210    my $local_ivideo_path = &FileUtils::filenameConcatenate($process_dir, $filename . ".ts"); 
    210211    &FileUtils::copyFiles($ivideo_path, $local_ivideo_path); 
    211212    $ivideo_path = $local_ivideo_path; 
    212     print STDERR "[B2:" . time() . "] Complete\n"; 
    213   } 
    214   else 
    215   { 
    216     print "Not gonna work!\n"; 
    217     exit; 
     213    print " - copied! [IOE:" . time() . "]\n"; 
    218214  } 
    219215 
    220216  # 1. Use MediaInfo to extract important metadata 
    221   print STDERR "[C1:" . time() . "] Extracting metadata\n"; 
    222   print " - Extracting metadata using MediaInfo\n"; 
     217  print ' - Extracting metadata using MediaInfo...'; 
    223218  my $mi_metadata = $self->getMetadata($ivideo_path); 
    224219  $doc_obj->add_utf8_metadata($topsection,"Format", 'multimedia (' . $mi_metadata->{'General'}->{'Format'} . ')'); 
     
    242237  $doc_obj->add_utf8_metadata($topsection,"Width",$mi_metadata->{'Video'}->{'Width'}); 
    243238  $doc_obj->add_utf8_metadata($topsection,"Height",$mi_metadata->{'Video'}->{'Height'}); 
    244   print STDERR "[C2:" . time() . "] Complete\n"; 
     239  print STDERR "Done!\n"; 
    245240 
    246241  # 2. Convert into FLV, reprocess to make seekable, and associate 
    247242  # - generate a path for our temporary converted video file 
    248   print STDERR "[D1:" . time() . "] Converting video to streamble format\n"; 
     243  print STDERR " - Converting video to streamble format...\n"; 
    249244  my $ovideo_path = &FileUtils::filenameConcatenate($tmp_dir, 'gsv.mp4'); 
    250245  if (&FileUtils::fileExists($ovideo_path)) 
    251246  { 
    252     print " - Found existing converted video in cache\n"; 
     247    print "   - Found existing converted video in cache!\n"; 
    253248  } 
    254249  else 
    255250  { 
    256251    # - first conversion pass 
    257     print " - Convert using Handbrake\n"; 
     252    print "   - Convert using Handbrake\n"; 
    258253    my $streaming_HQ_size    = $self->{'streamingHQsize'}; 
    259254    my $streaming_HQ_VideoBitrate    = $self->{'streamingHQVideoBitrate'}; 
     
    310305    die("Fatal Error! Failed to convert video: " . $ovideo_path . "\nReason:" . $! . "\n"); 
    311306  } 
    312   print STDERR "[D2:" . time() . "] Complete\n"; 
     307  print STDERR " - conversion done!\n"; 
    313308 
    314309  # 3. Extract keyframes using hive 
    315   print STDERR "[E1:" . time() . "] Extract keyframes\n"; 
     310  print STDERR " - extract keyframes...\n"; 
    316311  my $oshots_path = &FileUtils::filenameConcatenate($tmp_dir, 'shots.xml'); 
    317312  if (&FileUtils::fileExists($oshots_path)) 
    318313  { 
    319     print " - Found existing keyframe images in cache\n"; 
     314    print "   - found existing keyframe images in cache\n"; 
    320315  } 
    321316  else 
    322317  { 
    323     print " - Generating keyframe images using Hive2\n"; 
     318    print "   - generating keyframe images using Hive2\n"; 
    324319    my $cmd = 'hive2_ffmpegsvn -o "' . $oshots_path . '" -k "' . $tmp_dir . '" "' . $ovideo_path . '" >> "' . $convert_log_path . '" 2>&1'; 
    325320    ###print "[cmd: " . $cmd . "]\n"; 
     
    330325    die("Fatal Error! Failed to extract keyframe images: " . $oshots_path . "\nReason:" . $! . "\n"); 
    331326  } 
    332   print STDERR "[E2:" . time() . "] Complete\n"; 
     327  print STDERR "  - keyframes extracted!\n"; 
    333328 
    334329 
    335330  # 4. Associate files (copies back to shared space if IO separated) 
    336   print STDERR "[F1:" . time() . "] Associate derived files to doc_obj\n"; 
     331  print STDERR " - Associate derived files to doc_obj... "; 
    337332  # - associate streamable video 
    338333  $doc_obj->associate_file($ovideo_path,'gsv.mp4','video/mp4',$topsection); 
     
    356351    } 
    357352  } 
    358   print STDERR "[F2:" . time() . "] Complete\n"; 
     353  print STDERR "Done!\n"; 
    359354 
    360355  # 5. Done! Cleanup. 
    361   print STDERR "[G:" . time() . "] SimpleVideoPlugin: Complete!\n"; 
     356  print STDERR "SimpleVideoPlugin: Complete! [IOS:" . time() . "]\n"; 
    362357  return 1; 
    363358}