Changeset 18897

Show
Ignore:
Timestamp:
06.04.2009 13:32:10 (10 years ago)
Author:
davidb
Message:

Change from using videocoverter.pm to VideoConverter?.pm

Location:
extensions/gsdl-video/trunk/perllib/plugins
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • extensions/gsdl-video/trunk/perllib/plugins/MultimediaPlugin.pm

    r18556 r18897  
    9797    my $result = `ffmpeg -h 2>&1`; 
    9898 
    99  
    10099    if (!defined $result || $result !~ m/^FFmpeg version/) { 
    101100        $self->{'ffmpeg_installed'} = 0; 
    102         print STDERR $result; 
     101        if (defined $result) { 
     102        print STDERR $result; 
     103        } 
     104        else { 
     105        print STDERR "Unable to find ffmpeg\n"; 
     106        } 
    103107    } 
    104108    else { 
  • extensions/gsdl-video/trunk/perllib/plugins/TimedHTMLPlugin.pm

    r18425 r18897  
    2828package TimedHTMLPlugin; 
    2929 
    30 use videoconvert; 
     30##use videoconvert; 
    3131 
    3232use HTMLPlugin; 
     33use VideoConverter; 
    3334 
    3435sub BEGIN { 
    35     @TimedHTMLPlugin::ISA = ('HTMLPlugin'); 
    36 } 
     36    @TimedHTMLPlugin::ISA = ('HTMLPlugin', 'VideoConverter'); 
     37} 
     38 
    3739 
    3840use strict; # every perl program should have this! 
     
    6567    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)}; 
    6668    
     69    new VideoConverter($pluginlist, $inputargs, $hashArgOptLists); 
    6770 
    6871    my $self = (defined $hashArgOptLists)  
     
    8083    return bless $self, $class; 
    8184} 
     85 
     86sub begin { 
     87    my $self = shift (@_); 
     88    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 
     89 
     90    $self->SUPER::begin(@_); 
     91    $self->VideoConverter::begin(@_);  
     92} 
     93 
     94 
     95sub init { 
     96    my $self = shift (@_); 
     97    my ($verbosity, $outhandle, $failhandle) = @_; 
     98 
     99    $self->SUPER::init(@_); 
     100    $self->VideoConverter::init(@_); 
     101} 
     102 
    82103 
    83104sub html_to_text 
     
    200221    my $time_num = scalar(@{$self->{'time_seq'}}); 
    201222 
    202     my $videoconvert = $self->{'videoconvert'}; 
     223####    my $videoconvert = $self->{'videoconvert'}; 
    203224 
    204225    # excerpt from tim_pos -> time_pos + 2; 
     
    343364 
    344365        my ($ae_cmd,$omp3_filename,$omp3_file)  
    345             = $videoconvert->audio_excerpt_cmd($src_filename, 
    346                                $hh,$mm,$ss,$excerpt_len); 
    347          
    348         my $ae_options = { @{$videoconvert->{'ffmpeg_monitor'}}, 
     366            = $self->audio_excerpt_cmd($src_filename, 
     367                           $hh,$mm,$ss,$excerpt_len); 
     368         
     369        my $ae_options = { @{$self->{'ffmpeg_monitor'}}, 
    349370                   'message_prefix' => "Audio Excerpt", 
    350371                   'message' => "Generating audio excerpt: $omp3_file" };  
    351372         
    352373        my ($ae_regenerated,$ae_result,$ae_had_error) 
    353             = $videoconvert->run_cached_general_cmd($ae_cmd,$omp3_filename,$ae_options); 
     374            = $self->run_cached_general_cmd($ae_cmd,$omp3_filename,$ae_options); 
    354375 
    355376        push(@{$self->{'mp3_excerpts'}}, { 'omp3_file' => $omp3_file, 'omp3_filename' => $omp3_filename} ); 
     
    591612    $self->{'media_base_dir'} = $media_base_dir; 
    592613 
    593     $self->{'vob_duration_info'} = &videoconvert::vob_durations($media_base_dir,"1",$self->{'outhandle'}); 
     614    $self->{'vob_duration_info'} = &VideoConverter::vob_durations($media_base_dir,"1",$self->{'outhandle'}); 
    594615 
    595616##    $self->hyperlink_timing_info($textref); 
     
    653674    my ($video_type, $video_width, $video_height, $video_duration, $video_size, 
    654675    $vcodec,$vfps,$atype,$afreq,$achan,$arate)  
    655     = &videoconvert::identify($src_filename, $outhandle, $verbosity); 
     676    = &VideoConverter::identify($src_filename, $outhandle, $verbosity); 
    656677 
    657678    if ($vfps eq "unknown") { 
     
    701722 
    702723     
    703     my $videoconvert  
    704     = new videoconvert($base_dir,$src_filename,$verbosity,$outhandle,$exp_duration); 
    705     $self->{'videoconvert'} = $videoconvert; 
     724###    my $videoconvert  
     725### = new videoconvert($base_dir,$src_filename,$verbosity,$outhandle,$exp_duration); 
     726###    $self->{'videoconvert'} = $videoconvert; 
    706727 
    707728    #--- 
     
    718739    #--- 
    719740    my ($stream_cmd,$oflash_filename,$oflash_file)  
    720     = $videoconvert->stream_cmd($src_filename, 
    721                     $video_width,$video_height, 
    722                     $streaming_quality, $streaming_bitrate, $streaming_size, 
    723                     $streaming_achan, $streaming_arate); 
    724  
    725     my $streamable_options = { @{$videoconvert->{'ffmpeg_monitor'}}, 
     741    = $self->stream_cmd($src_filename, 
     742                $video_width,$video_height, 
     743                $streaming_quality, $streaming_bitrate, $streaming_size, 
     744                $streaming_achan, $streaming_arate); 
     745 
     746    my $streamable_options = { @{$self->{'ffmpeg_monitor'}}, 
    726747                   'message_prefix' => "Stream", 
    727748                   'message' => "Generating streamable video: $oflash_file" };  
    728749 
    729750    my ($streamable_regenerated,$streamable_result,$streamable_had_error) 
    730     = $videoconvert->run_cached_general_cmd($stream_cmd,$oflash_filename,$streamable_options); 
     751    = $self->run_cached_general_cmd($stream_cmd,$oflash_filename,$streamable_options); 
    731752 
    732753    $self->{'streamable_regenerated'} = $streamable_regenerated; 
     
    736757    # Make video seekable 
    737758    #--- 
    738     my ($streamseekable_cmd,$ostreamseekable_filename) = $videoconvert->streamseekable_cmd($oflash_filename); 
     759    my ($streamseekable_cmd,$ostreamseekable_filename) = $self->streamseekable_cmd($oflash_filename); 
    739760     
    740     my $streamseekable_options = { @{$videoconvert->{'flvtool2_monitor'}}, 
     761    my $streamseekable_options = { @{$self->{'flvtool2_monitor'}}, 
    741762                       'message_prefix' => "Stream Seekable", 
    742763                       'message' => "Reprocessing video stream to be seekable by timeline: $oflash_file" };  
    743764 
    744765    if ($streamable_regenerated) { 
    745         $videoconvert->run_general_cmd($streamseekable_cmd,$streamseekable_options); 
     766        $self->run_general_cmd($streamseekable_cmd,$streamseekable_options); 
    746767    } 
    747768 
     
    783804 
    784805    # open file 
    785     my $output_dir = $self->{'videoconvert'}->{'cached_dir'}; 
     806    my $output_dir = $self->{'cached_dir'}; 
    786807    my $cue_filename = &util::filename_cat($output_dir,"on_cue.xml"); 
    787808 
     
    867888    close(CUEOUT); 
    868889 
    869     my $videoconvert = $self->{'videoconvert'}; 
     890####    my $videoconvert = $self->{'videoconvert'}; 
    870891    my $oflash_filename = $self->{'oflash_filename'}; 
    871892    my $oflash_file = $self->{'oflash_file'}; 
    872893 
    873     my ($streamcuepts_cmd,$ostreamcuepts_filename) = $videoconvert->streamcuepts_cmd($oflash_filename); 
     894    my ($streamcuepts_cmd,$ostreamcuepts_filename) = $self->streamcuepts_cmd($oflash_filename); 
    874895 
    875896    my $verbosity = $self->{'verbosity'}; 
    876897    my $outhandle = $self->{'outhandle'}; 
    877898 
    878     my $streamcuepts_options = { @{$videoconvert->{'flvtool2_monitor'}}, 
     899    my $streamcuepts_options = { @{$self->{'flvtool2_monitor'}}, 
    879900                 'message_prefix' => "Stream Cue Points", 
    880901                 'message' => "Reprocessing video stream to add cuepoints on timeline: $oflash_file" };  
     
    883904 
    884905    if ($streamable_regenerated) { 
    885     $videoconvert->run_general_cmd($streamcuepts_cmd,$streamcuepts_options); 
     906    $self->run_general_cmd($streamcuepts_cmd,$streamcuepts_options); 
    886907    } 
    887908