vcs_ruby 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/FFmpeg/ffmpeg.rb +4 -24
- data/lib/FFmpeg/ffmpeg_video_stream.rb +5 -1
- data/lib/MPlayer/mplayer.rb +12 -20
- data/lib/MPlayer/mplayer_audio_stream.rb +0 -1
- data/lib/capturer.rb +22 -0
- data/lib/contact_sheet.rb +1 -1
- data/lib/libAV/libav.rb +27 -49
- data/lib/libAV/libav_video_stream.rb +5 -1
- data/lib/version.info +1 -1
- metadata +2 -2
data/lib/FFmpeg/ffmpeg.rb
CHANGED
@@ -82,40 +82,18 @@ private
|
|
82
82
|
return nil, false, false
|
83
83
|
end
|
84
84
|
|
85
|
-
def probe_meta_information
|
86
|
-
check_cache
|
87
|
-
parse_meta_info
|
88
|
-
return true
|
89
|
-
rescue Exception => e
|
90
|
-
puts e
|
91
|
-
return false
|
92
|
-
end
|
93
|
-
|
94
85
|
def check_cache
|
95
86
|
unless @cache
|
96
87
|
@cache = @ffprobe.execute("\"#{@video.full_path}\" -show_format -show_streams", "2>&1")
|
97
88
|
end
|
98
89
|
end
|
99
90
|
|
100
|
-
def get_hash defines
|
101
|
-
result = {}
|
102
|
-
defines.lines.each do |line|
|
103
|
-
kv = line.split("=")
|
104
|
-
result[kv[0].strip] = kv[1].strip if kv.count == 2
|
105
|
-
end
|
106
|
-
result
|
107
|
-
end
|
108
|
-
|
109
|
-
def parse_meta_info
|
110
|
-
parse_format
|
111
|
-
parse_audio_streams
|
112
|
-
parse_video_streams
|
113
|
-
end
|
114
|
-
|
115
91
|
def parse_format
|
116
92
|
@cache.scan(/\[FORMAT\](.*?)\[\/FORMAT\]/m) do |format|
|
117
93
|
@info = FFmpegMetaInfo.new(get_hash(format[0]))
|
94
|
+
return true
|
118
95
|
end
|
96
|
+
false
|
119
97
|
end
|
120
98
|
|
121
99
|
def parse_audio_streams
|
@@ -126,6 +104,7 @@ private
|
|
126
104
|
@audio_streams << FFmpegAudioStream.new(info)
|
127
105
|
end
|
128
106
|
end
|
107
|
+
true
|
129
108
|
end
|
130
109
|
|
131
110
|
def parse_video_streams
|
@@ -136,6 +115,7 @@ private
|
|
136
115
|
@video_streams << FFmpegVideoStream.new(info)
|
137
116
|
end
|
138
117
|
end
|
118
|
+
true
|
139
119
|
end
|
140
120
|
end
|
141
121
|
end
|
data/lib/MPlayer/mplayer.rb
CHANGED
@@ -63,14 +63,6 @@ module VCSRuby
|
|
63
63
|
def format_split line
|
64
64
|
name = line.strip.split(' ', 2).first
|
65
65
|
end
|
66
|
-
def probe_meta_information
|
67
|
-
check_cache
|
68
|
-
parse_meta_info
|
69
|
-
return true
|
70
|
-
rescue Exception => e
|
71
|
-
puts e
|
72
|
-
return false
|
73
|
-
end
|
74
66
|
|
75
67
|
def check_cache
|
76
68
|
unless @cache
|
@@ -78,24 +70,24 @@ module VCSRuby
|
|
78
70
|
end
|
79
71
|
end
|
80
72
|
|
81
|
-
def
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
result[kv[0].strip] = kv[1].strip if kv.count == 2
|
86
|
-
end
|
87
|
-
result
|
73
|
+
def parse_format
|
74
|
+
mplayer_hash = get_hash(@cache)
|
75
|
+
@info = MPlayerMetaInfo.new(mplayer_hash, File.size(@video.full_path))
|
76
|
+
return true
|
88
77
|
end
|
89
78
|
|
90
|
-
def
|
79
|
+
def parse_audio_streams
|
80
|
+
@audio_streams = []
|
91
81
|
mplayer_hash = get_hash(@cache)
|
92
|
-
@
|
82
|
+
@audio_streams << MPlayerAudioStream.new(mplayer_hash)
|
83
|
+
return true
|
84
|
+
end
|
93
85
|
|
94
|
-
|
86
|
+
def parse_video_streams
|
95
87
|
@video_streams = []
|
88
|
+
mplayer_hash = get_hash(@cache)
|
96
89
|
@video_streams << MPlayerVideoStream.new(mplayer_hash)
|
97
|
-
|
98
|
-
@audio_streams << MPlayerAudioStream.new(mplayer_hash)
|
90
|
+
return true
|
99
91
|
end
|
100
92
|
|
101
93
|
def file_pattern n
|
data/lib/capturer.rb
CHANGED
@@ -43,5 +43,27 @@ module VCSRuby
|
|
43
43
|
raise "Capturer '#{name}' does not support format: '#{format}'"
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def probe_meta_information
|
49
|
+
check_cache
|
50
|
+
return parse_meta_info
|
51
|
+
rescue Exception => e
|
52
|
+
puts e
|
53
|
+
return false
|
54
|
+
end
|
55
|
+
|
56
|
+
def parse_meta_info
|
57
|
+
parse_format && parse_audio_streams && parse_video_streams
|
58
|
+
end
|
59
|
+
|
60
|
+
def get_hash defines
|
61
|
+
result = {}
|
62
|
+
defines.lines.each do |line|
|
63
|
+
kv = line.split("=")
|
64
|
+
result[kv[0].strip] = kv[1].strip if kv.count == 2
|
65
|
+
end
|
66
|
+
result
|
67
|
+
end
|
46
68
|
end
|
47
69
|
end
|
data/lib/contact_sheet.rb
CHANGED
@@ -337,7 +337,7 @@ private
|
|
337
337
|
convert << create_highlight(montage) if @highlight
|
338
338
|
convert << montage.path
|
339
339
|
convert.append
|
340
|
-
if @signature
|
340
|
+
if @signature && @signature.length > 0
|
341
341
|
convert.stack do |a|
|
342
342
|
a.size "#{montage.width}x#{signature_height}"
|
343
343
|
a.gravity 'Center'
|
data/lib/libAV/libav.rb
CHANGED
@@ -84,90 +84,68 @@ private
|
|
84
84
|
return nil, false, false
|
85
85
|
end
|
86
86
|
|
87
|
-
def probe_meta_information
|
88
|
-
check_cache
|
89
|
-
return parse_meta_info
|
90
|
-
rescue Exception => e
|
91
|
-
puts e
|
92
|
-
return false
|
93
|
-
end
|
94
|
-
|
95
87
|
def check_cache
|
96
88
|
unless @cache
|
97
89
|
@cache = @avprobe.execute("\"#{@video.full_path}\" -show_format -show_streams", "2>&1")
|
98
90
|
end
|
99
91
|
end
|
100
92
|
|
101
|
-
def
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
result[kv[0].strip] = kv[1].strip if kv.count == 2
|
93
|
+
def extract_format regexp
|
94
|
+
@cache.scan() do |format|
|
95
|
+
@info = LibAVMetaInfo.new(get_hash(format[0]))
|
96
|
+
return true
|
106
97
|
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
def parse_meta_info
|
111
|
-
parse_format && parse_audio_streams && parse_video_streams
|
98
|
+
false
|
112
99
|
end
|
113
100
|
|
114
101
|
def parse_format
|
115
|
-
parsed =
|
116
|
-
@cache.scan(/\[FORMAT\](.*?)\[\/FORMAT\]/m) do |format|
|
117
|
-
@info = LibAVMetaInfo.new(get_hash(format[0]))
|
118
|
-
parsed = true
|
119
|
-
end
|
102
|
+
parsed = extract_format(/\[FORMAT\](.*?)\[\/FORMAT\]/m)
|
120
103
|
unless parsed
|
121
|
-
|
122
|
-
@info = LibAVMetaInfo.new(get_hash(format[0]))
|
123
|
-
parsed = true
|
124
|
-
end
|
104
|
+
parsed = extract_format(/\[format\](.*?)\n\n/m)
|
125
105
|
end
|
126
106
|
return parsed
|
127
107
|
end
|
128
108
|
|
129
|
-
def
|
109
|
+
def extract_audio_streams regexp
|
130
110
|
parsed = false
|
131
|
-
@
|
132
|
-
@cache.scan(/\[STREAM\](.*?)\[\/STREAM\]/m) do |stream|
|
111
|
+
@cache.scan(regexp) do |stream|
|
133
112
|
info = get_hash(stream[0])
|
134
113
|
if info['codec_type'] == 'audio'
|
135
114
|
@audio_streams << LibAVAudioStream.new(info)
|
136
115
|
parsed = true
|
137
116
|
end
|
138
117
|
end
|
118
|
+
parsed
|
119
|
+
end
|
120
|
+
|
121
|
+
def parse_audio_streams
|
122
|
+
@audio_streams = []
|
123
|
+
parsed = extract_audio_streams(/\[STREAM\](.*?)\[\/STREAM\]/m)
|
139
124
|
unless parsed
|
140
|
-
|
141
|
-
info = get_hash(stream[0])
|
142
|
-
if info['codec_type'] == 'audio'
|
143
|
-
@audio_streams << LibAVAudioStream.new(info)
|
144
|
-
parsed = true
|
145
|
-
end
|
146
|
-
end
|
125
|
+
extract_audio_streams(/\[streams.stream.\d\](.*?)\n\n/m)
|
147
126
|
end
|
148
|
-
|
127
|
+
true
|
149
128
|
end
|
150
129
|
|
151
|
-
def
|
130
|
+
def extract_video_streams regexp
|
152
131
|
parsed = false
|
153
|
-
@
|
154
|
-
@cache.scan(/\[STREAM\](.*?)\[\/STREAM\]/m) do |stream|
|
132
|
+
@cache.scan(regexp) do |stream|
|
155
133
|
info = get_hash(stream[0])
|
156
134
|
if info['codec_type'] == 'video'
|
157
135
|
@video_streams << LibAVVideoStream.new(info)
|
158
136
|
parsed = true
|
159
137
|
end
|
160
138
|
end
|
139
|
+
parsed
|
140
|
+
end
|
141
|
+
|
142
|
+
def parse_video_streams
|
143
|
+
@video_streams = []
|
144
|
+
parsed = extract_video_streams(/\[STREAM\](.*?)\[\/STREAM\]/m)
|
161
145
|
unless parsed
|
162
|
-
|
163
|
-
info = get_hash(stream[0])
|
164
|
-
if info['codec_type'] == 'video'
|
165
|
-
@video_streams << LibAVVideoStream.new(info)
|
166
|
-
parsed = true
|
167
|
-
end
|
168
|
-
end
|
146
|
+
parsed = extract_video_streams(/\[streams.stream.\d\](.*?)\n\n/m)
|
169
147
|
end
|
170
|
-
|
148
|
+
true
|
171
149
|
end
|
172
150
|
end
|
173
151
|
end
|
data/lib/version.info
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.6
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcs_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-10-
|
12
|
+
date: 2016-10-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mini_magick
|