LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mencoder timing (https://www.linuxquestions.org/questions/linux-software-2/mencoder-timing-235864/)

delos 09-27-2004 01:58 PM

mencoder timing
 
hi

i want to record with mecoder and somehow start and finish it at a given time.
for starting i use
mencoder -tv driver=v4l2:width=640:height=480 tv:// -o tv.avi -ovc lavc -oac mp3lame
for finishing ctrl+c
now i need to automate this, for example record from 13:00-13:30

thanks

acid_kewpie 09-27-2004 02:24 PM

i used to use an at task for this. naturally it's not the sort of thing that mencoder can do itself. I made a wrapper script for recording from tv, which might be handy:
Code:

#!/usr/bin/perl
use strict;
use Getopt::Long;

my %opts=();
GetOptions( 'c=i' => \$opts{'c'}, 'l=i' => \$opts{'l'}, 't=s' => \$opts{'t'}, 'd=s' => \$opts{'d'}, 'q' => \$opts{'q'} );

print "setting volume...";
system("aumix -r 10 -l R -i 10");
print "Done\nattempting to free /dev/video...";
system ("fuser -INT -k /dev/video0");
sleep 1;
print "Done\n";
my $quiet = $opts{'q'} ? " 2&>1 > /dev/null" : "";

#my $command = "mencoder -tv on:driver=v4l:width=480:height=360 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800:vme=5:vhq -vop pp=lb -oac mp3lame -lameopts abr:br=96";
#my $command = "mencoder tv:// -tv driver=v4l:width=768:height=576 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800:vme=5:vhq -vf pp=lb,crop=720:544:24:16,scale=480:-2 -oac mp3lame -lameopts abr:br=64";


my $command = "mencoder tv:// " .
"-tv driver=v4l2:width=768:height=576 " .
"-ovc lavc -oac lavc " .
"-lavcopts acodec=mp3:abitrate=64:vcodec=mpeg4:vbitrate=600:vme=5:vhq " .
"-vf pp=lb,crop=720:544:24:16,scale=480:-2";

my $channel = $opts{'c'} ? " -tv channel=" . $opts{'c'} : "";
my $endpos = $opts{'l'} ? " -endpos " . $opts{'l'} : "";
my $dir = $opts{'d'} ? $opts{'d'} . "/" : "";
my $file = $opts{'t'} ? " -o ". $dir . $opts{'t'} . ".avi" : "";
#system($command . " -tv channel=" . $opts{'c'} . " -endpos " . $opts{'l'} . " -o " . $opts{'d'} . "/" . $opts{'t'}. ".avi");
print "running " . $command . $channel . $endpos . $file . $quiet . "\n";
system($command . $channel . $endpos . $file . $quiet);



All times are GMT -5. The time now is 09:52 PM.