用于将 HTML5 视频转换为 mp4 和 ogg 的 ffmpeg 设置

发布于 2024-09-06 21:22:34 字数 1459 浏览 2 评论 0原文

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

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

发布评论

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

评论(1

所有深爱都是秘密 2024-09-13 21:22:34

我最终使用了 ffmpegffmpeg2theora

WebKit 兼容的 h.264 视频

我决定使用 ipod640 预设,因为这意味着可以在 iPhone 或 iPod touch 上很好地观看视频。当然,您可以稍微更改一下设置,去掉“-vpre ipod640”,更改分辨率或质量。无论如何,命令是:

ffmpeg -i video_source_file.ext -vcodec libx264 -vpre ipod640 -b 250k -bt 50k -acodec libfaac -ab 56k -ac 2 -s 480x320 video_out_file.mp4

将一些信息移动到文件前面,以便视频可以在加载之前播放

qt-faststart video_out_file.mp4 video_out_file_quickstart.mp4

Firefox 兼容 Ogg 视频

这取决于您是否安装了 ffmpeg2theora。另外,我只用输入文件作为之前 ffmpeg 转换的输出文件进行了测试。命令为:

ffmpeg2theora -o video_out_file.ogv video_out_file.mp4

I ended up using ffmpeg and ffmpeg2theora.

WebKit compatible h.264 video

I decided to go for the ipod640 preset because it means the video can be viewed nicely on an iPhone or iPod touch. Of course, you can change the settings around a bit, get rid of the '-vpre ipod640', change the resolution or quality. Anyway the command is:

ffmpeg -i video_source_file.ext -vcodec libx264 -vpre ipod640 -b 250k -bt 50k -acodec libfaac -ab 56k -ac 2 -s 480x320 video_out_file.mp4

move some information to the front of the file so the video can play before it loads

qt-faststart video_out_file.mp4 video_out_file_quickstart.mp4

Firefox compatible Ogg video

This depends on you having ffmpeg2theora installed. Also, I have only tested it with the input file being the output file from the previous ffmpeg conversion. The command is:

ffmpeg2theora -o video_out_file.ogv video_out_file.mp4

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