Nunca había pensado que podía ser tan sencillo, varias veces ha surgido la necesidad de grabar un pequeño tutorial de lo que estás haciendo en el escritorio (que no es lo mismo que
grabar video en shell) y siempre he recurrido a herramientas como
xvidcap,
Istanbul o
recordMyDesktop, sin embargo parece mucho más fácil que todo eso y con tan solo la dependencia de
ffmpeg:
$ ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq ~/out.mpg
Generará un video
out.mpg a
25 fps capturando todo lo que hagamos, fácil y sencillo.
Recomendación directa de
Top ten one-liners CommandLineFu (vía
Wu), no dejéis de echarle un ojo porque hay comandos bastante curiosos e interesantes.
Comentarios
$ ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq ~/out.mpg
FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5+svn20090706-2ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --extra-cflags=-I/build/buildd/ffmpeg-0.5+svn20090706/debian/include --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 13 2009 22:15:16, gcc: 4.4.1
[x11grab @ 0x9393700]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
[x11grab @ 0x9393700]shared memory extension found
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 139 (MIT-SHM)
Minor opcode of failed request: 4 (X_ShmGetImage)
Serial number of failed request: 11
Current serial number in output stream: 11
Cuando averigüe que genera el error, posteo la solución.