staugaard-transcoding_machine 0.2.2 → 0.2.3
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.
data/VERSION.yml
CHANGED
@@ -61,7 +61,7 @@ module TranscodingMachine
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def can_transcode?(media_file_attributes)
|
64
|
-
!media_file_attributes
|
64
|
+
!media_file_attributes.video? && media_file_attributes.audio? && media_file_attributes.bitrate >= @bitrate
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -74,7 +74,7 @@ module TranscodingMachine
|
|
74
74
|
|
75
75
|
case args[:aspect_ratio]
|
76
76
|
when String
|
77
|
-
Server::MediaFileAttributes::ASPECT_RATIO_VALUES[args[:aspect_ratio]]
|
77
|
+
@aspect_ratio = Server::MediaFileAttributes::ASPECT_RATIO_VALUES[args[:aspect_ratio]]
|
78
78
|
when Float
|
79
79
|
@aspect_ratio = args[:aspect_ratio]
|
80
80
|
end
|
@@ -82,10 +82,18 @@ module TranscodingMachine
|
|
82
82
|
@fixed_criteria << MediaFormatCriterium.new(:key => :video,
|
83
83
|
:operator => :equals,
|
84
84
|
:value => true)
|
85
|
+
|
86
|
+
@fixed_criteria << MediaFormatCriterium.new(:key => :width,
|
87
|
+
:operator => :equals,
|
88
|
+
:value => @width)
|
89
|
+
|
90
|
+
@fixed_criteria << MediaFormatCriterium.new(:key => :aspect_ratio,
|
91
|
+
:operator => :equals,
|
92
|
+
:value => @aspect_ratio)
|
85
93
|
end
|
86
94
|
|
87
95
|
def can_transcode?(media_file_attributes)
|
88
|
-
media_file_attributes
|
96
|
+
media_file_attributes.video? && media_file_attributes.width >= @width && media_file_attributes.aspect_ratio == @aspect_ratio
|
89
97
|
end
|
90
98
|
end
|
91
99
|
end
|
@@ -81,9 +81,9 @@ module TranscodingMachine
|
|
81
81
|
puts "EXIFTOOL:"
|
82
82
|
puts exiftool.inspect
|
83
83
|
store(:poster_time, exiftool.poster_time)
|
84
|
-
if exiftool.aspect_ratio and
|
84
|
+
if exiftool.aspect_ratio and aspect_ratio != exiftool.aspect_ratio
|
85
85
|
store(:height, (width / exiftool.aspect_ratio).to_i)
|
86
|
-
store(:
|
86
|
+
store(:aspect_ratio, exiftool.aspect_ratio)
|
87
87
|
elsif exiftool.width && exiftool.height
|
88
88
|
store(:width, exiftool.width)
|
89
89
|
store(:height, exiftool.height)
|
@@ -200,7 +200,7 @@ module TranscodingMachine
|
|
200
200
|
output[:video_format] = ffmpeg_track[:format] || mplayer_track[:format]
|
201
201
|
output[:width] = ffmpeg_track[:width] || mplayer_track[:width]
|
202
202
|
output[:height] = ffmpeg_track[:height] || mplayer_track[:height]
|
203
|
-
output[:
|
203
|
+
output[:aspect_ratio] = ffmpeg_track[:aspect] || mplayer_track[:aspect]
|
204
204
|
output[:video_fps] = ffmpeg_track[:fps] || mplayer_track[:fps]
|
205
205
|
output[:video_bitrate] = ffmpeg_track[:bitrate] || mplayer_track[:bitrate]
|
206
206
|
|
@@ -263,7 +263,7 @@ module TranscodingMachine
|
|
263
263
|
end
|
264
264
|
|
265
265
|
def derive_values
|
266
|
-
store(:
|
266
|
+
store(:aspect_ratio, video_aspect_ratio) if (video? && has_key?(:width) && has_key?(:height))
|
267
267
|
|
268
268
|
if file_name && (m = file_name.match(/.+\.(\w+)/))
|
269
269
|
store(:file_extension, m[1])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staugaard-transcoding_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mick Staugaard
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-25 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|