我已经使用 html 在 PHP 中对视频进行了编码,现在我想将其解码并保存在 php 中。但我不知道如何保存编码的视频以及如何获取它进行解码。请帮帮我,我在这里附上我的代码
<html>
<video controls>
<source type="video/mp4" src="<?php echo getEncodedVideoString('mp4','add.mp4');?>">
</video>
</html>
<?php
include("connect.php");
function getEncodedVideoString($type, $file) {
$filename= 'data:video/' . $type . ';base64,' . base64_encode(file_get_contents($file));
echo $filename;
?>