lib/xmorph/base.rb in xmorph-0.1.1 vs lib/xmorph/base.rb in xmorph-0.1.2
- old
+ new
@@ -1,9 +1,8 @@
module XMorph
class Base
require_relative 'util'
- MEDIAINFO_COMMAND = "`pwd`/bin/mediainfo --output=XML %{IN}"
IGNORE = "ignore"
VALIDATE = "validate"
ALLOWED_ASPECT_RATIO = "allowed_aspect_ratio"
ALLOWED_HEIGHT = "allowed_height"
@@ -46,10 +45,11 @@
load file_path
return Transcode.new(asset_path)
end
def get_asset_details
- success, response = Util.run_cmd_with_response(MEDIAINFO_COMMAND % {IN: self.asset_path})
+ mediainfo_command = "#{File.dirname(self.class.root)}/bin/mediainfo --output=XML #{self.asset_path}"
+ success, response = Util.run_cmd_with_response(mediainfo_command)
begin
self.mediainfo_output = Util.mediainfo_xml_to_hash(response)[1]
rescue => e
raise TranscoderError.new("Failed to get mediainfo for the asset.") unless success
end
\ No newline at end of file