# FFMPEG::Screenrecorder Ruby gem to record your computer screen - desktop or specific application/window - using [FFMPEG](https://www.ffmpeg.org/). ## Support Only supports Windows OS as of version `1.0.0-beta2`. ## Installation Add this line to your application's Gemfile: ```ruby gem 'ffmpeg-screenrecorder' ``` And then execute: $ bundle Or install it yourself as: $ gem install ffmpeg-screenrecorder ## Usage ##### Record Desktop ``` opts = { output: 'ffmpeg-screenrecorder-output.mp4', input: 'desktop', framerate: 30.0, device: 'gdigrab', log: 'ffmpeg-screenrecorder-log.txt' } @recorder = FFMPEG::Screenrecorder.new(opts) # Start recording @recorder.start # ... Run tests or whatever you want to record # Stop recording @recorder.stop # Recording file will be available: ffmpeg-screenrecorder-output.mp4 ``` ##### Record Specific Application/Window ``` require 'watir' browser = Watir::Browser.new :firefox FFMPEG::Screenrecorder.window_titles('firefox') # Name of exe #=> "Mozilla Firefox" opts = { output: 'ffmpeg-screenrecorder-firefox.mp4', input: 'Mozilla Firefox', framerate: 30.0, device: 'gdigrab', log: 'ffmpeg-screenrecorder-firefox.txt' } @recorder = FFMPEG::Screenrecorder.new(opts) # Start recording @recorder.start # ... Run tests or whatever you want to record # Stop recording @recorder.stop # Recording file will be available: ffmpeg-screenrecorder-output.mp4 ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/kapoorlakshya/ffmpeg-screenrecorder. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).