Changeset 27426

Show
Ignore:
Timestamp:
24.05.2013 10:06:12 (6 years ago)
Author:
jmt12
Message:

Add in a loop to attempt video conversion multiple times should the first attempt fail

Files:
1 modified

Legend:

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

    r26948 r27426  
    274274    } 
    275275    $cmd .= 'HandBrakeCLI -i "' . $ivideo_path . '" -t 1 -c 1 -f mp4 -O -o "' . $ovideo_path . '" ' . $video_processing_parameters . ' -e x264 -b ' . $streaming_HQ_VideoBitrate . ' -a 1 -E faac -6 dpl2 -R Auto -B ' . $streaming_HQ_AudioBitrate . ' -D 0.0 -x ' . $mencoder_options . ' > "' . $convert_log_path . '" 2>&1'; 
    276     print "[DEBUG: " . $cmd . "]\n"; 
    277     `$cmd`; 
     276    my $attempt_count = 0; 
     277    do 
     278    { 
     279      $attempt_count++; 
     280      print "[DEBUG: Video conversion attempt #" . $attempt_count . ": |" . $cmd . "|]\n"; 
     281      `$cmd`; 
     282    } 
     283    while ($attempt_count < 5 && !&util::file_exists($ovideo_path)) 
    278284  } 
    279285  if (!&util::file_exists($ovideo_path))