video_converter 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/video_converter/ffmpeg.rb +21 -10
- data/lib/video_converter/output.rb +1 -0
- data/lib/video_converter/version.rb +1 -1
- metadata +19 -37
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4fdb79738807817fb560768a6c96967624eac3c3
|
4
|
+
data.tar.gz: 61c4941087d486940d2c3420797c71d1f5aa8e83
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 19e2a3ea041ca0d766d15748af7f7cd9f580e9b505766d25f7aa67380c483988afdac23a1d2a23979b0cc6a3265921d7d0962eca4fd9472e9171fddab15ed249
|
7
|
+
data.tar.gz: 7b01bdaefe59e061815d1ea818c5563fe43a420a9073ce49b6b021625cf13752f2638dad808fc098867206b964a8a45d3594253c68a4b5da258711eabf30f5d9
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module VideoConverter
|
4
4
|
class Ffmpeg
|
5
5
|
class << self
|
6
|
-
attr_accessor :aliases, :bin, :ffprobe_bin
|
6
|
+
attr_accessor :aliases, :defaults, :bin, :ffprobe_bin
|
7
7
|
attr_accessor :one_pass_command, :first_pass_command, :second_pass_command, :keyframes_command, :split_command, :concat_command, :mux_command, :volume_detect_command, :crop_detect_command
|
8
8
|
end
|
9
9
|
|
@@ -19,7 +19,20 @@ module VideoConverter
|
|
19
19
|
:format => 'f',
|
20
20
|
:bitstream_format => 'bsf',
|
21
21
|
:pixel_format => 'pix_fmt',
|
22
|
-
:audio_filter => 'af'
|
22
|
+
:audio_filter => 'af',
|
23
|
+
:profile => 'vprofile'
|
24
|
+
}
|
25
|
+
self.defaults = {
|
26
|
+
:threads => 1,
|
27
|
+
:video_codec => 'libx264',
|
28
|
+
:audio_codec => 'libfaac',
|
29
|
+
:pixel_format => 'yuv420p',
|
30
|
+
:frame_rate => 24,
|
31
|
+
:preset => 'medium',
|
32
|
+
:profile => 'main',
|
33
|
+
:level => 31,
|
34
|
+
:ar => 44100,
|
35
|
+
:ac => 2
|
23
36
|
}
|
24
37
|
self.bin = '/usr/local/bin/ffmpeg'
|
25
38
|
self.ffprobe_bin = '/usr/local/bin/ffprobe'
|
@@ -105,12 +118,11 @@ module VideoConverter
|
|
105
118
|
output.options[:format] ||= File.extname(output.filename).delete('.')
|
106
119
|
output.options[:format] = 'mpegts' if output.options[:format] == 'ts'
|
107
120
|
output.options[:movflags] = '+faststart' if output.faststart || (output.faststart.nil? && %w(mov mp4).include?(output.options[:format].downcase))
|
108
|
-
output.
|
109
|
-
|
110
|
-
:
|
111
|
-
:
|
112
|
-
|
113
|
-
}.merge(output.options) unless output.type == 'playlist'
|
121
|
+
unless output.type == 'playlist'
|
122
|
+
output.options = self.class.defaults.merge(output.options)
|
123
|
+
output.options[:keyint_min] ||= output.options[:frame_rate]
|
124
|
+
output.options[:keyframe_interval] = output.options[:keyint_min] * Output.keyframe_interval_in_seconds
|
125
|
+
end
|
114
126
|
end
|
115
127
|
end
|
116
128
|
|
@@ -125,8 +137,6 @@ module VideoConverter
|
|
125
137
|
if !one_pass?(qualities) && common_first_pass?(qualities)
|
126
138
|
qualities.each do |output|
|
127
139
|
output.options[:passlogfile] = File.join(output.work_dir, "group#{group_index}.log")
|
128
|
-
output.options[:keyint_min] = 25
|
129
|
-
output.options[:keyframe_interval] = 100
|
130
140
|
end
|
131
141
|
best_quality = qualities.sort do |q1, q2|
|
132
142
|
res = q1.options[:video_bitrate].to_i <=> q2.options[:video_bitrate].to_i
|
@@ -146,6 +156,7 @@ module VideoConverter
|
|
146
156
|
else
|
147
157
|
output.options[:passlogfile] = File.join(output.work_dir, "group#{group_index}_#{output_index}.log")
|
148
158
|
output.options[:force_key_frames] = input.metadata[:video_start_time].step(input.metadata[:duration_in_ms] / 1000.0, Output.keyframe_interval_in_seconds).map(&:floor).join(',')
|
159
|
+
output.options[:keyint_min], output.options[:keyframe_interval] = output.options[:keyframe_interval], nil
|
149
160
|
Command.chain(self.class.first_pass_command, self.class.second_pass_command)
|
150
161
|
end
|
151
162
|
|
@@ -7,6 +7,7 @@ module VideoConverter
|
|
7
7
|
end
|
8
8
|
self.work_dir = '/tmp'
|
9
9
|
self.log = 'converter.log'
|
10
|
+
# XXX move default options to one place
|
10
11
|
self.keyframe_interval_in_seconds = 4
|
11
12
|
|
12
13
|
attr_accessor :chunks_dir, :crop, :drm, :faststart, :ffmpeg_output, :filename, :group, :height, :log, :mkdir_mode, :no_fragments, :one_pass, :options, :path, :rotate, :streams, :thumbnails, :type, :uid, :volume, :watermarks, :width, :work_dir, :encryption_key, :encryption_key_url
|
metadata
CHANGED
@@ -1,94 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- novikov
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: video_screenshoter
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.2.3
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.2.3
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: bundler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.3'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.3'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: test-unit
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: shoulda-context
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
description: This gem allows you to convert video files using ffmpeg, mencoder and
|
@@ -99,8 +88,8 @@ executables: []
|
|
99
88
|
extensions: []
|
100
89
|
extra_rdoc_files: []
|
101
90
|
files:
|
102
|
-
- .Rakefile.swp
|
103
|
-
- .gitignore
|
91
|
+
- ".Rakefile.swp"
|
92
|
+
- ".gitignore"
|
104
93
|
- Gemfile
|
105
94
|
- LICENSE.txt
|
106
95
|
- README.md
|
@@ -131,35 +120,28 @@ files:
|
|
131
120
|
homepage: ''
|
132
121
|
licenses:
|
133
122
|
- MIT
|
123
|
+
metadata: {}
|
134
124
|
post_install_message:
|
135
125
|
rdoc_options: []
|
136
126
|
require_paths:
|
137
127
|
- lib
|
138
128
|
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
129
|
requirements:
|
141
|
-
- -
|
130
|
+
- - ">="
|
142
131
|
- !ruby/object:Gem::Version
|
143
132
|
version: '0'
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
hash: -163534295853469513
|
147
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
-
none: false
|
149
134
|
requirements:
|
150
|
-
- -
|
135
|
+
- - ">="
|
151
136
|
- !ruby/object:Gem::Version
|
152
137
|
version: '0'
|
153
|
-
segments:
|
154
|
-
- 0
|
155
|
-
hash: -163534295853469513
|
156
138
|
requirements:
|
157
139
|
- ffmpeg, version 1.2 or greated configured with libx264 and libfaac
|
158
140
|
- live_segmenter to convert to hls
|
159
141
|
rubyforge_project:
|
160
|
-
rubygems_version:
|
142
|
+
rubygems_version: 2.2.2
|
161
143
|
signing_key:
|
162
|
-
specification_version:
|
144
|
+
specification_version: 4
|
163
145
|
summary: Ffmpeg, mencoder based converter to mp4, m3u8
|
164
146
|
test_files:
|
165
147
|
- test/fixtures/chunk0.ts
|