AWS EC2中的未知编码器'libx264'错误

时间:2018-07-06 07:56:05

标签: ruby-on-rails amazon-ec2 ffmpeg elastic-beanstalk libx264

我使用以下配置文件安装了ffmpeg:

packages:
  yum:
    ImageMagick: []
    ImageMagick-devel: []
commands:
  01-wget:
    command: "wget -O /tmp/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz"
  02-mkdir:
    command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi"
  03-tar:
    command: "tar xvf /tmp/ffmpeg.tar.xz -C /opt/ffmpeg --strip 1"
  04-ln:
    command: "if [[ ! -f /usr/bin/ffmpeg ]] ; then ln -sf /opt/ffmpeg/ffmpeg /usr/bin/ffmpeg; fi"
  05-ln:
    command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -sf /opt/ffmpeg/ffprobe /usr/bin/ffprobe; fi"
  06-pecl:
    command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"


不幸的是,在从载波视频进行编码的过程中,出现以下错误:

Unknown encoder 'libx264'
 (FFMPEG::Error)
    from gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:45:in `run'
    from gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/movie.rb:200:in `transcode'
    from gems/carrierwave-video-0.6.0/lib/carrierwave/video.rb:68:in `block in encode_video'
    from gems/carrierwave-video-0.6.0/lib/carrierwave/video.rb:81:in `with_trancoding_callbacks'
    from gems/carrierwave-video-0.6.0/lib/carrierwave/video.rb:62:in `encode_video'
    from app/uploaders/file_uploader.rb:21:in `encode'


我想我需要安装“ libx264”。您知道如何在Elastic beantalk上执行此操作吗?


问题解决了。我使用了不同的编解码器。

encode_video(:mp4, resolution: :same, custom: %w(-vcodec mpeg4) )

0 个答案:

没有答案