html5 视频在 Chrome 和 Opera 中崩溃,但在 Firefox 中工作正常

发布于 2024-11-08 11:06:36 字数 2495 浏览 0 评论 0原文

现在是凌晨 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 更改,我尝试使用其他网站的视频,它们工作正常...... 我不知道出了什么问题...

有人可以帮忙吗...

It's 5:30AM and I'm stuck with this video problem.

I had it all working before, and now, it has problems...
I try to change encoding, but it's still not good... Worst part is that it works when it's runned from local file, but won't from server ( I add file types in htaccess )...

Here is the ffmpeg encoding:

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"');

or:

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"');

or:

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"');

Nothing create good enough file to play in Chrome...

URL of file(s):

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 element:

<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>

What can cause this?
I tried everything, encoding changing, HTML element changing, htaccess changing, I tried with videos from other sites, and they are working okay...
I have no idea what is problem...

Can someone please help...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘你却要生生世世 2024-11-15 11:06:37

我认为这是服务器端的编解码器问题。您需要为每个浏览器提供特定的视频格式和编解码器。希望这可以帮助您:http://html5video.org/

I believe is a codecs issue from the server side. You need to serve each browser with a particulary video format and codecs. Hope this can help you out: http://html5video.org/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文