我无法发送hls
视频。 aws-sdk-php mp4
视频效果不错但hls
个视频仅发送.m3u8
个文件.ts
文件local storage
这是我的实际代码。提交-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 aws-sdk-php中发送的文件
$s3->putObject([
'Bucket' => $pt->config->s3_bucket_name,
'Key' => $filename,
'Body' => fopen($filename, 'r+'),
'ACL' => 'public-read',
]);