i was using core PHP not using any larawel or any Codeigniter and my os is AWS ubuntu server.
here is my code:
require 'video_editor/vendor/autoload.php';
use Streaming\Representation; //thsi also throw error and code is not run
$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => ffmpeg_lib,
'ffprobe.binaries' => ffprobe_lib,
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
), null);
$ffmpeg_string = ffmpeg_lib;
$ffprobe_lib = ffprobe_lib;
$orignalVideoPath = "tmp/1599388321915191545.mp4"; //this is a hardcoded string but in my code the video file is dynamic
$video->hls()
->x264()
->autoGenerateRepresentations([720, 360]) // You can limit the number of representatons
->save();
$ffmpeg="<span class='label label-success'>ffmpeg is inside</span>";
}else
{
$ffmpeg="ffmpeg is shown error";
}
and error is thrown when I run this code.
Fatal error: Uncaught Error: Call to undefined method FFMpeg\Media\Video::hls() in /path/debugmode_file.php:712 Stack trace: #0 /path/debugmode_file.php(306): ServerStatus() #1 {main} thrown in /path/debugmode_file.php on line 712
i was using core PHP not using any larawel or any Codeigniter and my os is AWS ubuntu server.
here is my code: require 'video_editor/vendor/autoload.php'; use Streaming\Representation; //thsi also throw error and code is not run $ffmpeg = FFMpeg\FFMpeg::create(array( 'ffmpeg.binaries' => ffmpeg_lib, 'ffprobe.binaries' => ffprobe_lib, 'timeout' => 3600, // The timeout for the underlying process 'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use ), null); $ffmpeg_string = ffmpeg_lib; $ffprobe_lib = ffprobe_lib;
$orignalVideoPath = "tmp/1599388321915191545.mp4"; //this is a hardcoded string but in my code the video file is dynamic
$cmd ="$ffprobe_lib -i $orignalVideoPath -show_streams -select_streams a -loglevel error"; exec($cmd,$output); if(count($output)>0) { $video = $ffmpeg->open($orignalVideoPath); $genrateGif = "tmp/".$fileName.".m3u8";
}else { $ffmpeg="ffmpeg is shown error"; }
and error is thrown when I run this code.
Fatal error: Uncaught Error: Call to undefined method FFMpeg\Media\Video::hls() in /path/debugmode_file.php:712 Stack trace: #0 /path/debugmode_file.php(306): ServerStatus() #1 {main} thrown in /path/debugmode_file.php on line 712