Changeset 22487


Ignore:
Timestamp:
2010-07-23T00:39:55+12:00 (12 years ago)
Author:
max
Message:

Fix a bug (getting video duration from ffmpeg)
Re-enable the 25fps fallback for now

File:
1 edited

Legend:

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

    r22432 r22487  
    344344    = &VideoConverter::identify($filename, $outhandle, $verbosity);
    345345
    346     if ($video_duration =~ m/^(\d\d):(\d\d):(\d\d)\.(\d)$/) {
     346    if ($video_duration =~ m/^(\d\d):(\d\d):(\d\d)\.(\d\d)$/) {
    347347    $video_duration = $1*3600 + $2*60 + $3 + ($4/10.0);
    348348    }
    349349
    350     #if ($vfps eq "unknown") {
    351     #print $outhandle "Unknown framerate, defaulting to 25 frames per second.\n";
    352     #$vfps = 25;
    353     #}
     350    if ($vfps eq "unknown") {
     351    print $outhandle "Unknown framerate, defaulting to 25 frames per second.\n";
     352    $vfps = 25;
     353    }
    354354
    355355    #my ($dur_hour,$dur_min,$dur_sec)
     
    361361    $self->{'video-fps'} = $vfps;
    362362    $self->{'num-total-frames'} = $total_dur_secs * $vfps;
     363    #print STDERR "****\nTotal_dur_secs= $total_dur_secs vfps= $vfps\n****\n";
    363364
    364365    # Convert the video to a new type (if required).
     
    375376    my ($hh,$mm,$ss,$ms);
    376377
    377     if ($exp_duration =~ m/^(\d\d):(\d\d):(\d\d)\.?(\d\d)?/) {
     378    if ($exp_duration =~ m/^(\d\d):(\d\d):(\d\d)\.?(\d)$/) {
    378379        $hh = $1;
    379380        $mm = $2;
Note: See TracChangeset for help on using the changeset viewer.