Let’s say that you have a webcam, microphone and you want to rec something. Or, you want to grab from desktop of your computer. Of course, there are many different applications that can cope with the above task. But the easiest way to do this is to use FFmpeg. It is cross-platform, and can read, write, and convert audio and video. The library libavcodec is it strength. The roots of the almost open media players go back to these two programs.
Below are a few exemples:
The FFmpeg is simple to use for grabing from a live capture device
ffmpeg -f oss -i /dev/dsp -ab 128K -ac 2 -itsoffset 00:00:01 -f video4linux2 -i /dev/video0 -b 2500K output.mpgThe option -itsoffset set the input time offset in seconds, so you need to verify the syncronization of audio and video streams.
Also you can set the audio- and videobitrate using options -ab and -b. Option -ac enforce to set the numbers of channels in output audio stream.
Now we’ll learn how to grab the X server, in other words, how to rec what you do on your desktop using FFmpeg:
ffmpeg -f oss -i /dev/dsp -ab 256K -ac 2 -f x11grab -s 1400x900 -b 8000K -r 25 -i :0.0 output.mpgThere is also possibility to set the bitrate and the dimensions. Its need the both options -s and -r for video stream.
The FFmpeg is difficult, heavy and thorny, but it is very and very powerfull! So use it and do with it something that others can’t do!