对HTML 5 preparing MP4文件 [英] preparing mp4 file for html 5

查看:230
本文介绍了对HTML 5 preparing MP4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HTML 5,我希望嵌入MP4这样的:

In html 5, I want to embed an mp4 like this:

<video width="640" height="480" controls>
    <source src="somefile.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>

该视频在我的机器运行正常的浏览器,但该文件是因为它被记录在全高清的500MB。 如何我下采样的文件,以便它是大约50MB,具有更小的视频,但相同的音质,并且仍然能够使用上面所示的HTML5视频标签的浏览器中玩?

我使用Windows。我一直在使用 FlashIntegro ,但它把文件转换为AVI格式,不能使用视频标签浏览HTML 5我想要一个MP4格式我可以发布使用HTML 5视频标签,我想使用免费的软件。

I am using Windows. I have been using FlashIntegro, but it converts the files to avi format, which cannot be viewed using the video tags in html 5. I want an mp4 format I can publish using the video tags in html 5. I would like to use free software.

我不希望使用闪光灯或Adobe创意云,但我将这些标签找到观众谁可能了解的替代品。

I do not want to use flash or adobe creative cloud, but I am adding those tags to find viewers who might know about free alternatives.

推荐答案

我建议像的ffmpeg ,如果你从一个500MB的文件中去,虽然会设置质量的期望到50MB一 - 虽然很大程度上将取决于优化的量已经$源P中$ psent ......我能得到一个270MB的文件到29MB,而无需使用下列质量的明显损失:

I would suggest something like ffmpeg, though would set expectations on quality if you go from a 500mb file to a 50mb one - though a lot will depend on the amount of optimization already present in the source... I was able to get a 270Mb file down to 29Mb without visible loss of quality using the following:

./ffmpeg -y -i SourceFile.mp4 -s 1280x720 -c:v libx264 -b 3M -strict -2 -movflags faststart DestFile.mp4

以上会给你一个1280×720的输出,在3Mbps的在MO4容器使用H264,并且还将做第二遍的 MOOV 元素移动到前面使它文件开始流得更快。它不会重新连接code中的音频,以便将让你开始使用任何优质

The above will give you a 1280x720 output, at 3Mbps using h264 in the mo4 container, and will also do a second pass to move the moov element to the front of the file enabling it to start streaming faster. It will not re-encode the audio so will keep whatever quality you started with

您可能想要玩的框架尺寸和比特率来获得文件大小来匹配你喜欢什么/需要

You may want to play around with the framesize and the bitrate to get the filesize to match what you like/need

这篇关于对HTML 5 preparing MP4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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