如何播放H264视频? [英] How do i play H264 video?

查看:653
本文介绍了如何播放H264视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从相机收到了以下视频文件(从安全摄像机)
http://dl.dropbox.com/u/1369478/tmw/recording.264

I have received the following video file from a camera (from security camera) http://dl.dropbox.com/u/1369478/tmw/recording.264

我怎样才能查看内容?基于扩展我认为这是一个H264文件。有没有玩这个与HTML5浏览器的方法吗?

How can i view the content? Based on extension i think that is a H264 file. Is there a way to play this on the browser with HTML5?

问候

推荐答案

嗯..从它的外观看起来并不像一个H264文件。

Hmm.. From the looks of it it doesn't look like a H264 file..

通过MediaInfo运行它,我得到这个:

Running it through MediaInfo, I got this:

视频搜索
  格式:AVC结果
  格式/信息:高级视频codeC结果
  格式简介:Baseline@L2.0结果
  格式设置,CABAC:无结果
  格式设置,ReFrames:1帧结果
  宽度:352像素结果
  高度:288像素结果
  显示宽高比:1.222结果
  分辨率:24位结果
  比色法:4:2:0结果
  扫描类型:进

Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L2.0
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Width : 352 pixels
Height : 288 pixels
Display aspect ratio : 1.222
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive

除了这一切,你要知道,并不是所有的浏览器都支持在&lt H264;视频>元素..他们中的一些决定举行对OGG格式,所以它不是真的是随处可见:•

Apart from it all, you have to know that not all browsers support H264 in the <video> element.. Some of them decided to hold on to ogg, so it's not really going to be available everywhere :S

下面是表明H264视频系统只有Chrome和Safari支持的表:的 http://www.findmebyip.com/litmus#html5-video-$c$ccs

Here's a table that shows that H264 video os only supported by Chrome and Safari: http://www.findmebyip.com/litmus#html5-video-codecs

在任何情况下,如果你得到一个视频文件,并且要嵌入在浏览器中,你知道,你会从一个兼容的浏览器访问它(或者如果你H264和Ogg版本),你可以使用这样的:

In any case, if you do get a video file, and you want to embed it in a browser, and you know that you'll access it from a compatible browser (or if you get H264 AND ogg versions), you can use this:

<video src="http://link/to/video/file" controls="controls" width="500"></video>

或者,如果你有多种格式:

Or if you have multiple formats:

<video controls="controls" width="500">
    <!-- if Firefox -->
    <source src="video.ogg" type="video/ogg" />
    <!-- if Safari/Chrome-->
    <source src="video.mp4" type="video/mp4" />
</video>

看看这个链接更多的例子,以及如何添加闪存/平面图像后备对于不支持的浏览器
<一href=\"http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-html-5-video-with-a-fallback-to-flash/\" rel=\"nofollow\">http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-html-5-video-with-a-fallback-to-flash/

UPD:我的理解,你主持了有一个例子,不是说你想在你的网页的实际文件的文件..你拥有的文件有有一个单帧,所以它可能是一个JPEG图像,它也就没有什么区别:p

UPD: As I understood, the file that you hosted up there is an example, not the actual file that you want to have in your page.. The file you have there has a single frame, so it might be a jpeg image, and it would make no difference :P

如果你有相同格式的实际的视频文件,你可以尝试使用上面的代码片段注入它的页面。如果浏览器咳嗽起来,不希望发挥它(记得Chrome或Safari来检查它),那么你可以转换使用免费的连接在网络上codeRS的一个文件。例如,我一直在使用免费的 H.264连接codeR 转换了我的视频文件到H.264:)

If you DO have an actual video file with the same format, you might try to inject it in the page using the snippets above. If the browser coughs it up, and doesn't want to play it (remember to check it with Chrome or Safari), then you can just convert the file using one of the free encoders on the net. For example, I've been using the free H.264 encoder to convert my video files to H.264 :)

祝你好运!

UPD2:我居然拿了和连接codeD文件...文件大小从1.766MB下降到34KB。这是同样的视频,1架,大小相同... ...但1帧的视频循环播放的〜30秒:)
所以,我看到一个长30秒的背景有..我想你真的应该EN code中的文件,即使它在H.264不已,因为电脑会连接code视频文件好了很多,而你敢打赌(几乎)相同的图像质量,以更小的文件大小。

UPD2: I actually took and encoded the file... The file size dropped from 1.766MB to 34KB. It's the same video, 1 frame, same size... but the 1 frame in the video is looped for ~30 seconds :) So I see a long 30 sec background there.. I guess you really SHOULD encode the file, even if it's in H.264 already, because the computer will encode video files a LOT better, and you'll bet (almost) the same picture quality, with a much smaller file size.

这篇关于如何播放H264视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆