easyvideo_utils 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a8218b572adc3ea7af6ec5f9a4ed4c17837213e2bc1e091e0499977d64dde00
4
- data.tar.gz: d8b01d744b91c6f068792ef5f90d6c8efa149b469e9d0a872fb7b4a75a56de58
3
+ metadata.gz: be2a2ff74fb3a89e79760327a8a9321f1da18eaaf005c24bdbf204881ebfbd81
4
+ data.tar.gz: 162a33329b8d4e63250ad8ccc39ae23555015010635eb1a6ff72ae07f2367107
5
5
  SHA512:
6
- metadata.gz: ad770ed82c02a91223420f9438a806c623e88890096cbe1943c7e22ba420bee6969740a3ef6797dae4443fd5d01c1e6705343ecaab044ef841b1ace6bd2f21a8
7
- data.tar.gz: f69cda89ec765a73ab016b597bc021a5a7e287b3cd7cecaa5ea3e84a9da81f6ec661cdbf976a65c711d61159cc85961290a3cfcb6038acca2c0773d7681d8e27
6
+ metadata.gz: 1c07a1b13d1f78e439834007fd6dc47b5f37e5581e2a7a77ad42f2f394b0cc456ccb03494b097bc605dbd3cb0d0f71dbe96012f7ddb67dab89939b073f359605
7
+ data.tar.gz: b8fc77c13bd22bd672c8be1c4e6c57ce05302c9c13d53c690c6d21a1fff27ae16531c655195434e886ff4c0b81cea4648bf61e3685f0fd4f8c85ff999d780b82
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'c32'
6
6
  require 'subunit'
7
-
7
+ require 'easyimg_utils'
8
8
 
9
9
  # requirements:
10
10
  # `apt-get install mplayer ffmpeg vorbis-tools`exiftool libav-tools
@@ -57,6 +57,7 @@ class EasyVideoUtils
57
57
  * remove_video # removes the video track from a video. Output file would be an mp3.
58
58
  * resize # resize to 320x240
59
59
  * scale # alias for resize
60
+ * screencast # lightweight screenshot recorder -> animated gif -> mp4. see also capture
60
61
  * slowdown # slows a viedo down. Defaults to x2 (half-speed)
61
62
  * speedup # speed a video up. Defaults to x2 (twice as fast)
62
63
  * transcode # converts 1 video format to another e.g. avi-> mp4 or gif -> mp4
@@ -211,6 +212,18 @@ class EasyVideoUtils
211
212
 
212
213
 
213
214
  alias scale resize
215
+
216
+ # starts recoring after 2 seconds for a duration of 6 seconds
217
+ #
218
+ def screencast(duration: 6, scale: 0.75, window: true)
219
+
220
+ gif_file = @file_out.sub(/\w+$/,'gif')
221
+
222
+ EasyImgUtils.new(out: gif_file)\
223
+ .screencast(duration: duration, scale: scale, window: window)
224
+ EasyVideoUtils.new(gif_file, @file_out).transcode
225
+
226
+ end
214
227
 
215
228
  # slow down a video
216
229
  #
@@ -270,11 +283,13 @@ class EasyVideoUtils
270
283
  end
271
284
 
272
285
  private
273
-
286
+
287
+ # see https://unix.stackexchange.com/questions/40638/how-to-do-i-convert-an-animated-gif-to-an-mp4-or-mv4-on-the-command-line
288
+ #
274
289
  def gif_to_mp4(show: false)
275
290
 
276
291
  command = "ffmpeg -i %s -movflags faststart -pix_fmt yuv420p \
277
- -vf \"scale=trunc(iw/2)*2:trunc(ih/2)*2\" %s" % [@file_in, @file_out]
292
+ -vf \"scale=trunc(iw/2)*2:trunc(ih/2)*2\" %s" % [@file_in, @file_out]
278
293
  run command, show
279
294
 
280
295
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyvideo_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -77,6 +77,26 @@ dependencies:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0.4'
80
+ - !ruby/object:Gem::Dependency
81
+ name: easyimg_utils
82
+ requirement: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '0.6'
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.6.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.6'
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 0.6.1
80
100
  description:
81
101
  email: james@jamesrobertson.eu
82
102
  executables: []
metadata.gz.sig CHANGED
Binary file