Changeset 21825

Show
Ignore:
Timestamp:
26.03.2010 12:34:09 (9 years ago)
Author:
max
Message:

Allow to not keep the original file
Two settings for streaming (flv or mp4)

Files:
1 modified

Legend:

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

    r21335 r21825  
    176176     
    177177###    print STDERR "**** creating thumbnail: $thumbnail_width x $thumbnail_height\n"; 
    178  
     178    my $ofilename = $self->get_ovideo_filename($self->{'enable_streaming'}); 
    179179    my ($thumb_cmd ,$othumb_filename) 
    180     = $self->keyframe_thumbnail_cmd($filename,$thumbnailfile,$thumbnail_width,$thumbnail_height); 
     180    = $self->keyframe_thumbnail_cmd($ofilename,$thumbnailfile,$thumbnail_width,$thumbnail_height); 
    181181     
    182182    my $thumb_options = { 'verbosity' => $verbosity, 
     
    337337    } 
    338338 
    339     my ($video_type, $video_width, $video_height, $video_duration, $video_size, 
    340     $vcodec,$vfps,$atype,$afreq,$achan,$arate)  
     339    my ($video_type, $video_width, $video_height, $video_duration, $durationDisplay, $video_size, 
     340    $vcodec,$vrate,$vfps,$atype,$afreq,$achan,$arate)  
    341341    = &VideoConverter::identify($filename, $outhandle, $verbosity); 
    342342 
    343     if ($vfps eq "unknown") { 
    344     print $outhandle "Unknown framerate, defaulting to 25 frames per second.\n"; 
    345     $vfps = 25; 
    346     } 
    347  
    348     my ($dur_hour,$dur_min,$dur_sec)  
    349     = ($video_duration =~ m/(\d+):(\d+):(\d+\.\d+)/); 
    350     my $total_dur_secs = $dur_hour*3600 + $dur_min*60 + $dur_sec; 
     343    #if ($vfps eq "unknown") { 
     344    #print $outhandle "Unknown framerate, defaulting to 25 frames per second.\n"; 
     345    #$vfps = 25; 
     346    #} 
     347 
     348    #my ($dur_hour,$dur_min,$dur_sec)  
     349    #= ($video_duration =~ m/(\d+):(\d+):(\d+\.\d+)/); 
     350    #my $total_dur_secs = $dur_hour*3600 + $dur_min*60 + $dur_sec; 
     351     
     352    my $total_dur_secs = $video_duration / 1000; 
    351353 
    352354    $self->{'video-fps'} = $vfps; 
     
    519521    $doc_obj->add_metadata ($section, "srcicon", "[VideoType]"); 
    520522 
     523     
    521524    # Add the original file as an associated file 
    522     # $doc_obj->associate_file($filename,$file,"video/$type",$section); 
     525    if ($self->{'keep_original_video'} eq "true") { 
     526        $doc_obj->associate_file($filename,$file,"video/$type",$section); 
     527    } 
    523528 
    524529 
    525530    if ($self->{'extract_keyframes'}) { 
    526     $self->extract_keyframes($doc_obj,$originalfilename,$filename); 
     531        $self->extract_keyframes($doc_obj,$originalfilename,$filename); 
    527532    } 
    528533 
    529534    my $streamable_regenerated = 0; 
    530  
    531     if ($self->{'enable_flv_streaming'} && !$self->{'enable_mp4_streaming'}) {   
     535     
     536    # Create a VP6+MP3 streaming ready video file with FFMpeg 
     537    if ($self->{'enable_streaming'} eq "flv") {  
    532538        $streamable_regenerated  
    533539            = $self->enable_full_streaming($doc_obj, 
     
    537543    } 
    538544 
    539     # Create an H264+ACC video file with Handbrake 
    540       if ($self->{'enable_mp4_streaming'}) {     
     545    # Create an H264+ACC streaming ready video file with Handbrake 
     546    if ($self->{'enable_streaming'} eq "mp4") { 
    541547        $streamable_regenerated  
    542548            = $self->enable_h264_streaming($doc_obj,