commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
There are 2 alternatives - vote for the best!
Grab X11 input and create an MPEG at 25 fps with the resolution 800x600
Proper screencast with audio using ffmpeg and x264, as per http://verb3k.wordpress.com/2010/01/26/how-to-do-proper-screencasts-on-linux/
If you can do better, submit your command here.
You must be signed in to comment.
hmm... wtf? :
ffmpeg -f x11grab -s sxga -r 25 -i :0.0 -sameq ~/tst.mpgFFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec--disable-vis --enable-shared --disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Oct 3 2008 22:40:31, gcc: 4.3.2
[x11grab @ 0xb7ec4388]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1280 height: 1024
No protocol specified
[x11grab @ 0xb7ec4388]Could not open X display.
:0.0: I/O error occured
Usually that means that input file is truncated and/or corrupted.
Sad -:( now I have to read mans...
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Oct 3 2008 22:40:31, gcc: 4.3.2
[x11grab @ 0xb7f8f388]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
[x11grab @ 0xb7f8f388]shared memory extension found
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 148 (MIT-SHM)
Minor opcode of failed request: 4 (X_ShmGetImage)
Serial number of failed request: 9
Current serial number in output stream: 9
Doesn't work for me too
I confirm that it doesn't work on Ubuntu Intrepid (ffmpeg version r11872+debian_3:0.svn20080206-12ubuntu3). I get the same trace as manspaceunix. It's because you haven't set the size to fit your needs. For example, my screen is 1024x768, so instead of "-s sxga", I have to use "-s xga" and it does it.
Hmm, actually, I ended up using
ffmpeg -f x11grab -s sxga -r 24 -i :0.0 /tmp/out.mpg
on Ubuntu Intrepid and it works, although I find that the result blinks horribly.
you can also use -s XxY, for example i use -s 1680x1050 on my machine.
Or, assuming you have randr, use this for the general case:
ffmpeg -f x11grab -s `xrandr | grep "Screen 0" | awk '{ print $8 }'`x`xrandr | grep "Screen 0" | awk '{ print $10 }' | sed 's/,.*//'` -r 25 -i :0.0 -sameq /tmp/out.mpg
Seemed to have the same video quality as gtk-recordmydesktop, but with a crappier mouse pointer.
This works on machines without gtk-recordmydesktop (ubuntu doesn't have it, not to mention kde, xfce, etc. based environments)
Also, recordmydesktop doesn't work well with compiz.
I've used vlc in the past to record like this... Open screen:// with vlc and use its streaming features to save it.
looks the same with this command http://www.commandlinefu.com/commands/view/1618/record-your-desktop
I found the video looks better if played back on a different computer.
Also if you don't know the size of your scree and want to record the whole thing this variation works well.
ffmpeg -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -sameq /tmp/out.mpg
Doesn't work in my Ubuntu 8.04
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 16 2009 21:16:26, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Unknown input or output format: x11grab
Debian: may abort ("ffmpeg: symbol lookup error: ffmpeg: undefined symbol: ffm_nopts") if you use the debian-multimedia.org repository
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489209
this is what worked for me on debian unstable and...
FFmpeg version SVN-r20547, Copyright (c) 2000-2009 Fabrice Bellard, et al.
built on Nov 18 2009 19:13:44 with gcc 4.3.4
configuration: --prefix=/usr --extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-libfaad --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libtheora --enable-libdc1394 --enable-libspeex --enable-nonfree --disable-stripping --enable-avfilter --enable-libdirac --disable-decoder=libdirac --enable-libschroedinger --disable-encoder=libschroedinger --enable-avfilter-lavf --enable-libopenjpeg --enable-version3 --disable-altivec --disable-armv5te --disable-armv6 --disable-vis
libavutil 50. 4. 0 / 50. 4. 0
libavcodec 52.41. 0 / 52.41. 0
libavformat 52.39. 2 / 52.39. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1. 8. 0 / 1. 8. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
ffmpeg -f x11grab -s 1440x900 -r 15 -i :0 -vcodec libx264 -vpre normal -threads 0 ~/videofile.mp4