title: Read video file using Perl
body: <p>Can anyone suggest to me how to read a video file from Perl without using any third-party tools?</p>
  
  <p>I know the <code>opencv</code> library for Python and C. I am not sure which one to use for Perl.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I get the output as </p>
  
  <p><code>3 bytes read</code></p>
  
  <p><code>´ˇÙ</code></p>
  
  <p><code>Argument "M-+M-^?M-t" isn't numeric in bitwise and (&amp;) at</code> </p>
  
  <p><code>0</code></p>
  
  <p>I am novice in perl and I am missing something. I am reading 3 bytes from the file till EOF. I want to mask it and do some manipulation on the bits. I am reading <code>pack/unpack</code> it really doesn't make a clue to me.</p>
  
  <pre><code>open (FILE, "&lt;:raw", $InputFile) or die "Couldn't open";
  my ($buf, $data, $n); 
  
  while (($n = read FILE, $data, 3) != 0) { 
      print "$n bytes read\n"; 
      $buf = $data; 
      print $buf . "\n";
      my $maskNumber = 0x4;
      my $value = ($buf &amp; $maskNumber);
      print $value . "\n";
  }
  </code></pre>