- Timestamp:
- 2009-02-10T13:31:55+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gsdl-video/trunk/perllib/plugins/VideoPlugin.pm
r18476 r18490 362 362 363 363 364 my $convertto_command = "ffmpeg $main_opts -i \"$originalfilename\""; 364 my $originalfilename_gsdlenv = $self->gsdlhome_independent($originalfilename); 365 my $filename_gsdlenv = $self->gsdlhome_independent($filename); 366 367 368 my $convertto_command = "ffmpeg $main_opts -i \"$originalfilename_gsdlenv\""; 365 369 $convertto_command .= " -ar 22050" if ($converttotype eq "flv"); 366 $convertto_command .= " -y \"$filename \"";370 $convertto_command .= " -y \"$filename_gsdlenv\""; 367 371 368 372 my $convertto_result; … … 540 544 my $thumbnailsize = $self->{'thumbnailsize'} || 100; 541 545 my $thumbnailtype = $self->{'thumbnailtype'} || 'jpg'; 542 546 547 my $thumbnailwidth; 548 my $thumbnailheight; 549 550 if ($video_width>$video_height) { 551 my $scale_ratio = $video_height / $video_width; 552 $thumbnailwidth = $thumbnailsize; 553 $thumbnailheight = int($thumbnailsize * $scale_ratio); 554 } 555 else { 556 my $scale_ratio = $video_width / $video_height; 557 $thumbnailwidth = int($thumbnailsize * $scale_ratio); 558 $thumbnailheight = $thumbnailsize; 559 } 560 543 561 544 562 my $thumbnailfile = &util::filename_cat($output_dir,"$ivideo_root.$thumbnailtype"); … … 548 566 # Generate the thumbnail with convert, a la ImagePlug 549 567 my ($thumb_cmd ,$othumb_filename) 550 = $videoconvert->keyframe_thumbnail_cmd($filename,$thumbnailfile,$thumbnail size);568 = $videoconvert->keyframe_thumbnail_cmd($filename,$thumbnailfile,$thumbnailwidth,$thumbnailheight); 551 569 552 570 my $thumb_options = { 'verbosity' => $verbosity, … … 626 644 my $screenviewfilename = &util::filename_cat($output_dir,"$ivideo_root.$screenviewtype"); 627 645 646 my $screenviewwidth; 647 my $screenviewheight; 648 649 if ($video_width>$video_height) { 650 my $scale_ratio = $video_height / $video_width; 651 $screenviewwidth = $screenviewsize; 652 $screenviewheight = int($screenviewsize * $scale_ratio); 653 } 654 else { 655 my $scale_ratio = $video_width / $video_height; 656 $screenviewwidth = int($screenviewsize * $scale_ratio); 657 $screenviewheight = $screenviewsize; 658 } 659 660 628 661 # make the screenview image 629 662 630 663 my ($screenview_cmd,$oscreenview_filename) 631 = $videoconvert->keyframe_thumbnail_cmd($filename,$screenviewfilename,$screenview size);664 = $videoconvert->keyframe_thumbnail_cmd($filename,$screenviewfilename,$screenviewwidth,$screenviewheight); 632 665 633 666 my $screenview_options = { 'message_prefix' => "Screenview",
Note:
See TracChangeset
for help on using the changeset viewer.