网站视频编码

发布于 2024-09-28 11:24:09 字数 224 浏览 0 评论 0原文

我对在网站上嵌入视频有点陌生。最好的方法是什么?我刚刚开始阅读它。

我读到我应该使用 HTML5 和浏览器的本机播放器。 -- 有谁知道有一个 JavaScript 库可以使用浏览器的播放器并检测浏览器是否不使用 HTML5 来降级到 Flash 播放器?

就编码而言,最好的方法是什么?我计划编写一个小控制台应用程序来使用 FFMPEG 来转换视频。但我应该使用什么编码?听说 H.264 有前途?但

I am a little new to embedding videos on a website. What is the best way to go about it? I just started reading up on it.

I read that I should use HTML5 and the browser's native player. -- Does anyone know of a javascript library that will use the browser's player and detect if the browser is not using HTML5 to downgrade to a flash player?

As far as encoding what is the best approach? I am planning on writing a little console app to use FFMPEG to convert the videos. But what encoding should I use? I heard H.264 is promising? But

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

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

发布评论

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

评论(4

林空鹿饮溪 2024-10-05 11:24:09

这就是您要寻找的内容: http://videojs.com/

明智的编码,我认为 H.264 < em>和 WebM 是一个明智的选择。这样您就可以满足所有现代浏览器和移动设备(包括 iOS 和 Android)的要求,并且对于较旧的 HTML5 之前的浏览器(以及仅支持 Theora 的 FF 3.6),只能回退到 Flash。

This is what you're looking for: http://videojs.com/

Encoding wise, I think H.264 and WebM is a wise choice. That way you'll satisfy all modern browsers and mobile devices (incl. iOS and Android), and only fall back to Flash for older, pre-HTML5 browsers (and FF 3.6, which only supports Theora.)

心如荒岛 2024-10-05 11:24:09

DIY 方法是使用 Video For Every 嵌入代码。这将导致 HTML5 视频和 Flash 的回退。
然后对于视频编码,你可以像你说的那样使用FFmpeg。

为了让您的生活更轻松,您应该查看适用于您的 HTML5 视频播放器的 VideoJS。它处理许多跨浏览器问题和一些浏览器尚不支持的额外功能。
对于视频编码,如果您打算专门使用 FFmpeg 进行自动编码,则应查看 Zencoder 的视频编码 API。它可以为您节省一些设置时间并解决兼容性问题。

对于编解码器,#1 优先级应该是 h.264,特别是使用基线配置文件,以便它可以在智能手机上运行。之后ogg和webm都是不错的选择。 WebM 的文件大小质量更高,但 Ogg 可以被更多用户查看,因为旧版本的 Firefox 支持它。需要注意的是,如果您只使用 h.264,Video For Every 代码将不会在 Firefox 和 Opera(不支持 h.264)中回退到 Flash,因此您需要使用像 VideoJS 这样的播放器。

The DIY approach would be to use the Video For Everybody embed code. That will lead with HTML5 video and fallback to flash.
Then for video encoding, you can use FFmpeg like you said.

To make your life easier, you should check out VideoJS for your HTML5 video player. It handles a lot of cross browser issues and some extra features that browsers don't support yet.
For video encoding, if you're planning to use FFmpeg specifically for automating encoding, you should check out Zencoder's video encoding API. It could save you some set up time and compatibility issues.

For codecs, #1 priority should be h.264, specifically using the baseline profile so it will work on smartphones. After that, ogg and webm are both good choices. WebM is higher quality for file size, but Ogg can be viewed by way more users because older version of Firefox support it. And just to note, if you only do h.264, the Video For Everybody code won't fallback to Flash in Firefox and Opera (that don't support h.264) so you'll need to use a player like VideoJS.

清风无影 2024-10-05 11:24:09

使用 Handbrake 进行视频编码,尤其是 HTML 5 支持。

HTML 5 是一种很棒的嵌入视频的方式,但它尚未标准化。如果您支持iOS设备,您肯定想使用它,因为它们当然不支持Flash,而Flash是嵌入视频的最主流方式。

HTML5 非常棒,因为它就是这么简单:

<video src="video.m4v" />

这是一个很棒的链接,您会发现它很有用:
http://www.robwalshonline.com/帖子/tutorial-serving-html5-video-cross-browser-include-ipad/

Use Handbrake for video encoding, especially for HTML 5 support.

HTML 5 is an awesome way of embedding video, however it hasn't been standardized yet. You definitely want to use it if you're supporting iOS devices, as they of course don't support Flash which is the most mainstream way of embedding video.

HTML5 is pretty awesome because this is how simple it is:

<video src="video.m4v" />

Here is a fantastic link you will find useful:
http://www.robwalshonline.com/posts/tutorial-serving-html5-video-cross-browser-including-ipad/

浅唱々樱花落 2024-10-05 11:24:09

我读到我应该使用 HTML5 并且
浏览器的原生播放器

哪个白痴告诉你的?考虑到您将失去很大一部分客户群,您要么运行 HTML 5 浏览器的单一文化,谁说应该在麦当劳提供汉堡,而不是向人们提供建议。 HTML 5 和集成播放器很不错,但对于普通大众来说还不够。几年后,是的。现在,如果我聘请一家网络公司将视频放在网站上,而他们这样做了,他们就会因严重疏忽和无能而被起诉。

如今,播放主要采用闪存——具有很高的普及率。 YouTube 等网站目前也使用 Flash 视频播放器。如果你追求更少(渗透),Silverlight 非常好,并且拥有完整的后端基础设施。

我听说 H.264 很有前途?

所以呢?首先,您需要修复播放方面,然后根据您的播放决定,使用最有效的任何格式。

I read that I should use HTML5 and the
browser's native player

Which idiot told you that? Given that you will loose out on a significant portion of the client population you either run a monoculture of HTML 5 browsers, of whoever said that should be serving burgers at McDonalds, not give advice to people. HTML 5 and the integrated player are nice, but not there yet for the general public. In a couple of years, yes. Now - if I hire a web company for putting videos on a website and they do that, they get sued for gross neglect and incompetence.

Today, playback is mostly flash - that has a high penetration. A flash video player is also what sites like youtube currently use. If you go for less (penetration), Silverlight is very good and has the complete backend infrastructure.

I heard H.264 is promising?

So what? FIRST you need to fix the playback side, then you use whatever format is most efficient given your playback decision.

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