Changeset 27426


Ignore:
Timestamp:
2013-05-24T10:06:12+12:00 (11 years ago)
Author:
jmt12
Message:

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

File:
1 edited

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))
Note: See TracChangeset for help on using the changeset viewer.