Ignore:
Timestamp:
2010-07-19T14:00:53+12:00 (14 years ago)
Author:
davidb
Message:

Adjustment of calling BaseMediaConverter to pass in additional input file parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video/trunk/perllib/plugins/VideoPlugin.pm

    r21825 r22432  
    133133
    134134    # Generate the keyframes with ffmpeg and hive
    135     my ($keyframe_cmd,$okeyframe_filename) = $self->keyframe_cmd($originalfilename || $filename);
     135    my $ifilename = $originalfilename || $filename;
     136    my ($keyframe_cmd,$okeyframe_filename) = $self->keyframe_cmd($ifilename);
    136137   
    137138    my $keyframe_options = { @{$self->{'ffmpeg_monitor'}},
     
    139140                 'message' => "Extracting keyframes" };
    140141   
    141     $self->run_cached_general_cmd($keyframe_cmd,$okeyframe_filename,$keyframe_options);
     142    $self->run_cached_general_cmd($keyframe_cmd,
     143                  $ifilename,$okeyframe_filename,
     144                  $keyframe_options);
    142145    $self->parse_shot_xml();
    143146
     
    164167
    165168
    166     # Generate the thumbnail with convert, a la ImagePlug
     169    # Generate the thumbnail with convert, a la ImagePlugin
    167170
    168171    my $thumbnailfile = &util::filename_cat($output_dir,"$ivideo_root-thumbnail.$thumbnailtype");
    169    
    170172   
    171173    my $optionally_run_general_cmd = "run_uncached_general_cmd";
     
    176178   
    177179###    print STDERR "**** creating thumbnail: $thumbnail_width x $thumbnail_height\n";
    178     my $ofilename = $self->get_ovideo_filename($self->{'enable_streaming'});
     180    my $ofilename = $self->get_ovideo_filename($self->{'enable_streaming'});
    179181    my ($thumb_cmd ,$othumb_filename)
    180182    = $self->keyframe_thumbnail_cmd($ofilename,$thumbnailfile,$thumbnail_width,$thumbnail_height);
     
    186188   
    187189    my ($thumb_regenerated,$thumb_result,$thumb_had_error)
    188     = $self->$optionally_run_general_cmd($thumb_cmd,$thumbnailfile,$thumb_options);
     190    = $self->$optionally_run_general_cmd($thumb_cmd,$ofilename,$thumbnailfile,$thumb_options);
    189191   
    190192    # Add the thumbnail as an associated file ...
     
    209211    #   2.thumbnail was cached, so imagemagick convert was not run
    210212    # Either way, the solution is the same:
    211     # => run "identify $thumbnailfile" and parse result
    212    
    213     $thumb_result = `identify \"$thumbnailfile\"`;
     213    # => run "identify $thumbnailfile" and parse result
     214    $thumb_result = `identify \"$thumbnailfile\" 2>&1`;
    214215   
    215216    if ($thumb_result =~ m/([0-9]+)x([0-9]+)/) {
     
    285286                   
    286287    my ($screenview_regenerated,$screenview_result,$screenview_had_error)
    287     = $self->$optionally_run_general_cmd($screenview_cmd,$screenviewfilename,$screenview_options);
     288    = $self->$optionally_run_general_cmd($screenview_cmd,
     289                         $filename,$screenviewfilename,
     290                         $screenview_options);
    288291   
    289292
     
    341344    = &VideoConverter::identify($filename, $outhandle, $verbosity);
    342345
     346    if ($video_duration =~ m/^(\d\d):(\d\d):(\d\d)\.(\d)$/) {
     347    $video_duration = $1*3600 + $2*60 + $3 + ($4/10.0);
     348    }
     349
    343350    #if ($vfps eq "unknown") {
    344351    #print $outhandle "Unknown framerate, defaulting to 25 frames per second.\n";
     
    350357    #my $total_dur_secs = $dur_hour*3600 + $dur_min*60 + $dur_sec;
    351358   
    352     my $total_dur_secs = $video_duration / 1000;
     359    my $total_dur_secs = $video_duration / 1000;
    353360
    354361    $self->{'video-fps'} = $vfps;
     
    448455
    449456    ($convertto_regenerated,$convertto_result,$convertto_error)
    450         = $self->run_cached_general_cmd($convertto_command,$filename,$convertto_options);
     457        = $self->run_cached_general_cmd($convertto_command,
     458                        $originalfilename,$filename,
     459                        $convertto_options);
    451460                           
    452461    $type = $converttotype;
     
    580589                 $thumbnail_width,$thumbnail_height);
    581590    }
    582 
    583591
    584592    if ($self->{'extract_keyframes'}) {
Note: See TracChangeset for help on using the changeset viewer.