| | 1 | == Linux == |
| | 2 | |
| | 3 | Use the '''[http://ffmpeg.org/ffmpeg.html#x11grab x11grab]''' filter: |
| | 4 | {{{ |
| | 5 | ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0+100,200 output.flv |
| | 6 | }}} |
| | 7 | |
| | 8 | This will grab the image from desktop, starting with the upper-left corner at (x=100, y=200) with the width and height of 1024x768. |
| | 9 | |
| | 10 | If you need audio too, you can use this: |
| | 11 | {{{ |
| | 12 | ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0+100,200 -f alsa -ac 2 -i pulse output.flv |
| | 13 | }}} |
| | 14 | |
| | 15 | == Windows == |
| | 16 | |
| | 17 | Use the '''[http://ffmpeg.org/ffmpeg.html#dshow dshow]''' filter: |
| | 18 | {{{ |
| | 19 | ffmpeg -f dshow -i video="UScreenCapture" output.flv |
| | 20 | }}} |
| | 21 | |
| | 22 | This will grab the image from entire desktop. |
| | 23 | |
| | 24 | If you need audio too, you can use this: |
| | 25 | {{{ |
| | 26 | ffmpeg -f dshow -i video="UScreenCapture":audio="Microphone" output.flv |
| | 27 | }}} |
| | 28 | |
| | 29 | You can list your devices with: |
| | 30 | {{{ |
| | 31 | ffmpeg -list_devices true -f dshow -i dummy |
| | 32 | }}} |
| | 33 | |
| | 34 | == General note == |
| | 35 | |
| | 36 | If you have a slow computer, it will not be smart to grab and encode your video at the same time, because slow CPU will not be able to do this. In that case, first grab all you need and save it as uncompressed video/audio and when you finish the grabbing process then start converting it to whatever you need: |
| | 37 | |
| | 38 | Linux: |
| | 39 | {{{ |
| | 40 | ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0+100,200 -f alsa -ac 2 -i pulse -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le output.flv |
| | 41 | ffmpeg -i output.flv -acodec ... -vcodec ... final.flv |
| | 42 | }}} |
| | 43 | |
| | 44 | Windows: |
| | 45 | {{{ |
| | 46 | ffmpeg -f dshow -i video="UScreenCapture":audio="Microphone" -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le output.flv |
| | 47 | ffmpeg -i output.flv -acodec ... -vcodec ... final.flv |
| | 48 | }}} |