我收到此错误:
Failed encoding. Errors: no output file created. Full output: dyld: Library not loaded: /usr/local/lib/libogg.0.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: Incompatible library version: ffmpeg requires version 9.0.0 or later, but libogg.0.dylib provides version 6.0.0
我已经通过 brew 安装了 ffmpeg,并安装了“ffmpeg”gem 和“streamio-ffmpeg”gem。
跑步:
otool -L /usr/local/lib/libogg.0.dylib
给我这个输出:
/usr/local/lib/libogg.0.dylib:
/usr/local/lib/libogg.0.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
我在其中使用 ffmpeg 的文件如下所示:
# lib/carrierwave/ffmpeg.rb
require 'streamio-ffmpeg'
module CarrierWave
module FFMPEG
module ClassMethods
def resample( bitrate )
process :resample => bitrate
end
end
def resample( bitrate )
directory = File.dirname( current_path )
tmpfile = File.join( directory, "tmpfile" )
FileUtils.mv( current_path, tmpfile )
file = ::FFMPEG::Movie.new(tmpfile)
file.transcode( current_path, :audio_bitrate => bitrate)
File.delete( tmpfile )
end
end
end