gpt4 book ai didi

php - 如何为 jw 播放器脚本编码 ffmpeg,该脚本读取传递 php 文件?

转载 作者:行者123 更新时间:2023-12-04 23:04:23 25 4
gpt4 key购买 nike

我已经使用这个命令对我的视频进行了编码。

$encode_comand="ffmpeg -i  $input_path -ac 1 -ab 128k -y -vcodec libx264 -vpre ultrafast -g 30 -r 30 -crf 22 $target_path &";

exec($encode_comand);

它适用于下面的脚本
    echo '<!-- START OF THE PLAYER EMBEDDING TO COPY-PASTE -->
<div id="mediaplayer'."11111".'" style="margin:0px auto; text-align:center; width:auto; display:blog;" class="vdoplayer">JW Player goes here</div>
<script type="text/javascript" src="jwplayer/jwplayer.js"></script>
<script type="text/javascript">jwplayer.key="OOD7GkWbyNXOL6MbstF2Sa/YrQPgtNUPqxm5NA==";</script>
<script type="text/javascript">
jwplayer("mediaplayer'."11111".'").setup({
flashplayer: "jwplayer/jwplayer.flash.swf",
file: "$video_file",
width: "'.$width.'",
height: "'.$height.'",
stretching: "uniform",
type: "mp4",
skin: "jwplayer/jwplayer-skins-free/six.xml",

});
</script>
<!-- END OF THE PLAYER EMBEDDING -->'
//$video_file="http://myhost.com/project/files/1/video/file3.mp4";

但是在我更改脚本之后
echo '<!-- START OF THE PLAYER EMBEDDING TO COPY-PASTE -->
<div id="mediaplayer'."11111".'" style="margin:0px auto; text-align:center; width:auto; display:blog;" class="vdoplayer">JW Player goes here</div>
<script type="text/javascript" src="jwplayer/jwplayer.js"></script>
<script type="text/javascript">jwplayer.key="OOD7GkWbyNXOL6MbstF2Sa/YrQPgtNUPqxm5NA==";</script>
<script type="text/javascript">
jwplayer("mediaplayer'."11111".'").setup({
flashplayer: "jwplayer/jwplayer.flash.swf",
file: "readfile.php",
width: "'.$width.'",
height: "'.$height.'",
stretching: "uniform",
type: "mp4",
skin: "jwplayer/jwplayer-skins-free/six.xml",
abouttext: "project",
aboutlink: "project",
});
</script>
<!-- END OF THE PLAYER EMBEDDING -->'

它不适用于我的视频编码,但我尝试了不对其进行编码的视频。

视频
尺寸:853 x 840
编解码器:H.264
帧率:每秒 30 帧
比特率 408 kbps
音频
编解码器:MPEG-4 AAC
channel :立体声
采样率:44100 Hz ์
比特率:不适用

读取文件.php 具有读取文件功能的
<?php 
$filename= 'http://www.longtailvideo.com/jw/upload/bunny.mp4'; //can read
$video_file = "http://myhost.com/project/files/1/video/file3.mp4";
//cannot read Same file as script below

if (file_exists($video_file)) { ob_clean(); flush(); };
header('Content-Type: video/mp4');
header('Content-Disposition: attachment;filename=file.mp4');
readfile($video_file);
?>

谢谢

最佳答案

在下面:

file: "$video_file", 

添加:
type: "mp4",

关于php - 如何为 jw 播放器脚本编码 ffmpeg,该脚本读取传递 php 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20737116/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com