【发布时间】:2013-11-04 17:12:13
【问题描述】:
我正在使用carrierwave-video gem 对视频进行转码。
使用此代码,我可以获取视频file_size 和content_type:
class VideoUploader < CarrierWave::Uploader::Base
include CarrierWave::Video
include CarrierWave::MimeTypes
.
.
.
process :set_content_type
process :save_content_type_and_size_in_model
def save_content_type_and_size_in_model
model.content_type = file.content_type if file.content_type
model.file_size = file.size
end
end
我想知道这些视频数据:
width, height, duration, bit_rate, checksum
谢谢!
【问题讨论】:
-
github.com/rheaton/carrierwave-video#dynamic-configuration 动态配置显示你可以做一个 movie.height 。宽度也应该起作用。浏览代码没有看到 ruby 接口来获取校验和和比特率详细信息。值得拉请求 IMO
-
你能粘贴一个例子并给出答案吗?谢谢!
标签: ruby-on-rails ruby-on-rails-3 video ruby-on-rails-3.2 carrierwave