LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-27-2004, 02:58 PM   #1
delos
Member
 
Registered: Jun 2004
Posts: 38

Rep: Reputation: 15
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
 
Old 09-27-2004, 03:24 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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);
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhdpcd timing out jplev22 Linux - Wireless Networking 9 09-12-2005 03:30 PM
Timing issues eagle683 Programming 4 06-01-2005 02:35 PM
timing in c++ deveraux83 Programming 2 04-20-2004 06:34 PM
eth0 timing out rohde Linux - Networking 2 10-04-2003 05:49 AM
timing a process jonfa Linux - General 3 10-11-2001 05:33 PM


All times are GMT -5. The time now is 05:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration