Changeset 22363


Ignore:
Timestamp:
07/07/10 13:56:37 (11 years ago)
Author:
ak19
Message:

Adding in the adjustments to the mediainfoogv plugin that were mailed to Arnaud Ivan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/MediainfoOGVPlugin.pm

    r22362 r22363  
    144144
    145145    # execute the mediainfo command and store the output of execution in $videodata
    146     my $video_metadata = `$command`;
     146    # my $video_metadata = `$command`; # backticks operator way
     147    # Another way to execute the command: better experience with this than
     148with backticks operator above:
     149    # use open() to read the output of executing the command (which is
     150piped through to a handle using the | operator)
     151    my $video_metadata;
     152    if (open(VMIN,"$command|")) {
     153        my $line;
     154
     155    # we read a line of output at a time
     156        while (defined ($line=<VMIN>)) {
     157            #print STDERR "***** line = $line\n";
     158
     159            $video_metadata .= $line;
     160        }
     161
     162        close(VMIN);
     163    }
     164
    147165    print $outhandle "$video_metadata\n" if ($verbosity > 2);
    148166
Note: See TracChangeset for help on using the changeset viewer.