tivohmo 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97a335b0ba3a6e8c3cfc489ec4d8e7055defb358
4
- data.tar.gz: 98772403f11ba0604ef06b05e4152b8e6bdf3e00
3
+ metadata.gz: ac6001b62350b9a28f965390492e60ff2407f728
4
+ data.tar.gz: 284efd92ec46f6cae8771aac3b9f791c6a42b041
5
5
  SHA512:
6
- metadata.gz: 4b807b78720881a2001d0f302db1352e497faa1354fd32a4458301fa58e68f480c4fe5b64ce321bcb7c01e879ab22fed04a4ac327f99d52a008b74dbfcaa0fef
7
- data.tar.gz: ef366ff7a5bd01f12762a8785202f77709ac8099e9e73bad23b770202b346ca0189e6563d6c58b8a93c17bce0d70e197902abab7bbce46677300785cb562b4d3
6
+ metadata.gz: 8599fa6f50e310f56eb9160659aca81e0f37f08e08df436b6bee14e351cd77932fdfc1cd8f59d622ff2ac6677b61bf96bf80a35d5cd12d28e3cdcf5b67f34631
7
+ data.tar.gz: 889f69f0adab913e2860c2d36d29a6b546e9cd0d161b5aba2b8dff7a1f268560013e4dcfab43893d9a455ade5fe706075b9f6962ec372c12099e1869718f4cce
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.1.2 (10/12/2014)
2
+ ------------------
3
+
4
+ fix log msg <f7202de> [Matt Conway]
5
+ tweak transcoding <08f4af5> [Matt Conway]
6
+
1
7
  0.1.1 (10/12/2014)
2
8
  ------------------
3
9
 
@@ -50,7 +50,8 @@ module TivoHMO
50
50
  opts = select_audio_sample_rate(opts)
51
51
  opts = select_container(opts)
52
52
 
53
- opts[:custom] = opts[:custom].join(" ") if opts[:custom]
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
- if video_info[:video_bitrate].to_i >= opts[:video_max_bitrate]
114
- opts[:video_bitrate] = (video_info[:video_max_bitrate] * 0.95).to_i
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
- if !VIDEO_FRAME_RATES.include?(video_info[:frame_rate])
162
- opts[:frame_rate] = 29.97
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}='#{v}'"}.join(' ')
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: #{output_filename}"
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 "Trancoding #{item}: #{progress}"
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[23.98 24.00 25.00 29.97
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
@@ -1,3 +1,3 @@
1
1
  module TivoHMO
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tivohmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Conway