I have search through different forums and online resources on how I can use ffmpeg on my laravel 5.7 application on a shared host but have not gotten any solution. I actually installed ffmpeg on my project following the instructions from this link How to Install FFMPEG in Laravel.
I also downloaded the binary files and save them to my local drive C:// in my system with windows 8.1 Operating System. Then I connected my binary as show bellow;
$ffprobe = FFMpeg\FFProbe::create([
'ffmpeg.binaries' => 'C:/FFmpeg/bin/ffmpeg.exe', // the path to the FFMpeg binary
'ffprobe.binaries' => 'C:/FFmpeg/bin/ffprobe.exe', // the path to the FFProbe binary
'timeout' => 3600, // the timeout for the underlying process
'ffmpeg.threads' => 12, // the number of threads that FFMpeg should use
]);
I also did the path setting in the system environmental variables settings and everything was working great while serving the website from XAMPP Server.
The problem I have is that I have uploaded the project to a shared host that I dont have access to check if they have the ffmpeg on the server or not and the host provider could not really give me a helpful information about that. So, I uploaded the binary files into a folder in my filemanger on the cpanel and named it "binary files". Then I changed my codes as given bellow;
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => '/home/username/binary_files/bin/ffmpeg.exe', // the path to the FFMpeg binary
'ffprobe.binaries' => '/home/username/binary_files/bin/ffprobe.exe', // the path to the FFProbe binary
'timeout' => 3600, // the timeout for the underlying process
'ffmpeg.threads' => 1, // the number of threads that FFMpeg should use
]);
But still I get error that Unable to load FFProbe as shown in this Image from the code
public static function create($configuration, LoggerInterface $logger = null)
{
if (!$configuration instanceof ConfigurationInterface) {
$configuration = new Configuration($configuration);
}
$binaries = $configuration->get('ffprobe.binaries', array('avprobe', 'ffprobe'));
try {
return static::load($binaries, $logger, $configuration);
} catch (BinaryDriverExecutableNotFound $e) {
throw new ExecutableNotFoundException('Unable to load FFProbe', $e->getCode(), $e);
}
}
The major thing I am doing on my project is to convert video into proper encoded streaming video as well as automatically generate a .png or .jpg thumbnail from the video while uploading. So in case if there is an alternative other than ffmpeg to solve this or anyone that have use the ffmpeg library on a shared hosted before should help. Please!
Unfortunately not all hosting providers allow FFmpeg installation to their shared hosting plans.
The bandwidth may be unlimited but the CPU can not cope-up once your videos are getting too much traffic. This may risk other websites hosted on the same server.
My suggestion is then you should take VPS server and you will be rest!
Otherwise check text below, only DreamHost has installed ffmpeg on shared hosting
HostGator
Hostgator does not allow FFmpeg installation to your shared hosting plan. The bandwidth may be unlimited but the CPU can not cope-up once your videos are getting too much traffic. This may risk other websites hosted on the same server. You can only install the software if you’ll buy their VPS and Dedicated hosting.
GoDaddy
Due to the resources FFmpeg uses, GoDaddy does not allow FFmpeg installation to its shared hosting accounts but you can install it with their VPS and Dedicated servers.
Bluehost
According to Bluehost, FFmpeg module is processor-intensive for a shared hosting environment that is why, they do not support it.
DreamHost
If your hosting provide is DreamHost and you badly need FFmpeg module, then you are lucky. Dreamhost has an FFmpeg installed on their shared hosting servers already. The absolute path is /usr/local/dh/bin/ffmpeg. You can also manually install your own but take note that any break is not covered by Dreamhost support.
Check full article : Article Link