现在是早上5:30,我被这个视频问题困住了。
之前一切都正常,但现在出现了问题……我尝试更改编码,但仍然不好用……最糟糕的是,当从本地文件运行时它可以工作,但从服务器上就不行(我已经在htaccess添加了文件类型)……
以下是ffmpeg编码:
exec('ffmpeg -i "' .$tmpName. '" -bt 50k -b 250k -ab 56k -ac 2 -s 480x320 -vcodec libx264 -vpre hq -vpre ipod640 -acodec libfaac "upload/' .$newName. '.mp4"');
exec('ffmpeg -i "' .$tmpName. '" -bt 50k -b 250k -ab 56k -ac 2 -s 480x320 -vcodec libvpx -acodec libvorbis -f webm "upload/' .$newName. '.webm"');
exec('ffmpeg -i "' .$tmpName. '" -bt 50k -b 250k -ab 56k -ac 2 -s 480x320 -vcodec libtheora -acodec libvorbis -aq 100 "upload/' .$newName. '.ogv"');
exec('ffmpeg -i "' .$tmpName. '" -bt 50k -b 250k -ab 56k -ac 2 -s 480x320 -vcodec libtheora -acodec libvorbis -aq 100 "upload/' .$newName. '.ogg"');
或者:
exec('ffmpeg -i "' .$tmpName. '" "upload/' .$newName. '.mp4"');
exec('ffmpeg -i "' .$tmpName. '" -vcodec libvpx -acodec libvorbis -f webm -aq 100 "upload/' .$newName. '.webm"');
exec('ffmpeg -i "' .$tmpName. '" -vcodec libtheora -acodec libvorbis -aq 100 "upload/' .$newName. '.ogv"');
exec('ffmpeg -i "' .$tmpName. '" -vcodec libtheora -acodec libvorbis -aq 100 "upload/' .$newName. '.ogg"');
或者:
exec('ffmpeg -i "' .$tmpName. '" "upload/' .$newName. '.mp4"');
exec('ffmpeg -i "' .$tmpName. '" "upload/' .$newName. '.webm"');
exec('ffmpeg -i "' .$tmpName. '" "upload/' .$newName. '.ogv"');
exec('ffmpeg -i "' .$tmpName. '" "upload/' .$newName. '.ogg"');
没有一个文件可以在Chrome中播放得很好...
文件的URL:
http://urthots.com/homepage/upload/9b8a0c1a5af65c92936e3c6806181ec3.ogv
http://urthots.com/homepage/upload/9b8a0c1a5af65c92936e3c6806181ec3.ogg
http://urthots.com/homepage/upload/9b8a0c1a5af65c92936e3c6806181ec3.webm
http://urthots.com/homepage/upload/f41355af09218d660a5d78a4012a7177.mp4
视频元素:
<video poster="http://urthots.com/homepage/upload/images/xxx.jpg" >
<source src="http://urthots.com/homepage/upload/xxx.mp4" type="video/mp4" />
<source src="http://urthots.com/homepage/upload/xxx.webm" type="video/webm" />
<source src="http://urthots.com/homepage/upload/xxx.ogv" type="video/ogg; codecs=theora,vorbis" />
<source src="http://urthots.com/homepage/upload/xxx.ogg" type="video/ogg; codecs=theora,vorbis" />
</video>
什么可能导致这种情况? 我尝试了所有的方法,包括更改编码、HTML元素以及htaccess文件,我还尝试使用其他网站上的视频,它们都能正常工作... 我不知道问题出在哪里... 请有人帮忙解决...