I can't send hls
video. aws-sdk-php mp4
video working well but hls
videos only send .m3u8
file all .ts
file come in local storage
Here my actual code. Submit-ffmpeg.php:
$ffmpeg_b = $pt->config->ffmpeg_binary_file;
$filepath = explode('.', $_POST['video-location'])[0];
$time = time();
$full_dir = str_replace('ajax', '/', __DIR__);
$structure = $filepath;
if (!mkdir($structure, 0777, true)) {
die('Failed to create folders...');
}
$hls_link = $structure . "/_360p_converted.m3u8";
$video_file_full_path = $full_dir . $_POST['videolocation'];
$shell = shell_exec("$ffmpeg_b -y -i $video_file_full_path -vcodec copy -acodec copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls $hls_link 2>&1");
$upload_s3 = PT_UploadToS3($filepath . "/_360p_converted.m3u8");
$db->where('id', $insert);
$db->update(T_VIDEOS, array(
'converted' => 1,
'360p' => 1,
'video_location' => $filepath . "/_360p_converted.m3u8"
));
function.php the sent file in aws-sdk-php
$s3->putObject([
'Bucket' => $pt->config->s3_bucket_name,
'Key' => $filename,
'Body' => fopen($filename, 'r+'),
'ACL' => 'public-read',
]);