Paperclip AV Transcoder can not upload video

When use gem paperclip-av-transcoder to upload video and get error:

Av::UnableToDetect - Unable to detect any supported library:
  av (0.9.0) lib/av/cli.rb:10:in `initialize'
  av (0.9.0) lib/av.rb:24:in `cli'
  paperclip-av-transcoder (0.6.4) lib/paperclip/paperclip_processors/transcoder.rb:14:in `initialize'

=> May be your computer missing ffmpeg and libav-tools

To install them:

// libav-tools
sudo apt-get install libav-tools

// ffmpeg
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg gstreamer0.10-ffmpeg

====================================================================

And if after install them, we get error:

Av::CommandError - error while running command avconv -loglevel quiet -i

Let’s uninstall them and reinstall ffmpeg static build

// Uninstall  
sudo apt-get remove ffmpeg  
sudo apt-get purge libav-tools

// install ffmpeg static build
wget http://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
tar xf ffmpeg-git-64bit-static.tar.xz
cd ffmpeg-git-64bit-static
sudo mv ff* qt-faststart /usr/bin/
Advertisements