Command line like cat to record video from a video device?

Moderators: snarkout, Patrick, dann, dmfrey

Post Reply
marc
Posts: 124
Joined: Sun Jul 13, 2008 9:29 pm
Location: San Antonio, TX
Contact:

Command line like cat to record video from a video device?

Post by marc » Mon Apr 19, 2010 8:18 pm

Is there a way I can time the cat command to stop after a pre determined time or is there another cli recording command which lends itself to a timed option? I want to record video from my hdpvr for a specified number of minutes while I record blue ray disks so the kids can watch them without risking scratches.

I know it sounds silly, but can I automate the cntl-c to terminate the cat command after a set number of minutes?

I don't want to set up a manual record through mythtv for this.

Thanks.

marc
Posts: 124
Joined: Sun Jul 13, 2008 9:29 pm
Location: San Antonio, TX
Contact:

Re: Command line like cat to record video from a video device?

Post by marc » Thu Apr 22, 2010 8:59 pm

Well I thought about it and came up with a very crude but essentially effective way to do this.

$ cat /dev/video0 > filename.mpg & sleep 120m ; killall cat

By just changing the number of minutes in the sleep command to fit the runtime on the video source, I can just walk away and let it do its thing.

I suppose this is "essentially" solved for me and it works but I'd like to know if there was a more elegant yet efficient way to do this.

Thanks anyways gang.

Marc

Post Reply