quasarstream / PHP-FFmpeg-video-streaming

📼 Package media content for online streaming(DASH and HLS) using FFmpeg
https://www.quasarstream.com/op/php/ffmpeg-streaming?u=php-ff
MIT License
516 stars 118 forks source link

After finishing HLS Encoding Gives Error (We could not find the binary) #25

Closed irfan0786 closed 5 years ago

irfan0786 commented 5 years ago

Describe the bug I'm using Laravel Job Below is the code and Error logs. Please advice

Laravel Code

$config = [ 'ffmpeg.binaries' => '/usr/bin/ffmpeg', 'ffprobe.binaries' => '/usr/bin/ffprobe', 'timeout' => 3600, 'ffmpeg.threads' => 12, ];

                    $rep_144 = (new Representation)->setKiloBitrate(95)->setResize(256 , 144);
                    $rep_240 = (new Representation)->setKiloBitrate(150)->setResize(426 , 240);
                    $rep_360 = (new Representation)->setKiloBitrate(276)->setResize(640 , 360);
                    $rep_480 = (new Representation)->setKiloBitrate(750)->setResize(854 , 480);
                    $rep_720 = (new Representation)->setKiloBitrate(2048)->setResize(1280 , 720);

                    $ffmpeg = \Streaming\FFMpeg::create($config)
                        ->open($this->inputFile)
                        ->HLS()
                        ->X264()
                        ->addRepresentation($rep_144)
                        ->addRepresentation($rep_240)
                        ->addRepresentation($rep_360)
                        ->addRepresentation($rep_480)
                        ->addRepresentation($rep_720)
                        ->setHlsTime(5) // Set Hls Time. Default value is 10 
                        ->setHlsAllowCache(false) // Default value is true 
                        ->save($path);

Error Logs [2019-11-05 11:29:49] local.ERROR: Streaming\Exception\RuntimeException: We could not find the binary(). Please check the path to the binary in vendor/aminyazdanpanah/php-ffmpeg-video-streaming/src/Process/Process.php:50 Stack trace:

0 vendor/aminyazdanpanah/php-ffmpeg-video-streaming/src/Process/Process.php(32): Streaming\Process\Process->getBinary(NULL)

1 vendor/aminyazdanpanah/php-ffmpeg-video-streaming/src/MediaInfo/MediaInfo.php(29): Streaming\Process\Process->__construct('mediainfo')

2 vendor/aminyazdanpanah/php-ffmpeg-video-streaming/src/StreamingAnalytics.php(62): Streaming\MediaInfo\MediaInfo::initialize('/var/www/html/s...', 'mediainfo')

3 vendor/aminyazdanpanah/php-ffmpeg-video-streaming/src/StreamingAnalytics.php(46): Streaming\StreamingAnalytics->getOriginalMetadata()

4 vendor/aminyazdanpanah/php-ffmpeg-video-streaming/src/Export.php(69): Streaming\StreamingAnalytics->analyse()

5 app/Jobs/StreamviewCompressVideo.php(147): Streaming\Export->save()

6 [internal function]: App\Jobs\StreamviewCompressVideo->handle()

7 bootstrap/cache/compiled.php(1257): call_user_func_array(Array, Array)

8 bootstrap/cache/compiled.php(9874): Illuminate\Container\Container->call(Array)

9 [internal function]: Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\StreamviewCompressVideo))

10 bootstrap/cache/compiled.php(9970): call_user_func(Object(Closure), Object(App\Jobs\StreamviewCompressVideo))

11 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\StreamviewCompressVideo))

12 bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(App\Jobs\StreamviewCompressVideo))

13 bootstrap/cache/compiled.php(9875): Illuminate\Pipeline\Pipeline->then(Object(Closure))

14 vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(41): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\StreamviewCompressVideo))

15 vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(130): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)

16 vendor/laravel/framework/src/Illuminate/Queue/Jobs/RedisJob.php(50): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)

17 vendor/laravel/framework/src/Illuminate/Queue/Worker.php(213): Illuminate\Queue\Jobs\RedisJob->fire()

18 vendor/laravel/framework/src/Illuminate/Queue/Worker.php(156): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), '0', '0')

19 vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(125): Illuminate\Queue\Worker->pop('', 'default', '0', '3', '0')

20 vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(78): Illuminate\Queue\Console\WorkCommand->runWorker('', 'default', '0', '128', false)

21 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()

22 bootstrap/cache/compiled.php(1257): call_user_func_array(Array, Array)

23 vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)

24 vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

25 vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

26 vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

27 vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

28 vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

29 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

30 artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

31 {main}

Desktop/Server (please complete the following information):

aminyazdanpanah commented 5 years ago

As you can see in the source directory, there is no MediaInfo.php file(and other related files).

You must update the package(see also #20):

composer update aminyazdanpanah/php-ffmpeg-video-streaming