我的解决方案是:
# video_uploader.rb
版本:v1080p 做
处理:encode_video => [:mp4_1080p]
def full_filename(for_file)
“#{model.id}_#{File.basename(for_file, File.extname(for_file))}.mp4”
结尾
结尾
# video_converter.rb
modify:
fixed_name = File.basename(current_path, '.*') + "." + format.to_s
by:
fixed_name = File.basename(current_path, '.*') + "." + format.to_s.split("_").
在以下位置为 voyeur 创建一个文件 perfil:
/path_to_ruby/gems/voyeur-0.1.2/lib/Voyeur/video_converters/mp4_1080p.rb
# mp4_1080p.rb
module Voyeur
class Mp4_1080p < Converter
def file_extension
"mp4"
end
def convert_options
"-b 1500k -vcodec libx264 -vpre hq -s hd1080 -g 30"
end
end
end