screen-recorder 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +1 -0
- data/.rubocop.yml +45 -28
- data/.travis.yml +42 -49
- data/{CHANGES.md → CHANGELOG.md} +99 -89
- data/Gemfile +3 -3
- data/README.md +31 -17
- data/Rakefile +10 -10
- data/appveyor.yml +39 -23
- data/bin/console +14 -14
- data/lib/screen-recorder.rb +54 -54
- data/lib/screen-recorder/common.rb +138 -152
- data/lib/screen-recorder/desktop.rb +40 -40
- data/lib/screen-recorder/options.rb +168 -168
- data/lib/screen-recorder/titles.rb +16 -52
- data/lib/screen-recorder/type_checker.rb +13 -13
- data/lib/screen-recorder/version.rb +2 -2
- data/lib/screen-recorder/window.rb +56 -22
- data/screen-recorder.gemspec +44 -42
- data/support/install_jruby.ps1 +7 -0
- data/support/start_test_reporter.sh +7 -0
- data/support/start_xvfb.sh +5 -0
- data/support/stop_test_reporter.sh +5 -0
- metadata +16 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 223571eec67845c142f2bddbe0bb59960b8ba800ba41374158aeadab58611291
|
|
4
|
+
data.tar.gz: 7292831582ec9afb87736c0e807c061162abf75cdf1a8c5b08a0ffc40a458aa0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f1bbe228c99deea2feb837097c7b6bc30cd00fc8051f43a2b56ad90f0dc6768ff04b87ecb45b564c56267383e1e5113c74ffdcea5c8708563a7782bca4b689fe
|
|
7
|
+
data.tar.gz: 173054cecd3169310b5a8982e9c3d5334edb5ade410436a11480c234d385bbe8b91c52a3ff25062a15e6dfc56ec7f37e52d325243cdd1a36fc423fcee870e9b6
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
|
@@ -5,6 +5,7 @@ Short summary of the bug or feature request.
|
|
|
5
5
|
Please provide the following information for bug reports:
|
|
6
6
|
|
|
7
7
|
* Operating system - Microsoft Windows, Linux, or macOS.
|
|
8
|
+
* Ruby version
|
|
8
9
|
* Recorder parameters - input, output, etc.
|
|
9
10
|
* Recorder log (`ffmpeg.log`) file as a gist or on pastebin.com.
|
|
10
11
|
* Set `ScreenRecorder.logger.level = Logger::DEBUG`, run the recorder, and share the
|
data/.rubocop.yml
CHANGED
|
@@ -1,58 +1,75 @@
|
|
|
1
|
-
require:
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-rspec
|
|
3
|
+
- rubocop-performance
|
|
4
|
+
|
|
2
5
|
AllCops:
|
|
3
6
|
DisplayCopNames: true
|
|
4
7
|
DisplayStyleGuide: true
|
|
5
8
|
ExtraDetails: false
|
|
6
|
-
TargetRubyVersion: 2.
|
|
9
|
+
TargetRubyVersion: 2.4
|
|
10
|
+
|
|
7
11
|
Gemspec/RequiredRubyVersion:
|
|
8
12
|
Enabled: false
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Metrics/BlockLength:
|
|
14
|
-
Enabled: false
|
|
15
|
-
Metrics/ClassLength:
|
|
16
|
-
Enabled: false
|
|
17
|
-
Metrics/AbcSize:
|
|
18
|
-
Enabled: false
|
|
19
|
-
Metrics/CyclomaticComplexity:
|
|
20
|
-
Enabled: false
|
|
21
|
-
Style/Documentation:
|
|
22
|
-
Enabled: false
|
|
23
|
-
RSpec/ExampleLength:
|
|
24
|
-
Enabled: false
|
|
25
|
-
RSpec/MultipleExpectations:
|
|
26
|
-
Enabled: false
|
|
13
|
+
|
|
14
|
+
Layout/EndOfLine:
|
|
15
|
+
EnforcedStyle: lf
|
|
16
|
+
|
|
27
17
|
Layout/MultilineMethodCallIndentation:
|
|
28
|
-
Enabled: false
|
|
29
18
|
EnforcedStyle: indented_relative_to_receiver
|
|
19
|
+
|
|
30
20
|
Layout/AlignArray:
|
|
31
21
|
Enabled: true
|
|
22
|
+
|
|
32
23
|
Layout/AlignHash:
|
|
33
24
|
Enabled: true
|
|
34
25
|
EnforcedHashRocketStyle: key
|
|
35
26
|
EnforcedColonStyle: table
|
|
27
|
+
|
|
36
28
|
Layout/AlignParameters:
|
|
37
29
|
Enabled: true
|
|
38
30
|
EnforcedStyle: with_first_parameter
|
|
39
|
-
|
|
40
|
-
Enabled: false
|
|
31
|
+
|
|
41
32
|
Layout/IndentFirstHashElement:
|
|
42
33
|
Enabled: true
|
|
34
|
+
|
|
35
|
+
Metrics/LineLength:
|
|
36
|
+
Max: 120
|
|
37
|
+
|
|
38
|
+
Metrics/MethodLength:
|
|
39
|
+
Max: 20
|
|
40
|
+
|
|
41
|
+
Metrics/ClassLength:
|
|
42
|
+
Max: 120
|
|
43
|
+
|
|
44
|
+
Metrics/AbcSize:
|
|
45
|
+
Max: 18
|
|
46
|
+
|
|
47
|
+
Metrics/BlockLength:
|
|
48
|
+
Exclude:
|
|
49
|
+
- 'screen-recorder.gemspec'
|
|
50
|
+
- 'spec/**/*'
|
|
51
|
+
|
|
43
52
|
Naming/FileName:
|
|
44
|
-
|
|
53
|
+
Exclude:
|
|
54
|
+
- 'lib/screen-recorder.rb'
|
|
55
|
+
|
|
45
56
|
RSpec/FilePath:
|
|
46
57
|
Enabled: false
|
|
58
|
+
|
|
59
|
+
RSpec/ExampleLength:
|
|
60
|
+
Enabled: false
|
|
61
|
+
|
|
62
|
+
RSpec/MultipleExpectations:
|
|
63
|
+
Enabled: false
|
|
64
|
+
|
|
47
65
|
Style/BlockDelimiters:
|
|
48
66
|
EnforcedStyle: braces_for_chaining
|
|
67
|
+
|
|
49
68
|
Style/CommentedKeyword:
|
|
50
69
|
Enabled: false
|
|
51
|
-
|
|
52
|
-
Enabled: false
|
|
53
|
-
Style/MethodCallWithoutArgsParentheses:
|
|
54
|
-
Enabled: false
|
|
70
|
+
|
|
55
71
|
Style/FrozenStringLiteralComment:
|
|
56
72
|
Enabled: false
|
|
73
|
+
|
|
57
74
|
TrailingBlankLines:
|
|
58
75
|
Enabled: false
|
data/.travis.yml
CHANGED
|
@@ -1,49 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
env: RAKE_TASK=spec
|
|
24
|
-
- rvm: 2.6.3
|
|
25
|
-
os: osx
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
./cc-test-reporter before-build;
|
|
44
|
-
fi
|
|
45
|
-
script: bundle exec rake $RAKE_TASK
|
|
46
|
-
after_script:
|
|
47
|
-
- if [[ "$REPORT_COVERAGE" == "true" ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then
|
|
48
|
-
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
|
|
49
|
-
fi
|
|
1
|
+
language: ruby
|
|
2
|
+
cache: bundler
|
|
3
|
+
branches:
|
|
4
|
+
only:
|
|
5
|
+
- /.*/
|
|
6
|
+
env:
|
|
7
|
+
global:
|
|
8
|
+
- DISPLAY=":0"
|
|
9
|
+
matrix:
|
|
10
|
+
include:
|
|
11
|
+
- rvm: 2.4.6
|
|
12
|
+
dist: xenial
|
|
13
|
+
env: RAKE_TASK=spec
|
|
14
|
+
- rvm: 2.4.6
|
|
15
|
+
dist: xenial
|
|
16
|
+
env: RAKE_TASK=rubocop
|
|
17
|
+
- rvm: 2.6.3
|
|
18
|
+
dist: xenial
|
|
19
|
+
env: RAKE_TASK=spec
|
|
20
|
+
- rvm: jruby-9.2.7.0
|
|
21
|
+
dist: xenial
|
|
22
|
+
jdk: openjdk8
|
|
23
|
+
env: RAKE_TASK=spec JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"
|
|
24
|
+
- rvm: 2.6.3
|
|
25
|
+
os: osx
|
|
26
|
+
osx_image: xcode11
|
|
27
|
+
env: RAKE_TASK=spec
|
|
28
|
+
addons:
|
|
29
|
+
firefox: latest
|
|
30
|
+
chrome: stable
|
|
31
|
+
apt:
|
|
32
|
+
packages:
|
|
33
|
+
- ffmpeg
|
|
34
|
+
homebrew:
|
|
35
|
+
packages:
|
|
36
|
+
- ffmpeg
|
|
37
|
+
before_script:
|
|
38
|
+
- bash support/start_xvfb.sh
|
|
39
|
+
- bash support/start_test_reporter.sh
|
|
40
|
+
script: bundle exec rake $RAKE_TASK
|
|
41
|
+
after_script:
|
|
42
|
+
- bash support/stop_test_reporter.sh
|
data/{CHANGES.md → CHANGELOG.md}
RENAMED
|
@@ -1,90 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
* `
|
|
29
|
-
|
|
30
|
-
### 1.0.0
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* :warning:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* `
|
|
83
|
-
|
|
84
|
-
### 1.0.0.
|
|
85
|
-
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
### 1.3.0 (2019-07-26)
|
|
6
|
+
* Support JRuby 9.2+ ([#58](https://github.com/kapoorlakshya/screen-recorder/issues/58))
|
|
7
|
+
* Add `ScreenRecorder::Window.fetch_title` as an alias for `ScreenRecorder::Titles.fetch`.
|
|
8
|
+
The `Titles` class will be removed in version 2.0.
|
|
9
|
+
|
|
10
|
+
### 1.2.0 (2019-05-12)
|
|
11
|
+
* Separate input/output specific `ffmpeg` arguments through the `advanced`
|
|
12
|
+
Hash. See example [here](https://github.com/kapoorlakshya/screen-recorder#advanced-options).
|
|
13
|
+
* Check for errors after starting the `ffmpeg` process to make sure the
|
|
14
|
+
recording does not stop silently because of an error. Prints the error
|
|
15
|
+
from the log if the process exists unexpectedly.
|
|
16
|
+
* Now using [`childprocess`](https://github.com/enkessler/childprocess) gem
|
|
17
|
+
to manage the `ffmpeg` process. This requires the `ffi` gem to be
|
|
18
|
+
installed on Windows. See [childprocess#132](https://github.com/enkessler/childprocess/issues/150)
|
|
19
|
+
for more information.
|
|
20
|
+
|
|
21
|
+
### 1.1.0 (2019-04-14)
|
|
22
|
+
* <b>Add support for macOS</b> ([#55](https://github.com/kapoorlakshya/screen-recorder/issues/55)).
|
|
23
|
+
Thanks to [Denys Bazarnyi](https://github.com/bazarnyi) for testing this and providing feedback.
|
|
24
|
+
* Force kill `ffmpeg` if it takes more than 10s to quit ([#60](https://github.com/kapoorlakshya/screen-recorder/issues/60)).
|
|
25
|
+
* Fix a bug where `ScreenRecorder.ffmpeg_binary=()` was not properly defined.
|
|
26
|
+
* `ScreenRecorder::Titles#fetch` will now raise `NotImplementedError` when used in a
|
|
27
|
+
Linux or a macOS environment. Only works on Windows.
|
|
28
|
+
* Default `input` value on Linux is now `:0`.
|
|
29
|
+
|
|
30
|
+
### 1.0.0 (2019-03-15)
|
|
31
|
+
* Released first major version.
|
|
32
|
+
* Now uses `ScreenRecorder` as top level module. `FFMPEG` is not directly
|
|
33
|
+
exposed anymore.
|
|
34
|
+
* The recording modes are now available through `ScreenRecorder::Desktop`
|
|
35
|
+
and `ScreenRecorder::Window` classes to make the usage (parameters) simpler.
|
|
36
|
+
* Method parameters are now keywords instead of an `opts` Hash. This means
|
|
37
|
+
at least Ruby 2.0.0 is required.
|
|
38
|
+
* `framerate:` is now to be passed through the `advanced` Hash.
|
|
39
|
+
|
|
40
|
+
### 1.0.0.beta13 (2019-03-15)
|
|
41
|
+
* Gem will now be renamed to `screen-recorder`. Please refer to Issue
|
|
42
|
+
[#45](https://github.com/kapoorlakshya/screen-recorder/issues/45)
|
|
43
|
+
for more information.
|
|
44
|
+
|
|
45
|
+
### 1.0.0.beta12 (2019-03-12)
|
|
46
|
+
* Reverted post install message as `screen_recorder` is already taken.
|
|
47
|
+
|
|
48
|
+
### 1.0.0.beta11 (2019-03-12)
|
|
49
|
+
* Recording FPS (`framerate`) is defaulted to 15.0.
|
|
50
|
+
* Gem will soon be renamed to `screen_recorder`. Please refer to Issue
|
|
51
|
+
[#45](https://github.com/kapoorlakshya/screen-recorder/issues/45)
|
|
52
|
+
for more information.
|
|
53
|
+
|
|
54
|
+
### 1.0.0.beta10 (2019-02-05)
|
|
55
|
+
* Fixed an edge case in Microsoft Windows specific implementation of
|
|
56
|
+
`WindowTitles#fetch` where processes with mismatching names and window
|
|
57
|
+
titles, such as process `"Calculator.exe"` with window title `"CicMarshalWnd"`,
|
|
58
|
+
were omitted ([#35](https://github.com/kapoorlakshya/screen-recorder/issues/35)).
|
|
59
|
+
This fix also prints a warning when this mismatch occurs.
|
|
60
|
+
* Fixed bug in Linux specific `WindowTitles#fetch` implementation where
|
|
61
|
+
the filter by application name logic was removed. This filter is required
|
|
62
|
+
on Linux here because `wmctrl` returns all open window titles unlike
|
|
63
|
+
Microsoft Windows where `taskmgr` allows us get window titles by process
|
|
64
|
+
name.
|
|
65
|
+
* On Linux, you are now required to provide the `input` as `"desktop"`
|
|
66
|
+
or a display number, such as `":0.0"`. Run `echo $DISPLAY` to check your display number.
|
|
67
|
+
* QOL improvements - Type checking of inputs, spec cleanup, added more
|
|
68
|
+
tests, and fixed rubocop warnings.
|
|
69
|
+
|
|
70
|
+
### 1.0.0.beta9 (2019-01-22)
|
|
71
|
+
|
|
72
|
+
* :warning: `FFMPEG::RecordingRegions` is now `FFMPEG::WindowTitles`, so the module name is true to the function it provides.
|
|
73
|
+
* Added support for for a user given path via `FFMPEG#ffmpeg_binary=()`.
|
|
74
|
+
* Removed Bundler version requirement from gemspec to support all versions.
|
|
75
|
+
* Implement `#discard` (alias `#delete`) to discard the video file. Useful when your test passes and you want to get rid of the video file.
|
|
76
|
+
|
|
77
|
+
### 1.0.0.beta8 (2019-01-03)
|
|
78
|
+
|
|
79
|
+
* Fix a bug where the gem was incorrectly configured to be required as `ffmpeg/screenrecorder` instead of `screen-recorder`.
|
|
80
|
+
* `ScreenRecorder#start` now returns the IO process object in case the user has a use case for it.
|
|
81
|
+
* `RecordingRegion#fetch` now logs a warning that `x11grab` for Linux does not supporting window recording.
|
|
82
|
+
* :warning: Parameter `infile` is now `input` to make it more intuitive.
|
|
83
|
+
|
|
84
|
+
### 1.0.0.beta7 (2018-12-23)
|
|
85
|
+
|
|
86
|
+
* Fix bug in RecorderOptions where an incorrect object was referenced to read the user provided options.
|
|
87
|
+
|
|
88
|
+
### 1.0.0.beta6 (2018-12-3)
|
|
89
|
+
|
|
90
|
+
* Stopping the screenrecorder now prints the failure reason given by the ffmpeg binary when `#stop` fails (Issue #7).
|
|
91
|
+
* Log file is now defaulted to `ffmpeg.log` instead of redirecting to nul.
|
|
92
|
+
* `log_level` now defaults to `Logger::ERROR` instead of `Logger::INFO`.
|
|
93
|
+
|
|
94
|
+
### 1.0.0.beta5 (2018-11-26)
|
|
95
|
+
|
|
96
|
+
* `Screenrecorder` class is now `ScreenRecorder`.
|
|
97
|
+
* Add support for Linux.
|
|
98
|
+
* Now an exception raised if the gem fails to find `ffmpeg`.
|
|
99
|
+
* Fix a bug where a file named `nul` was created instead of directing the output to `NUL`.
|
|
90
100
|
* Fix a bug where `RecordingRegions#window_titles` was not returning anything because of missing return keyword.
|
data/Gemfile
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gemspec
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gemspec
|
data/README.md
CHANGED
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
A Ruby gem to video record your computer screen - desktop or specific
|
|
11
11
|
window - using [FFmpeg](https://www.ffmpeg.org/). Primarily
|
|
12
|
-
geared towards recording automated UI test executions for
|
|
13
|
-
and documentation.
|
|
12
|
+
geared towards recording automated UI (Selenium) test executions for
|
|
13
|
+
debugging and documentation.
|
|
14
14
|
|
|
15
|
-
Demo
|
|
15
|
+
#### Demo
|
|
16
|
+
[https://kapoorlakshya.github.io/introducing-screen-recorder-ruby-gem](https://kapoorlakshya.github.io/introducing-screen-recorder-ruby-gem).
|
|
16
17
|
|
|
17
18
|
## Compatibility
|
|
18
19
|
|
|
19
|
-
Works on Windows, Linux, and macOS. Requires Ruby 2.0 or
|
|
20
|
+
Works on Windows, Linux, and macOS. Requires Ruby 2.0+ or JRuby 9.2+.
|
|
20
21
|
|
|
21
22
|
## Installation
|
|
22
23
|
|
|
@@ -25,20 +26,27 @@ Works on Windows, Linux, and macOS. Requires Ruby 2.0 or higher.
|
|
|
25
26
|
Linux and macOS instructions are [here](https://www.ffmpeg.org/download.html).
|
|
26
27
|
|
|
27
28
|
For Microsoft Windows, download the *libx264* enabled binary from [here](https://ffmpeg.zeranoe.com/builds/).
|
|
28
|
-
Once downloaded, add location of the `ffmpeg/bin` folder to `PATH`
|
|
29
|
-
([instructions](https://windowsloop.com/install-ffmpeg-windows-10/)).
|
|
29
|
+
Once downloaded, add location of the `ffmpeg/bin` folder to the `PATH`
|
|
30
|
+
environment variable ([instructions](https://windowsloop.com/install-ffmpeg-windows-10/)).
|
|
30
31
|
|
|
31
32
|
Alternatively, you can point to the binary file using
|
|
32
33
|
`ScreenRecorder.ffmpeg_binary = '/path/to/ffmpeg'` in your project.
|
|
33
34
|
|
|
34
35
|
##### 2. Install gem
|
|
35
36
|
|
|
36
|
-
Next, add
|
|
37
|
+
Next, add these lines to your application's Gemfile:
|
|
37
38
|
|
|
38
39
|
```ruby
|
|
40
|
+
gem 'ffi' # Windows only
|
|
39
41
|
gem 'screen-recorder'
|
|
40
42
|
```
|
|
41
43
|
|
|
44
|
+
The [`ffi`](https://github.com/ffi/ffi) gem is used by the
|
|
45
|
+
[`childprocess`](https://github.com/enkessler/childprocess) gem on
|
|
46
|
+
Windows, but it does not explicitly require it. More information
|
|
47
|
+
on this [here](https://github.com/enkessler/childprocess/issues/150).
|
|
48
|
+
|
|
49
|
+
|
|
42
50
|
And then execute:
|
|
43
51
|
|
|
44
52
|
```bash
|
|
@@ -48,6 +56,7 @@ $ bundle
|
|
|
48
56
|
Or install it yourself as:
|
|
49
57
|
|
|
50
58
|
```bash
|
|
59
|
+
$ gem install ffi # Windows only
|
|
51
60
|
$ gem install screen-recorder
|
|
52
61
|
```
|
|
53
62
|
|
|
@@ -87,6 +96,8 @@ browser = Watir::Browser.new :firefox
|
|
|
87
96
|
@recorder.stop
|
|
88
97
|
browser.quit
|
|
89
98
|
```
|
|
99
|
+
This mode has limited capabilities. Read more about it in the wiki
|
|
100
|
+
[here](https://github.com/kapoorlakshya/screen-recorder/wiki/Window-Capture-Limitations).
|
|
90
101
|
|
|
91
102
|
##### Fetch Title
|
|
92
103
|
|
|
@@ -94,16 +105,13 @@ A helper method is available to fetch the title of the active window
|
|
|
94
105
|
for the given process name.
|
|
95
106
|
|
|
96
107
|
```ruby
|
|
97
|
-
ScreenRecorder::
|
|
108
|
+
ScreenRecorder::Window.fetch_title('firefox') # Name of exe
|
|
98
109
|
#=> ["Mozilla Firefox"]
|
|
99
110
|
|
|
100
|
-
ScreenRecorder::
|
|
111
|
+
ScreenRecorder::Window.fetch_title('chrome')
|
|
101
112
|
#=> ["New Tab - Google Chrome"]
|
|
102
113
|
```
|
|
103
114
|
|
|
104
|
-
This mode has limited capabilities. Read more about it in the wiki
|
|
105
|
-
[here](https://github.com/kapoorlakshya/screen-recorder/wiki/Window-Capture-Limitations).
|
|
106
|
-
|
|
107
115
|
#### Output
|
|
108
116
|
|
|
109
117
|
Once the recorder is stopped, you can view the video metadata or transcode
|
|
@@ -120,12 +128,12 @@ it if desired.
|
|
|
120
128
|
@colorspace="yuv420p",
|
|
121
129
|
... >
|
|
122
130
|
|
|
123
|
-
@recorder.video.transcode("
|
|
131
|
+
@recorder.video.transcode("recording.mp4") { |progress| puts progress } # 0.2 ... 0.5 ... 1.0
|
|
124
132
|
```
|
|
125
133
|
|
|
126
134
|
See [`streamio-ffmpeg`](https://github.com/streamio/streamio-ffmpeg) gem for more details.
|
|
127
135
|
|
|
128
|
-
#### Discard
|
|
136
|
+
#### Discard Recording
|
|
129
137
|
|
|
130
138
|
If your test passes or you do not want the recording for any reason,
|
|
131
139
|
simply call `@recorder.discard` or `@recorder.delete` to delete
|
|
@@ -134,7 +142,7 @@ the video file.
|
|
|
134
142
|
#### Advanced Options
|
|
135
143
|
|
|
136
144
|
You can provide additional parameters to FFmpeg using the `advanced`
|
|
137
|
-
parameter. You can specify input/output specific parameters using
|
|
145
|
+
parameter. You can specify input/output specific parameters using `input: {}`
|
|
138
146
|
and `output: {}` within the `advanced` Hash.
|
|
139
147
|
|
|
140
148
|
```ruby
|
|
@@ -200,9 +208,15 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
200
208
|
|
|
201
209
|
## Credits
|
|
202
210
|
|
|
211
|
+
Thanks to [Denys Bazarnyi](https://github.com/bazarnyi) for testing
|
|
212
|
+
macOS compatibility in v1.1.0.
|
|
213
|
+
<br />
|
|
214
|
+
<br />
|
|
215
|
+
|
|
203
216
|
[](http://streamio.com)
|
|
204
217
|
|
|
205
|
-
This gem
|
|
218
|
+
This gem relies on the [streamio-ffmpeg](https://github.com/streamio/streamio-ffmpeg)
|
|
219
|
+
gem to extract metadata from the output file.
|
|
206
220
|
<br />
|
|
207
221
|
<br />
|
|
208
222
|
|
|
@@ -210,4 +224,4 @@ This gem is based on the [streamio-ffmpeg](https://github.com/streamio/streamio-
|
|
|
210
224
|
|
|
211
225
|
Thanks to [SauceLabs](https://saucelabs.com) for providing me with a
|
|
212
226
|
free account. If you manage an open source project, you can apply for
|
|
213
|
-
a free account [here](https://saucelabs.com/open-source).
|
|
227
|
+
a free account [here](https://saucelabs.com/open-source).
|