Binary Revolution Forums: ffmpeg screen capture command - Binary Revolution Forums

Jump to content

Welcome to Binary Revolution Forums

Welcome to the Binary Revolution Forums! You are a guest and are welcome to browse our 7 public forums at the top of the list without registering. All other forums are restricted to registered users only and will give you an "unauthorized" message if you try to browse them. However, if you Register or Sign In (ABSOLUTELY FREE and PRIVATE) you will be able to access many more sections of the site that are reserved for registered members and have lots of other benefits such as bypassing those annoying ads.

  • NO ADS! All of the ads are for GUESTS ONLY!
  • The annoying guest message (this very one) at the top of every page will go away.
  • Access our private messaging system to communicate with other users.
  • Start new topics and reply to others instead of just reading.
  • Subscribe to topics and forums to get automatic updates on watched threads.
  • Add/view events to our community calendar.
  • Customize your profile and see your statistics.
  • Change your preferences such as choosing layouts and tweaking your settings.
  • Contribute your site to our database of links.
  • Access our Gallery and all of its features (instead of just viewing thumbnails) including uploading images of your own.
  • Build up your reputation using our reputation controls.
  • Once again: NO ADS! All of the ads are for GUESTS ONLY! It is all free so Register Now!
Guest Message © 2012 DevFuse
ANNOUNCEMENTS & NEWS:


ANNOUNCEMENT: BinRev is now proud to be hosted and affiliated with lunarpages! See the announcement at the top of the forums for more details.
ANNOUNCEMENT: Follow us on twitter: @binrev @stankdawg

NOTE 2012-03-12: The forums are pretty neglected these days. I still stop in and clean up SPAM every once in a while and ban asshats as the need arises but you MUST USE THE REPORT FEATURE to notify the moderating team! We will not know that there are problems if you do not report it.

-- StankDawg

Subscribe to CETX_var_log        RSS Feed
***** 1 Votes

ffmpeg screen capture command

Icon 3 Comments
i am always having to look this up. now at least i'll have it here:

ffmpeg -f x11grab -vc theora -s vga -r 24 -b 1200 -g 300 -i :0.0 ~/Videos/screenCapture1.ogv


option by option:

-f x11grab = take video from X...ffmpeg must have been compiled with enable-x11grab included; your distro or version may or may not have this enabled!

-vc = Video Codec...usually you will have ogg theora, xvid, [ff]mpeg (the default), and x264 available

-s = size. see the ffmpeg man page for details; vga is something like 800x600 and there are many other sizes available. know that it starts from the top left corner counts pixels from there.

-r = frame rate. lower frame rate gives smaller file size but looks a little less smooth

-b = bitrate. higher bitrate looks better but makes for a larger file size

-g = GOP size...300 provides a pretty nice looking image without increasing file size too much; it's got one intra frame every...i dunno....300/24 = 12.5 seconds or so.

-i = input...in this case it's :0.0 meaning your main screen. or display. or whatever it's called.


As you can imagine, there are a LOT more options available to you via man ffmpeg. Probably the most notable would be the offset, so if you wanted the capture area to not start at the very top left, you could tell it to, say, go down 10 pixels and over 10 pixels and THEN capture vga-size images, or xga-size images, or whatever.

3 Comments On This Entry

Page 1 of 1

petr999 

09 January 2009 - 04:12 AM
Great to get in contact here.
I mean this to say:
===
$ ffmpeg -vcodec libxvid -b 1200 -g 300 -vd x11:0,0 -s 1024x768 screenCapture1.xvid
FFmpeg version SVN-r14424, Copyright © 2000-2008 Fabrice Bellard, et al.
configuration: --cc=cc --prefix=/usr/local --disable-debug --enable-memalign-hack --enable-shared --enable-postproc --extra-cflags=-I/usr/local/include/vorbis -I/usr/local/include --extra-ldflags=-L/usr/local/lib -la52 --extra-libs=-pthread --enable-gpl --enable-pthreads --enable-swscale --mandir=/usr/local/man --enable-liba52 --enable-liba52bin --enable-libfaac --enable-libfaad --enable-libfaadbin --disable-libamr-nb --disable-libamr-wb --disable-mmx --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
libavutil version: 49.7.0
libavcodec version: 51.61.0
libavformat version: 52.18.0
libavdevice version: 52.0.0
built on Jan 9 2009 12:11:23, gcc: 4.2.1 20070719 [FreeBSD]
ffmpeg: unrecognized option '-vd'
===
There is no really '-vd' described at http://ffmpeg.mplaye...ffmpeg-doc.html
Is this your mistake? :)
0

notKlaatu 

15 January 2009 - 07:50 PM
yeah that is my mistake and i wonder now how i got that wrong....
one think about your ffmpeg version though is that i don't see in the list of all those options that x11 grab is enabled. you may need to recompile is with that enabled...i'm not positive.

anyway, i'm correcting the post now...
0

qubodup 

06 April 2010 - 07:34 AM
Hi there, thanks for the command, but unfortunately

ffmpeg -f x11grab -vc theora -s vga -r 24 -b 1200 -g 300 -i :0.0 ./screenCapture1.ogv

gives me a nearly empty ogv file. Using an .avi filename does work though. Perhaps my ffmpeg doesn't support theora. :|

Do you have ideas how to record a video, but in a max-performance, least-speedy way, so I could encode it later but enjoy a faster framerate?

If you reply, please press the "reply" button at the bottom right of this so I get notified :)
0
Page 1 of 1

May 2012

S M T W T F S
  12345
6789101112
13141516 17 1819
20212223242526
2728293031  

Recent Entries

Recent Comments

Search My Blog


  • Time Now: May 17 2012 04:59 AM