cutcut 1.3.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +1 -0
- data/bin/cutcut +7 -3
- data/cutcut.gemspec +3 -2
- data/lib/cutcut/helpers.rb +1 -1
- data/lib/cutcut/media.rb +1 -1
- data/lib/cutcut/timelapse.rb +7 -6
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f32227fb2714e7a4f063ad906ddbae63e8114af9
|
4
|
+
data.tar.gz: 13d6426b18247c31dc1eb66ca5515071700661d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0f40c26b9c1bf20bfe3a60b75035c111b41e0f2b535fa1ef064a1c805afa60c88c5df329e9b4f9f7e9658dc9cb6f56915ddbdee069890b8f48ef8c7bd185d7e
|
7
|
+
data.tar.gz: afb46a68b83c4b14790f04c46be3d3a60b921a46acf8350200aca1056397eb183ab3be1c2ed410a04017dfeb274c26e313ec1cdb37dd429ff8a10af2a6d6708d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,23 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
Version 1.4.2 (June 25, 2016)
|
5
|
+
-----------------------------
|
6
|
+
|
7
|
+
* Fix error when converting files with blank space characters
|
8
|
+
* Escape all input
|
9
|
+
* Rollback to rspec 3.4
|
10
|
+
|
11
|
+
Version 1.4.1 (June 17, 2016)
|
12
|
+
-----------------------------
|
13
|
+
|
14
|
+
* Update dependencies
|
15
|
+
|
16
|
+
Version 1.4.0 (June 5, 2016)
|
17
|
+
-----------------------------
|
18
|
+
|
19
|
+
* Add --raw option
|
20
|
+
|
4
21
|
Version 1.3.0 (May 11, 2016)
|
5
22
|
-----------------------------
|
6
23
|
|
data/README.md
CHANGED
@@ -32,6 +32,7 @@ Usage: cutcut [options]
|
|
32
32
|
--extract-screenshots NUMBER Screenshots per second
|
33
33
|
--input INPUT Input
|
34
34
|
--quality CRF CRF between 0 and 51, 0 lossless. Default to 20
|
35
|
+
--raw Raw options
|
35
36
|
--remove-audio Video speed
|
36
37
|
--scale SCALE_RESOLUTION Resolution to scale eg: 1280:720
|
37
38
|
--speed NUMBER Video speed
|
data/bin/cutcut
CHANGED
@@ -11,6 +11,7 @@ OptionParser.new do |opt|
|
|
11
11
|
opt.on('--extract-screenshots NUMBER', 'Screenshots per second') { |e| options[:extract_screenshots] = e }
|
12
12
|
opt.on('--input INPUT', 'Input') { |e| options[:input] = e }
|
13
13
|
opt.on('--quality CRF', 'CRF between 0 and 51, 0 lossless. Default to 20') { |e| options[:quality] = e }
|
14
|
+
opt.on('--raw', 'Raw options') { |e| options[:raw] = e }
|
14
15
|
opt.on('--remove-audio', 'Video speed') { options[:remove_audio] = true }
|
15
16
|
opt.on('--scale SCALE_RESOLUTION', 'Resolution to scale eg: 1280:720') { |e| options[:scale] = e }
|
16
17
|
opt.on('--speed NUMBER', 'Video speed') { |e| options[:speed] = e }
|
@@ -28,12 +29,14 @@ progressbar = ProgressBar.create(title: 'Converting', starting_at: 0, total: fil
|
|
28
29
|
puts "#{files.count + folders.count} files found"
|
29
30
|
|
30
31
|
files.each do |file|
|
31
|
-
media = CutCut::Media.new(input: file)
|
32
|
+
media = CutCut::Media.new(input: Regexp.escape(file))
|
32
33
|
scale = options[:scale] || '1920:1080'
|
33
34
|
speed = options[:speed]
|
34
35
|
remove_audio = options[:remove_audio]
|
36
|
+
remove_audio = true if speed.to_i != 1
|
37
|
+
|
35
38
|
crf = options[:quality]
|
36
|
-
media.convert(copy_metadata: options[:copy_metadata], scale: scale, speed: speed, remove_audio: remove_audio, crf: crf)
|
39
|
+
media.convert(copy_metadata: options[:copy_metadata], scale: scale, speed: speed, remove_audio: remove_audio, crf: crf, raw: options[:raw])
|
37
40
|
media.extract_screenshots(fps: options[:extract_screenshots], copy_metadata: true) if options[:extract_screenshots]
|
38
41
|
progressbar.increment
|
39
42
|
end
|
@@ -41,7 +44,8 @@ end
|
|
41
44
|
folders.each do |folder|
|
42
45
|
timelapse = CutCut::Timelapse.new(input: Regexp.escape(folder), output: Regexp.escape(File.join(options[:input_dir], File.basename(folder).gsub(/\s+/, '_') + '.mp4')))
|
43
46
|
scale = options[:scale] || '1920:1080'
|
44
|
-
|
47
|
+
crf = options[:quality]
|
48
|
+
timelapse.convert(fps: options[:timelapse_fps] || 30, scale: scale, remove_audio: true, crf: crf)
|
45
49
|
progressbar.increment
|
46
50
|
end
|
47
51
|
|
data/cutcut.gemspec
CHANGED
@@ -4,9 +4,9 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.email = ['stjhimy@gmail.com']
|
5
5
|
s.homepage = 'http://github.com/stjhimy/cutcut'
|
6
6
|
s.license = 'MIT'
|
7
|
-
s.summary = 'Trim/Cut/Screenshot videos'
|
7
|
+
s.summary = 'Easily Trim/Cut/Screenshot videos'
|
8
8
|
s.description = 'CLI for working with videos'
|
9
|
-
s.version = '1.
|
9
|
+
s.version = '1.4.2'
|
10
10
|
|
11
11
|
s.executables = ['cutcut']
|
12
12
|
s.files = `git ls-files`.split("\n")
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
s.add_development_dependency 'guard', '~> 2.13'
|
21
21
|
s.add_development_dependency 'guard-rspec', '~> 4.6'
|
22
|
+
s.add_development_dependency 'rubocop', '~> 0.4'
|
22
23
|
s.add_development_dependency 'guard-rubocop', '~> 1.2'
|
23
24
|
s.add_development_dependency 'rspec', '~> 3.4'
|
24
25
|
end
|
data/lib/cutcut/helpers.rb
CHANGED
data/lib/cutcut/media.rb
CHANGED
@@ -24,7 +24,7 @@ module CutCut
|
|
24
24
|
speed = "-filter:v \"setpts=#{options[:speed]}*PTS\"" if options[:speed]
|
25
25
|
remove_audio = options[:remove_audio] == true ? '-an' : nil
|
26
26
|
crf = options[:crf] || 20
|
27
|
-
"-movflags +faststart -vf scale=#{scale} -c:v libx264 -crf #{crf} -preset ultrafast #{speed} #{remove_audio}"
|
27
|
+
"-movflags +faststart -vf scale=#{scale} -c:v libx264 -crf #{crf} -preset ultrafast #{speed} #{remove_audio} #{options[:raw]}"
|
28
28
|
end
|
29
29
|
|
30
30
|
def extract_screenshots(options = {})
|
data/lib/cutcut/timelapse.rb
CHANGED
@@ -28,12 +28,13 @@ module CutCut
|
|
28
28
|
|
29
29
|
def convert(options = {})
|
30
30
|
fps = options[:fps] || 30
|
31
|
-
execute_ffmpeg_command(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
execute_ffmpeg_command(
|
32
|
+
input: File.join(@input, input_basename), output: @output,
|
33
|
+
raw_options: {
|
34
|
+
input: "-f image2 -start_number #{start_number} -framerate #{fps}",
|
35
|
+
output: '-c:v libx264 -r 30 -vf scale=-1:1080 -crf 23 -preset ultrafast -pix_fmt yuv420p'
|
36
|
+
}
|
37
|
+
)
|
37
38
|
|
38
39
|
Helpers.copy_metadata(files.first, @output)
|
39
40
|
@output
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutcut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jhimy Fernandes Villar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '4.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.4'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: guard-rubocop
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,7 +175,7 @@ rubyforge_project:
|
|
161
175
|
rubygems_version: 2.4.5.1
|
162
176
|
signing_key:
|
163
177
|
specification_version: 4
|
164
|
-
summary: Trim/Cut/Screenshot videos
|
178
|
+
summary: Easily Trim/Cut/Screenshot videos
|
165
179
|
test_files:
|
166
180
|
- spec/cutcut/base_spec.rb
|
167
181
|
- spec/cutcut/helpers_spec.rb
|