Open sandyh90 opened 1 year ago
Please post your code that involve DynamicHLSPlaylist
class.
Maybe this solve https://github.com/protonemedia/laravel-ffmpeg/pull/466
@SadeghPM i don't have any other code that involve with DynamicHLSPlaylist
class only this basic code have relation with that class.
$withoutFileExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $getVideoData->video_file);
$format = new X264('aac', 'libx264');
$format->setAdditionalParameters(['-c:v', 'h264_amf']);
$lowBitrate = ($format)->setKiloBitrate(250);
$midBitrate = ($format)->setKiloBitrate(500);
$highBitrate = ($format)->setKiloBitrate(1000);
FFMpeg::fromDisk('public')
->open("video/{$getVideoData->folder_video}/{$getVideoData->video_file}")
->exportForHLS()
->addFormat($lowBitrate)
->addFormat($midBitrate)
->addFormat($highBitrate)
->save("{$withoutFileExt}.m3u8");
Ok I will try your pull request code hopefully it will work normally, thanks for letting me know.
@sandyh90 make sure the the video is residing in your storage folder
if you're using local, it's on
storage/app/public/video/{$getVideoData->folder_video}/{$getVideoData->video_file}
make sure that it's existing there.
if not, then try to run the command php artisan storage:link
as I can see you're using the public
key
Nothing is wrong with the current setup
$storageLocation = $this->isLocalStorage ? 'public/'.$location : $location;
$toLocation = $this->isLocalStorage ? "public/temp/collections/$track->uuid/".$track->uuid.'.m3u8' : "collections/$track->uuid/$track->uuid.m3u8";
$low = (new X264)->setAudioKiloBitrate(96);
$med = (new X264)->setAudioKiloBitrate(128);
$high = (new X264)->setAudioKiloBitrate(256);
$ultra = (new X264)->setAudioKiloBitrate(320);
FFMpeg::fromDisk(config('filesystems.default'))
->open($storageLocation) // MP3 file
->exportForHLS()
->addFormat($low)
->addFormat($med)
->addFormat($high)
->addFormat($ultra)
->setSegmentLength(10)
->save($toLocation); //m3u8
this is what I have on my setup.
@aronquiray yup but i have tried thing others like run php artisan storage:link
command and check if the folder exists or not but nothing worked it just failed to save master playlist but to save playlist for quality selector works fine without problem
Hi,
I have a problem while starting to encode my video using this package because
DynamicHLSPlaylist::parseLines()
value always return null did i do something wrong?and this is my code and debug output.
Code
Output
while i trace the error where caught in this method