Code Monkey home page Code Monkey logo

screen-recorder's Issues

Rename gem to screen-recorder

Once #32 is merged, we will no longer be using and exposing the FFMPEG namespace. The ffmpeg in the name can hence be dropped and the name can be simplified to screen-recorder to match the new namespace ScreenRecorder.

TODO

  • Create screen-recorder repo
  • Add a post-install message to beta13
  • Release beta13
  • Rename Github repository
  • Create ffmpeg-screenrecorder (for Google) and add link to new repo in README
  • Update references in Travis and Code Climate.
  • Merge #43
  • Update README and CHANGES files
  • Release screen_recorder 1.0.0
  • Update blog post
  • Update example Cucumber project

Resources

https://brandonhilkert.com/blog/ruby-gem-post-install-message/

#fetch - ArgumentError (invalid byte sequence in UTF-8)

Steps to reproduce:

  1. Open issue 35 in Chrome
  2. FFMPEG::WindowTitles.fetch 'chrome'

This will raise ArgumentError (invalid byte sequence in UTF-8). We could perform encode('UTF-8') (source) on the retrieved title, but I am not sure if ffmpeg wants an exact match on the title.

Workaround

Workaround is to open or switch to a web page with a clean title, start the recording, and then switch back to the window title with unsupported characters.

Implement screenshot capture.

ScreenRecorder::Desktop.screenshot(output: 'desktop.jpeg')
ScreenRecorder::Window.screenshot(output: 'window.jpeg')

ffmpeg -f gdigrab -framerate 1 -i desktop -vframes 1 output.jpeg

WindowTitles#fetch omits results if the application binary name does not match the application name.

Examples

calc.exe vs Calculator
chrome.exe vs SRWare Iron or iron

Fix is to remove this check:

# window_titles.rb:33
.select { |t| t.match?(/#{application}/i) } # Narrow down to given application

Drawback is that the returned list will now have Windows OLE related window names, such as OleMainThreadWndName and nsAppShell:EventWindow. This will require an update to the README to inform the users of this change in behavior.

Also, need to update the filtering on N/A and blank window titles. These are usually present when using Chrome which spawns a new process for each extension.

raw_list.map { |i| i.gsub(/^Window Title:( N\/A|\s+)?/) }.reject!(&:empty?)

#ffmpeg_exists? does not check for user given path.

Fix is to use @ffmpeg_binary from streamio gem instead of directly using fmpeg.

Update: The gem actually does use @ffmpeg_binary and that logic is fine. The problem is with #ffmpeg_exists? in #start_ffmpeg which does only looks for the binary in ENV. It does not check to see if @ffmpeg_binary has a path to it.

The fix will actually be to first check ENV and then check if @ffmpeg_binary. Note: @ffmpeg_binary returns "ffmpeg" assuming it exists in ENV if use does not define a path to it. So, to work around this, the condition will be:

  1. Check in ENV
  2. Check @ffmpeg_binary != "ffmpeg". It should have a full path to the binary instead.

Capture the second window

I am using two monitor, One monitor my RubyMine would be opened and in my another monitor, Browser opens and runs on it. If I use desktop recorder, then it records both the monitor together, Can I have any way to record the second monitor only? I ask this because when I recorder firefox or chrome, it records only the first window, the second window if opens as a result of the click is not captured at all.

Run specs on Travis when commits are push to master.

  • Setup Travis CI account
  • Create job for repository, trigger on every push to master
  • Use Ubuntu dist: xenial to get ffmpeg from official repo instead of adding a ppa
  • Run on Ruby 2.3.x
  • Run on Ruby 2.4.x
  • Run on Ruby 2.5.x
  • Run on Ruby 2.6.x
  • Add build status badge to README

Moving from Ruby 2.5.1 to Ruby 2.5.3 creates a new problem

@kapoorlakshya

Hi, I have moved from Ruby 2.5.1 to Ruby 2.5.3, now it's throwing this error

FFMPEG::Error: [gdigrab @ 000002a00ad4a540] Invalid properties, aborting
title=OleMainThreadWndName: I/O error

ffmpeg.log

ffmpeg version N-93075-gb429c86d84 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 46.100 / 58. 46.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[gdigrab @ 000001a07c30a540] Found window OleMainThreadWndName, capturing 0x0x32 at (0,0)
[gdigrab @ 000001a07c30a540] Invalid properties, aborting
title=OleMainThreadWndName: I/O error

Break down spec by class

All tests are currently grouped under the ScreenRecorder spec. They should be grouped by the class/object they test instead.

Force kill ffmpeg process when Timeout::Error occurs in #stop_ffmpeg.

Will need OS specific logic. This one works on macOS and possibly on Linux:

def stop_ffmpeg
# ...
rescue Timeout::Error
  ScreenRecorder.logger.error 'FFmpeg failed to stop. Force killing it...'
  pid = (@process.pid + 1) # Parent process + 1
  Process.kill 'TERM', pid
end

Could combine with #18.

Even after successful record it's throwing the error

Hi, My recording is successfully happening for firefox. But even after the successful recording, it throws the following error

FFMPEG::Error: [libx264 @ 00000225731ae940] ref B L1: 95.2% 4.8%
[libx264 @ 00000225731ae940] kb/s:192.70

And May I know this recorder can be used for Chrome as well? I haven't gotten any success with chrome yet. If it can be done, Can you let me know how that is?

Accept ffmpeg input and output params separately.

Accept input/output params separately to appropriately place them in the parsed (final) command.

advanced = {
  input:  {
    framerate:   30,
    pix_fmt:     'yuv420p',
    video_size:  '1280x720',
    show_cursor: 1
  },
  output: {
    framerate: 15,
    pix_fmt:   'yuv420p'
  },
  log:    'recorder.log',
  loglevel: 'level+debug', # For FFmpeg
}

Options - Improve logic for handling values

Maybe it should be its own Class to handle the options/parameter parsing and sending to ffmpeg logic?

  • Update name from opts to options
  • Verify required options exist
  • Allow user to provide extra options through :advanced key
  • Add spec for advanced options

No longer maitained?

Is this gem ffmpeg-screenrecorder no longer been maintained? I have been working with this gem. You supported few months back?

What's the change? I can't record chrome screen so far. Can I record chrome screen if I use your new gem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.