Capture audio and video using VoIP
Q Can you recommend some software for capturing audio and video footage using a VoIP package? I have a friend who wants me to upload some video tutorials to the web, but I don't have any software to capture it. I am using a Trust VoIP pack I normally use for Skype. I need to easily install (hopefully using the Ubuntu package manager), capture, edit and save in a standard format.
A There do not appear to be any convenient GUI programs for this, but a couple of command line programs work well: MEncoder and FFmpeg. As with all video encoding programs, the list of available options can be quite daunting, but if you ignore the esoteric parameters and stick to the basics it is quite easy. MEncoder is part of the MPlayer package, so if your camera works with MPlayer, you should be able to record from it. The first step is to identify your camera's device; if it already works with Skype, the easiest way is to look in the Video Device section of Skype's Options window. (It will probably be /dev/video0, unless you have more than one video device.) You can test the camera with MPlayer using
This should open a window showing your camera's output. If the device is anything other than /dev/video0, you will need to specify it on the command line
mplayer -tv device=/dev/video1 tv://
If that works, you can probably record with
mencoder -tv device=/dev/video1 tv:// -ovc copy -o video.avi
which will record the camera's output to the file video.avi - press Ctrl+C to stop recording. You can change the OVC (output video codec) option to another to record in a different format, but try it with the Copy codec first, as your camera may produce a suitable format without re-encoding. If you do need to re-encode, it may be better to use Copy, then re-encode later. Unless your machine is fast enough to keep up with the incoming data, encoding on the fly may result in dropped frames. You can re-encode to MPEG4 with something like
mencoder video.avi -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=800 -o newvideo.avi
to encode to newvideo.avi using the libav codec to produce an MPEG4 file with a bitrate of 800. MEncoder worked with the built-in webcams of my laptop and Eee, but not with the USB webcam I have on my desktop. For that I switched to FFmpeg, which does a similar job.
ffmpeg -an -f video4linux -s 320x240 -b 800k -r 15
-i /dev/v4l/video0 -vcodec mpeg4 myvideo.avi
The option -an disables audio recording; -f forces the use of Video4Linux for the input; -s sets the video size to 320x240; -b sets the recording bitrate; -r sets the frame rate to fifteen frames per second; -i gives the input device; and -vcodec sets the output format to MPEG4 (you can also use Copy as with MEncoder). The final option is the name of the output file. Press Q to stop recording, or you can specify the duration of the recording with -t followed by either a number of seconds or a time in hh:mm:ss format, so -t 90 and -t 00:1:30 are two ways of specifying the same duration.
Follow us on Identi.ca or Twitter