File: xsview

package info (click to toggle)
libvideo-capture-v4l-perl 0.224-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 572 kB
  • ctags: 563
  • sloc: ansic: 4,924; perl: 2,746; makefile: 57; sh: 22
file content (31 lines) | stat: -rwxr-xr-x 622 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

use blib;
use Video::Capture::V4l;
use Video::RTjpeg;

$outprefix = "/tmp/vstream";

require $outprefix;

$|=1;

open DATA, "<$outprefix.v0" or die;

read DATA, $buf, 4;
my ($tlen) = unpack "N*", $buf;

read DATA, $tables, $tlen;
Video::RTjpeg::init_decompress($tables, $w, $h);

while (read DATA, $buf, 8) {
   my ($time, $size) = unpack "N*", $buf;
   read DATA, $buf, $size;
   $buf = Video::RTjpeg::decompress $buf;
   $buf = Video::RTjpeg::yuvrgb $buf;
   print ".$size";
   #print ".",length($buf);
   open DISPLAY, "| display -size ${w}x$h rgb:-" or die;
   print DISPLAY $buf;
   close DISPLAY;
}