Article

  • 9 years

    3 years

    YetiShare / Plugins / Media Converter

    13402

Install FFMPEG for Media Converter

How to Install FFMPEG and Codecs for Media Converter


For Ubuntu 20:

$ sudo apt install ffmpeg

For CentOS 6:

$ 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
* if you get the compiler error "Minimum version is nasm-2.13" update nasm using this:

$ yum-config-manager --add-repo http://www.nasm.us/nasm.repo
$ yum install nasm

* when downloading a file using "Curl -O .." and extracting it, if you get the error "stdin: not in gzip format", redownload the file using wget.


For CentOS 7:

See here - https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/


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.9.0.tar.gz tar zxvf ffmpeginstaller.* cd ffmpeginstaller.* 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.