如何使用 ffmpeg 对网络和手机视频进行编码
我正在运行一个网站,用户可以在其中上传他们的视频,并且它们都被转码为相同的格式(mp4 atm)。到目前为止,我一直在使用 zencoder(转码即服务)。但我想开始在我自己的服务器上对视频进行转码。
我想知道的是:
- 我应该转码为哪些格式以及视频需要多大尺寸才能在大多数手机上播放?
- 我真的需要 webm 吗?
- CRF 和 VRF 哪个更好?
- 我希望视频具有与原始视频相同的比特率/质量。我可以设置一个最大值吗?
- 如果我想在任何地方播放视频,是否有不应超过的最大比特率?
如果有人愿意写下我需要的命令并解释它们如何工作以及做什么,我将非常感激:)
I'm running a website where users can upload their videos and they are all trancoded to the same format (mp4 a.t.m.). Up until now I've been using zencoder (transcoding as a service). But I want to start transcoding the videos on my own server.
What I would like to know is:
- Which formats should I transcode to and which sizes are needed for the videos to play on most mobile phones?
- Do I actually need webm?
- Which is better: CRF or VRF?
- I would like the videos to have the same bitrate/quality as the originals. Can I set a max?
- Is there a max bitrate I should not exceed if I want to videos to play everywhere?
If someone would be so kind to write down the commands I need and explain how they work and what they do, I would be very thankful :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在另一个问题中发布了一些关于这种情况的好资源,它可以为您指明正确的方向。
在 iPhone 上转换视频
我会使用 h.264,因为它具有出色的压缩比和良好的比特率控制。我会选择最大的可变比特率压缩。对于您的总视频方案,我不会超过 1Mb/s(因此,如果您同时播放 3 个视频,请不要编码高于 300Kb/s),但这是我个人对网络速度的偏好。您必须尝试适合您情况的方法:
I posted some good resources on this situation in another question, it could point you in the right direction.
Convert video on iPhone
I would use h.264 since it has excellent compression ratio and good bitrate control. I would choose a variable bitrate compression with a maximum. I wouldn't exceed 1Mb/s for your total video scheme (so if you have 3 videos playing at once don't encode higher than 300Kb/s), but thats my personal preference for network speed. You'd have to play with what works for your situation: