tivohmo 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/lib/tivohmo/adapters/streamio/transcoder.rb +27 -8
- data/lib/tivohmo/api/transcoder.rb +1 -2
- data/lib/tivohmo/cli.rb +8 -3
- data/lib/tivohmo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6001b62350b9a28f965390492e60ff2407f728
|
4
|
+
data.tar.gz: 284efd92ec46f6cae8771aac3b9f791c6a42b041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8599fa6f50e310f56eb9160659aca81e0f37f08e08df436b6bee14e351cd77932fdfc1cd8f59d622ff2ac6677b61bf96bf80a35d5cd12d28e3cdcf5b67f34631
|
7
|
+
data.tar.gz: 889f69f0adab913e2860c2d36d29a6b546e9cd0d161b5aba2b8dff7a1f268560013e4dcfab43893d9a455ade5fe706075b9f6962ec372c12099e1869718f4cce
|
data/CHANGELOG
CHANGED
@@ -50,7 +50,8 @@ module TivoHMO
|
|
50
50
|
opts = select_audio_sample_rate(opts)
|
51
51
|
opts = select_container(opts)
|
52
52
|
|
53
|
-
|
53
|
+
custom = opts.delete(:custom)
|
54
|
+
opts[:custom] = custom.join(" ") if custom
|
54
55
|
opts.delete(:format)
|
55
56
|
|
56
57
|
opts
|
@@ -110,9 +111,19 @@ module TivoHMO
|
|
110
111
|
end
|
111
112
|
|
112
113
|
def select_video_bitrate(opts)
|
113
|
-
|
114
|
-
|
114
|
+
|
115
|
+
vbr = video_info[:video_bitrate] || video_info[:bitrate]
|
116
|
+
|
117
|
+
if vbr && vbr > 0
|
118
|
+
if vbr >= opts[:video_max_bitrate]
|
119
|
+
opts[:video_bitrate] = (video_info[:video_max_bitrate] * 0.95).to_i
|
120
|
+
else
|
121
|
+
opts[:video_bitrate] = vbr
|
122
|
+
end
|
115
123
|
end
|
124
|
+
|
125
|
+
opts[:video_bitrate] ||= 16384
|
126
|
+
|
116
127
|
opts
|
117
128
|
end
|
118
129
|
|
@@ -158,16 +169,24 @@ module TivoHMO
|
|
158
169
|
end
|
159
170
|
|
160
171
|
def select_video_frame_rate(opts)
|
161
|
-
|
162
|
-
|
172
|
+
|
173
|
+
frame_rate = video_info[:frame_rate].to_f
|
174
|
+
VIDEO_FRAME_RATES.each do |r|
|
175
|
+
if frame_rate >= r.to_f
|
176
|
+
opts[:frame_rate] = r
|
177
|
+
break
|
178
|
+
end
|
163
179
|
end
|
180
|
+
|
181
|
+
opts[:frame_rate] ||= 29.97
|
182
|
+
|
164
183
|
opts
|
165
184
|
end
|
166
185
|
|
167
186
|
def run_transcode(output_filename, format)
|
168
187
|
|
169
188
|
logger.debug "Movie Info: " +
|
170
|
-
video_info.collect {|k, v| "#{k}
|
189
|
+
video_info.collect {|k, v| "#{k}=#{v.inspect}"}.join(' ')
|
171
190
|
|
172
191
|
opts = transcoder_options(format)
|
173
192
|
|
@@ -182,9 +201,9 @@ module TivoHMO
|
|
182
201
|
|
183
202
|
transcode_thread = Thread.new do
|
184
203
|
begin
|
185
|
-
logger.info "Starting transcode to
|
204
|
+
logger.info "Starting transcode of '#{movie.path}' to '#{output_filename}'"
|
186
205
|
transcoded_movie = movie.transcode(output_filename, opts, t_opts) do |progress|
|
187
|
-
logger.info "
|
206
|
+
logger.info ("[%3i%%] Transcoding #{File.basename(movie.path)}" % (progress * 100).to_i)
|
188
207
|
raise "Halted" if Thread.current[:halt]
|
189
208
|
end
|
190
209
|
logger.info "Transcoding completed, transcoded file size: #{File.size(output_filename)}"
|
@@ -9,8 +9,7 @@ module TivoHMO
|
|
9
9
|
include GemLogger::LoggerSupport
|
10
10
|
|
11
11
|
# https://code.google.com/p/streambaby/wiki/video_compatibility
|
12
|
-
VIDEO_FRAME_RATES = %w[
|
13
|
-
30.00 50.00 59.94 60.00]
|
12
|
+
VIDEO_FRAME_RATES = %w[60.00 59.94 50.00 30.00 29.97 25.00 24.00 23.98]
|
14
13
|
VIDEO_CODECS = %w[mpeg2video] # h264 only for push?
|
15
14
|
VIDEO_WIDTHS = %w[1920 1440 1280 720 704 544 480 352]
|
16
15
|
VIDEO_HEIGHTS = %w[1080 720 480 240]
|
data/lib/tivohmo/cli.rb
CHANGED
@@ -13,6 +13,8 @@ module TivoHMO
|
|
13
13
|
|
14
14
|
def self.description
|
15
15
|
desc = <<-DESC
|
16
|
+
TivoHMO version #{TivoHMO::VERSION}
|
17
|
+
|
16
18
|
Runs a HMO server. Specify one or more applications to show up as top level
|
17
19
|
shares in the TiVo Now Playing view. The application, identifier,
|
18
20
|
transcoder, metadata options can be given in groups to apply the transcoder
|
@@ -23,12 +25,15 @@ module TivoHMO
|
|
23
25
|
tivohmo -a TivoHMO::Adapters::Filesystem::Application -i ~/Video/Movies \\
|
24
26
|
-a TivoHMO::Adapters::Filesystem::Application -i ~/Video/TV
|
25
27
|
|
26
|
-
to run two top level filesystem video serving apps for different dirs,
|
27
|
-
or
|
28
|
+
to run two top level filesystem video serving apps for different dirs, or
|
28
29
|
|
29
30
|
tivohmo -a TivoHMO::Adapters::Filesystem::Application -t Vids -i ~/Video
|
30
31
|
|
31
|
-
to run the single filesystem app with a custom title
|
32
|
+
to run the single filesystem app with a custom title, or
|
33
|
+
|
34
|
+
tivohmo -a TivoHMO::Adapters::Plex::Application -t PlexVideo -i localhost
|
35
|
+
|
36
|
+
to run the single plex app with a custom title
|
32
37
|
DESC
|
33
38
|
desc.split("\n").collect(&:strip).join("\n")
|
34
39
|
end
|
data/lib/tivohmo/version.rb
CHANGED