Whiskey Kilo Linux  •  Exploring GNU/Linux and F/OSS
intrepid.jpg

Friday 30th July 2010

drupal member logo

drupal logo

ubuntu logo

gnome logo

opensource logo

ffmpeg

Capture video from webcam with ffmpeg

Logitech Quickcam Vision Pro (Mac)I just bought a new webcam, a Logitech Quickcam Vision Pro (Mac version, 046d:09a6) with hardware controlled autofocus. Pictures are really sharp and the autofocus is cool too. Anyway, i needed to capture a small video with sound. Here's the ffmpeg command i used.
ffmpeg -t 10 -f video4linux2 -s 320x240 -r 30 -i /dev/video0 -f oss -i /dev/dsp1 -f mp4 webcam.mp4
No need to compile ffmpeg, this works out of the box!

Comments

Cut only one image from a movie with ffmpeg

You can use ffmpeg if you only need one image from a movie. I needed this to publish a starting picture of a small flash video on the net using the excellent flv player of Jeroen Wijering.

ffmpeg -itsoffset -5 -i movie.mpeg -vcodec png -vframes 1 -an -f rawvideo -s 360x288 movie.png

The itsoffse option tells you where to extract the image (in seconds). Of course you probably want to convert this to a jpeg image. Convert is part of the imagemagick package.

Tags:

Create mp4 with ffmpeg for Samsung SGH-E900

Samsung E900My phone plays video's so I decided to convert an old Will & Grace episode from a PAL resolution AVI to a 320x240 MP4 with ffmpeg. Here's the command:

ffmpeg -i will_and_grace.avi -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 128 -s 320x240 -aspect 4:3 out.mp4

I had to compile a new ffmpeg though as the ffmpeg that comes with Ubuntu doesn't support mp3 or aac encoding. Here's the configure command: