Okay... I've been wondering how to do this for quite some time, and I finally figured it out with the help of this mailing list thread
I've always thought ffmpeg was a pretty amazing program, but now, I will build a shrine to it and worship it weekly.
Ffmpeg is the program which allows me to create a video with sound in Linux.
I have a Logitch Orbit AF webcam, and with the following command, it records both video and audio.
ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -f audio_device -ac 2 -i /dev/dsp1 -f mp4 Filename.mp4
and the file "Filename.mp4" will be created and stored in the current working directory.
After trying to get this video to work with flowplayer (flowplayer.org
), it would reproduce the audio, but not the video, so in order to get it to work (albeit pretty low quality), I had to convert the m4v file to an flv file with the following command:
ffmpeg -i input_file_name.mp4 -vcodec flv -ar 22050 output_file_name.flv
That seemed to do the trick. Here's the first video
recorded using this method.
PS - Even though my camera is v4l2, I had to enable the v4l USE flag. Make sure you have the v4l USE flag turned on when you emerge it, or it won't work.