Changes between Initial Version and Version 1 of How to grab the desktop (screen) with FFmpeg


Ignore:
Timestamp:
07/04/2012 02:56:34 AM (11 months ago)
Author:
burek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • How to grab the desktop (screen) with FFmpeg

    v1 v1  
     1== Linux == 
     2 
     3Use the '''[http://ffmpeg.org/ffmpeg.html#x11grab x11grab]''' filter: 
     4{{{ 
     5ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0+100,200 output.flv 
     6}}} 
     7 
     8This 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 
     10If you need audio too, you can use this: 
     11{{{ 
     12ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0+100,200 -f alsa -ac 2 -i pulse output.flv 
     13}}} 
     14 
     15== Windows == 
     16 
     17Use the '''[http://ffmpeg.org/ffmpeg.html#dshow dshow]''' filter: 
     18{{{ 
     19ffmpeg -f dshow -i video="UScreenCapture" output.flv 
     20}}} 
     21 
     22This will grab the image from entire desktop. 
     23 
     24If you need audio too, you can use this: 
     25{{{ 
     26ffmpeg -f dshow -i video="UScreenCapture":audio="Microphone" output.flv 
     27}}} 
     28 
     29You can list your devices with: 
     30{{{ 
     31ffmpeg -list_devices true -f dshow -i dummy 
     32}}} 
     33 
     34== General note == 
     35 
     36If 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 
     38Linux: 
     39{{{ 
     40ffmpeg -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 
     41ffmpeg -i output.flv -acodec ... -vcodec ... final.flv 
     42}}} 
     43 
     44Windows: 
     45{{{ 
     46ffmpeg -f dshow -i video="UScreenCapture":audio="Microphone" -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le output.flv 
     47ffmpeg -i output.flv -acodec ... -vcodec ... final.flv 
     48}}}