【问题标题】:get video metadata with carrierwave video使用carrierwave视频获取视频元数据
【发布时间】:2013-11-04 17:12:13
【问题描述】:

我正在使用carrierwave-video gem 对视频进行转码。

使用此代码,我可以获取视频file_sizecontent_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


【解决方案1】:

您可能想查看此 gem 而不是 https://github.com/streamio/streamio-ffmpeg

它满足你的所有要求。

【讨论】:

    猜你喜欢
    • 2015-08-23
    • 2017-02-26
    • 2011-10-06
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    • 2019-09-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多