我用这个命令对我的视频进行了编码。
$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 -->'它不适用于我的视频编码,但我尝试的视频不编码它工作。
视频维数:853x840编解码器: H.264帧:每秒30帧,408 kbps 音频编解码器: MPEG-4 AAC信道:标准采样率: 44100 Hz์比特率: N/A
具有函数读取文件的Readfile.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);
?>谢谢
发布于 2013-12-23 14:07:57
下:
file: "$video_file", 添加:
type: "mp4",https://stackoverflow.com/questions/20737116
复制相似问题