/[scripts]/trunk/record-screencast.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/record-screencast.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 110 - (show annotations)
Wed Feb 25 10:56:11 2009 UTC (15 years, 1 month ago) by dpavlin
File MIME type: text/plain
File size: 657 byte(s)
convert recorder to perl, round size to even pixels, use ffplay
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 my $out = shift @ARGV || 'screencast.avi';
7
8 warn "Select Window to record!\n";
9 my $xwininfo = `xwininfo`;
10
11 my $rate = 10;
12 my $w = $1 if $xwininfo =~ m{Width:\s*(\d+)}s;
13 my $h = $1 if $xwininfo =~ m{Height:\s*(\d+)}s;
14 my $offset = $1 if $xwininfo =~ m{Corners:\s*(\S+)}s;
15
16 $w = $w + 1 & 0xfffe;
17 $h = $h + 1 & 0xfffe;
18
19 $offset =~ s{\+}{};
20 $offset =~ s{\+}{,};
21
22 my $ffmpeg = "ffmpeg -f x11grab -s ${w}x${h} -r $rate -sameq -i $ENV{DISPLAY}+$offset $out";
23 warn "# $ffmpeg",$/;
24
25 system($ffmpeg) == 0 or die "$ffmpeg: $?";
26 #system "mplayer -osdlevel 3 $out";
27 system "ffplay $out";
28
29 warn "# created $out ", -s $out, $/;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26