Changeset 25890


Ignore:
Timestamp:
2012-06-29T17:10:00+12:00 (12 years ago)
Author:
jmt12
Message:

Moving -ss option before input video in FFMPEG commands as it is significantly faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video-and-audio/trunk/src/perllib/plugins/VideoConverter.pm

    r25518 r25890  
    10201020    #   $vcodec ,$fps ,$atype ,$afreq ,$achan ,$arate) = identify($ivideo_filename_gsdlenv,$outhandle,0);
    10211021   
    1022     #print STDERR "***** grabbing keyframe as 50% of $video_duration\n";
     1022    print STDERR "***** grabbing keyframe as 50% of $video_duration\n";
    10231023    my $ss_opt = ($video_duration / 1000.0) * 0.45;
    1024     #print STDERR "*** ssopt = $ss_opt\n";
    1025    
    1026     $command = "ffmpeg  -ss $ss_opt -i \"$ivideo_filename_gsdlenv\" -ss 4.5 -an -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
    1027     #$command = "ffmpeg -ss 4.5 -i \"$ivideo_filename_gsdlenv\" -ss 4.5 -an -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
     1024    print STDERR "*** ssopt = $ss_opt\n";
     1025   
     1026##  $command = "ffmpeg  -ss $ss_opt -i \"$ivideo_filename_gsdlenv\" -ss 4.5 -an -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
     1027##  $command = "ffmpeg -ss 4.5 -i \"$ivideo_filename_gsdlenv\" -ss 4.5 -an -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
    10281028
    10291029##  $command = "ffmpeg -i \"$ivideo_filename_gsdlenv\"  -ss 10.5 -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
    10301030
    1031     $command = "ffmpeg -i \"$ivideo_filename_gsdlenv\"  -ss 16.5 -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
     1031        # *NOTE* "-ss X" should occur before "-i" if you want to seek in the
     1032        # input file (hence making generation significantly faster). [jmt12]
     1033    $command = "ffmpeg -ss 16.5 -i \"$ivideo_filename_gsdlenv\" -vframes 1 -f image2 -s ${thumbnailwidth}x${thumbnailheight} -deinterlace -y \"$thumbnailfile_gsdlenv\"";
    10321034
    10331035
Note: See TracChangeset for help on using the changeset viewer.