recording video - Mandriva
This is a discussion on recording video - Mandriva ; I want to capture video from my tv card and my webcam, I have tried a
bunch of apps cupid xdtv and some others with no success, is there any
sugestions???...
-
recording video
I want to capture video from my tv card and my webcam, I have tried a
bunch of apps cupid xdtv and some others with no success, is there any
sugestions???
-
Re: recording video
On Sat, 16 Jun 2007 15:18:15 +0000, chris gareau wrote:
> I want to capture video from my tv card and my webcam, I have tried a
> bunch of apps cupid xdtv and some others with no success, is there any
> sugestions???
You can capture video from your TV tuner card using many apps assuming
it's a linux compatable TV tuner card. I use MythTV, but there's also
Freevo, and many more. I captured webcam video a few years back using
xawtv, but don't really use the webcam much at all. A search for linux
video capture should get you tons of hits.
1 - 10 of about 8,880,000 for linux video capture - 0.24 sec
--
Want the ultimate in free OTA SD/HDTV Recorder? http://mythtv.org
http://mysettopbox.tv/knoppmyth.html Usenet alt.video.ptv.mythtv
My server http://wesnewell.no-ip.com/cpu.php
HD Tivo S3 compared http://wesnewell.no-ip.com/mythtivo.htm
-
Re: recording video
Groovy hepcat chris gareau was jivin' on Sat, 16 Jun 2007 15:18:15 GMT
in alt.os.linux.mandriva.
recording video's a cool scene! Dig it!
>I want to capture video from my tv card and my webcam, I have tried a
>bunch of apps cupid xdtv and some others with no success, is there any
>sugestions???
I've recently answered this very question posted by several other
people in a couple of newsgroups, including this one. If you all would
lurk for a while before posting you would see that other people have
asked these things before.
OK, I'm going to post my video capture script, called capturetv. It
can capture from a TV card or a webcam. You may modify it to suit your
needs. If you have any questions about it, ask away. This script uses
mencoder, so you'll need to install it if you haven't already. Save
this script as /usr/local/bin/capturetv, then make it executable by
using the command
chmod +x /usr/local/bin/capturetv
Open the script in your favourite text editor and make any necessary
changes, such as the location of mencoder, the driver to use (v4l or
v4l2), the video and audio devices, default bitrate or quantiser of
encoded video, video width & height, default codec, channel names and
numbers, etc.
#### start script ####
# capturetv
# A script to capture video from the TV card using mencoder
# Call with arguments:
# 1) channel number or name
# 2) length in time ([[hh:]mm:]ss[.ms]) or file size (size[b|kb|mb])
# 3) output file name
# 4) (optional) codec
### Default values ###
encoder=/usr/bin/mencoder
driver=v4l
audiodev=":alsa:adevice=hw.0:forceaudio"
#audiodev=":adevice=/dev/dsp:forceaudio"
audiobr=48000
videodev=/dev/video0
videobr=6000
quant=4
if [ "$CAPTURETVFORMAT" = "big" ]
then
defaultwidth=384
defaultheight=288
else
defaultwidth=720
defaultheight=576
fi
norm=pal
chanlist=australia
defaultcodec=mpeg4
defaultaudicodec=pcm
interlace=""
### Test for single argument "--defaults", print default values if\
present ##
if [ $# -eq 1 ]
then
if [ "$1" = "--defaults" ]
then
echo ""
echo "Default codec is $defaultcodec."
echo "Default width is $defaultwidth - change with CAPTURETVWIDTH\
environment variable."
echo "Default height is $defaultheight - change with\
CAPTURETVHEIGHT environment variable."
echo "Or use CAPTURETVFORMAT environment variable to change width\
& height. (\"big\" or \"small\")."
echo "Default video bit rate is $videobr - change with\
CAPTURETVBITRATE environment variable."
echo "Default video quantiser is $quant - change with\
CAPTURETVQUANT environment variable."
echo ""
echo "CAPTURETVWIDTH = \"$CAPTURETVWIDTH\""
echo "CAPTURETVHEIGHT = \"$CAPTURETVHEIGHT\""
echo "CAPTURETVBITRATE = \"$CAPTURETVBITRATE\""
echo "CAPTURETVQUANT = \"$CAPTURETVQUANT\""
echo "CAPTURETVFORMAT = \"$CAPTURETVFORMAT\""
exit
elif [ "$1" = "--codecs" ]
then
echo ""
echo "Available codecs:"
echo " mjpeg - Motion JPEG"
echo " h263p - H263 plus"
echo " mpeg4 - DivX 4/5"
echo " msmpeg4 - DivX 3"
echo " rv10 - Real Video"
echo " mpeg1video - MPEG 1"
echo " mpeg2video - MPEG 2"
echo " rawrgb - Uncompressed RGB (24bpp)"
echo " rawyuv - Uncompressed YUV (12bpp)"
echo " libdv - DV encoding with libdv"
exit
fi
fi
### Test arguments, print help if not enough. ###
if [ $# -lt 3 ]
then
echo "Captures video from TV card"
echo "Call with arguments:"
echo "1) channel number or name"
echo "2) length in time ([[hh:]mm:]ss[.ms]) or file size\
(size[b|kb|mb])"
echo " (0 for no limit)"
echo "3) output file name"
echo "4) (optional) codec"
$0 --codecs
$0 --defaults
else
### Test for codec, use default if none specified. ###
if [ $# -lt 4 ]
then
codec=$defaultcodec
else
codec=$4
fi
### Video capture length. ###
if [ $2 = "0" ]
then
length=""
else
length="-endpos $2"
fi
### Use screen size env. vars. if they exist, ###
### else use defaults. ###
if [ $CAPTURETVWIDTH ]
then
width=$CAPTURETVWIDTH
else
width=$defaultwidth
fi
if [ $CAPTURETVHEIGHT ]
then
height=$CAPTURETVHEIGHT
else
height=$defaultheight
fi
if [ $height -gt 288 ]
then
interlace="-vf pp=lb"
fi
### Use video bit rate env. var. if it exists, ###
### else use default. ###
if [ $CAPTURETVBITRATE ]
then
videobr=$CAPTURETVBITRATE
fi
### Use video quantiser env. var. if it exists, ###
### else use default. ###
if [ $CAPTURETVQUANT ]
then
quant=$CAPTURETVQUANT
fi
### Set up mencoder command line args for codec. ###
if [ $codec = "rawyuv" ] || [ $codec = "rawrgb" ] || [ $codec =\
"libdv" ]
then
fullcodec="-ovc $codec -oac $defaultaudicodec"
else
if [ $quant -eq 0 ]
then
fullcodec="-ovc lavc -lavcopts vcodec=$codec:vbitrate=$videobr\
-oac $defaultaudicodec"
else
fullcodec="-ovc lavc -lavcopts vcodec=$codec:vqscale=$quant \
-oac $defaultaudicodec"
fi
fi
### Channel names. ###
case $1 in
"abc")
chan=42
;;
"prime" | "seven")
chan=33
;;
"win" | "nine")
chan=36
;;
"sc" | "sthn" | "southern cross" | "ten")
chan=39
;;
"sbs")
chan=30
;;
"video")
chan=68
;;
*)
chan=$1
;;
esac
# mplayer's channel list for Australia is wrong!
# The following is an attempt to correct it to some degree.
if [ $chanlist=australia ] && [ $chan -eq 36 ]
then
channel=":freq=583.250:chanlist=$chanlist"
else
channel="channel=$chan"
fi
# Turn off VCR hack so we don't get a green line at bottom of\
picture
v4lctl setattr "vcr hack" off
#Set volume to a reasonable level.
v4lctl volume 75%
cmd="$encoder tv:// -tv driver=$driver:device=$videodev$audiodev:\
audiorate=$audiobr:width=$width:height=$height:nor m=$norm:$channel:\
chanlist=$chanlist $interlace $length $fullcodec -o $3"
# Say what we're going to do - helps with debugging/error\
correction.
echo $cmd
# Now do it.
$cmd
fi
##### end script #####
To record from a TV capture card, edit the script and set the
"videodev=" line to the device for your TV capture card (eg.,
/dev/video0). Then run the script like so:
capturetv win 1:30:00 foo.avi mpeg4
where "win" is the name of the channel you want to capture from, as
set within the script (alternatively, you could use the channel
number), "1:30:00" is the length of time you want to capture in
hours:minutes:seconds format (or simply use 0 if you want to record
for an unspecified length of time, and enter CTRL-C to stop
recording), "foo.avi" is the output file and "mpeg4" is the codec to
use for encoding the output video. You can leave out the codec, and a
default will be used.
To record from a webcam, the procedure is much the same. Edit the
script to select the "videodev=" line to the device for your webcam
(eg., /dev/video1). Then you run it something like this:
capturetv 0 1:30:00 foo.avi mpeg4
The arguments are the same as above, except the channel argument is
ignored by the webcam.
To save you having to edit the script every time you want to change
the capture device, you might want to make the capture device an extra
parameter. Just a suggestion.
--
Dig the even newer still, yet more improved, sig!
http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
-
Re: recording video
Peter 'Shaggy' Haywood wrote:
> capturetv 0 1:30:00 foo.avi mpeg4
>
> The arguments are the same as above, except the channel argument is
> ignored by the webcam.
[user@localhost ~]$ capturetv 0 /home/user/Desktop/foo.avi mpeg4
/usr/local/bin/capturetv: line 25: Â*: command not found
/usr/local/bin/capturetv: line 26: Â*: command not found
/usr/local/bin/capturetv: line 35: Â*present: command not found
/usr/local/bin/capturetv: line 161: syntax error near unexpected token `)'
/usr/local/bin/capturetv: line 161: `Â* Â* "abc")'
-
Re: recording video
Groovy hepcat noway@nothanks.yo was jivin' on Fri, 29 Jun 2007
11:04:42 -0700 in alt.os.linux.mandriva.
Re: recording video's a cool scene! Dig it!
>Peter 'Shaggy' Haywood wrote:
>> capturetv 0 1:30:00 foo.avi mpeg4
>>
>> The arguments are the same as above, except the channel argument is
>> ignored by the webcam.
>
>[user@localhost ~]$ capturetv 0 /home/user/Desktop/foo.avi mpeg4
>/usr/local/bin/capturetv: line 25: Â*: command not found
>/usr/local/bin/capturetv: line 26: Â*: command not found
>/usr/local/bin/capturetv: line 35: Â*present: command not found
>/usr/local/bin/capturetv: line 161: syntax error near unexpected token `)'
>/usr/local/bin/capturetv: line 161: `Â* Â* "abc")'
Ah, OK, sorry about that! I forgot to mention that this works under
bash shell. You could add the line "#!/bin/bash" (without quotes, of
course) to the start of the script. I left that out because you can't
stop the capture by pressing ^c with it in. But if you're using a
different shell, you need that line.
Also, I think I forgot to mention that you need mencoder installed
for this to work. But if you've looked over the script, that should be
obvious.
--
Dig the even newer still, yet more improved, sig!
http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
-
Re: recording video
Peter 'Shaggy' Haywood wrote:
> Ah, OK, sorry about that! I forgot to mention that this works under
> bash shell. You could add the line "#!/bin/bash" (without quotes, of
> course) to the start of the script. I left that out because you can't
> stop the capture by pressing ^c with it in. But if you're using a
> different shell, you need that line.
Same result!
> Also, I think I forgot to mention that you need mencoder installed
> for this to work. But if you've looked over the script, that should be
> obvious.
Yeah, that much I got 
Thanks for your help.