video_converter 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -55,8 +55,8 @@ module VideoConverter
|
|
55
55
|
durations = []
|
56
56
|
Dir::glob(File.join(output.chunks_dir, "#{chunk_prefix}-*[0-9].ts")).sort { |c1, c2| File.basename(c1).match(/\d+/).to_s.to_i <=> File.basename(c2).match(/\d+/).to_s.to_i }.each do |chunk|
|
57
57
|
durations << (duration = chunk_duration chunk)
|
58
|
-
res += "#EXTINF
|
59
|
-
res +=
|
58
|
+
res += "#EXTINF:%0.2f,\n" % duration
|
59
|
+
res += File.join(File.basename(output.chunks_dir), File.basename(chunk)) + "\n"
|
60
60
|
end
|
61
61
|
res = "#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:#{durations.max}\n#EXT-X-MEDIA-SEQUENCE:0\n" + res + "#EXT-X-ENDLIST"
|
62
62
|
File.open(File.join(output.work_dir, output.filename), 'w') { |f| f.write res }
|
@@ -66,7 +66,7 @@ module VideoConverter
|
|
66
66
|
res = "#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-PLAYLIST-TYPE:VOD\n"
|
67
67
|
playlist.streams.sort { |s1, s2| s1[:bandwidth].to_i <=> s2[:bandwidth].to_i }.each do |stream|
|
68
68
|
res += "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=#{stream[:bandwidth].to_i * 1000}\n"
|
69
|
-
res +=
|
69
|
+
res += stream[:path] + "\n"
|
70
70
|
end
|
71
71
|
res += "#EXT-X-ENDLIST"
|
72
72
|
File.open(File.join(playlist.work_dir, playlist.filename), 'w') { |f| f.write res }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
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: 2013-04-
|
12
|
+
date: 2013-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
segments:
|
122
122
|
- 0
|
123
|
-
hash:
|
123
|
+
hash: -2760051856794272205
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
none: false
|
126
126
|
requirements:
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
segments:
|
131
131
|
- 0
|
132
|
-
hash:
|
132
|
+
hash: -2760051856794272205
|
133
133
|
requirements:
|
134
134
|
- ffmpeg, version 1.2 or greated configured with libx264 and libfaac
|
135
135
|
- live_segmenter to convert to hls
|