Article

  • 2 years

    1 month

    YetiShare / Plugins / Media Converter

    2770

Install FFMPEG for Media Converter

How to Install FFMPEG and Codecs for Media Converter


For CentOS:

cd /root/
wget https://gist.githubusercontent.com/mustafaturan/7053900/raw/27f4c8bad3ee2bb0027a1a52dc8501bf1e53b270/latest-ffmpeg-centos6.sh
chmod 755 latest-ffmpeg-centos6.sh
./latest-ffmpeg-centos6.sh


For others, in the first instance attempt to run ffmpeginstaller.com:

yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
wget http://mirror.ffmpeginstaller.com/old/scripts/ffmpeg8/ffmpeginstaller.8.0.tar.gz tar zxvf ffmpeginstaller.8.0.tar.gz cd ffmpeginstaller.8.0 sh install.sh


For Ubuntu use (for root priv):

sudo ./install.sh


Install qt-faststart: (if not done above - moves the atom to enable streaming)

yum install git
cd /root/
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
./configure
make
make tools/qt-faststart
cp -a tools/qt-faststart /usr/bin/


Troubleshooting


How to test the media converter cron task

- Login to your admin area.
- Go to Manage Plugins page.
- Media Converter settings.
- Set "Output Cron Messages" to "yes" and click "Submit".
- Via your website upload a video file to be converted. (i.e. an avi file)
- Login via SSH to the server you're running the convert.php script on.
- Call the script manually, it'll be similar to this:

php /usr/share/nginx/html/www/plugins/mediaconverter/converter/convert.php
- Note the output.

Running the convert.php script works on the SSH command line but not via the crontab

The cron script works fine on command line however the following error is reporting when run automatically as a cron:

sh: ffmpeg: command not found

The system sometimes doesn't know about the path to ffmpeg. At the top of your crontab add this:

PATH=/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Amend /root/bin to wherever you have ffmpeg installed (command: whereis ffmpeg).

Alternatively set the full path to ffmpeg with the convert.php file.