EC2 用于视频编码
我有一份潜在的工作,需要我使用 FFMPEG 和 x264 进行一些视频编码。我将拥有一系列需要编码一次的文件,然后我就能够关闭这些实例。由于我不太确定 x264 和 FFMPEG 的资源利用率,我应该获得什么样的实例?我想要么
高CPU超大实例
7 GB 内存
20 个 EC2 计算单元(8 个虚拟核心,每个虚拟核心有 2.5 个 EC2 计算单元)
1690 GB 实例存储
64位平台
I/O 性能:高
API名称:c1.xlarge
或
集群GPU四倍超大实例
22 GB 内存
33.5 个 EC2 计算单元(2 个 Intel Xeon X5570,四核“Nehalem”架构)
2 个 NVIDIA Tesla“Fermi”M2050 GPU
1690 GB 实例存储
64位平台
I/O 性能:非常高(10 Gb 以太网)
API名称:cg1.4xlarge
我应该使用什么? x264/FFMPEG 是否使用更快/更多的 CPU 表现更好,还是对 GPU 的影响更大?无论如何,集群 GPU 似乎是性能更高的实例。我应该选择什么?
I have a potential job which will require me to do some video encoding with FFMPEG and x264. I'll have a series of files which I'll need to encode once, then I'll be able to bring down the instances. Since I'm not really sure of the resource utilization of x264 and FFMPEG, what kind of instances should I get? I'm thinking either a
High-CPU Extra Large Instance
7 GB of memory
20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each)
1690 GB of instance storage
64-bit platform
I/O Performance: High
API name: c1.xlarge
or, alternatively a
Cluster GPU Quadruple Extra Large Instance
22 GB of memory
33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core “Nehalem” architecture)
2 x NVIDIA Tesla “Fermi” M2050 GPUs
1690 GB of instance storage
64-bit platform
I/O Performance: Very High (10 Gigabit Ethernet)
API name: cg1.4xlarge
What should I use? Does x264/FFMPEG perform better with faster/more CPUs or does it really pound the GPU more? In any case, it seems that the Cluster GPU seems to be the higher performance instance. What should I prefer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Ffmpeg 最近添加了对 VAAPI 和 VDPAU 的支持,但这使其只能使用 GPU 来解码 H.264 视频。对于编码,它使用CPU。
Ffmpeg recently added support for VAAPI and VDPAU, but this allows it to use the GPU only for decoding of H.264 video. For encoding, it uses the CPU.
CPU/GPU 的简短答案是,这取决于您如何使用
ffmpeg
进行 H264 编码。另外,您混淆了 H264 和 x264。 H264 是视频编解码器标准,x264 是 H264 标准的一种实现。 x264 如此流行,因此有时它已成为 H264 的同义词并与 H264 混淆。我指出的原因是 x264 是 H264 的基于软件的实现,这意味着它只会将 CPU 核心用于所有进程。当您使用 x264 进行视频编码时,您的用例中将不会使用 GPU。
话虽这么说,也许您想问的是是否要选择
每种实现都有多种可用的实现。 。 Ffmpeg 已经在这个上有一个很好的页面。如果您计划使用 Nvidia GPU 实例,则需要 使用 NVENC 支持编译 FFmpeg 以获得硬件实现。使用 GPU/CPU 高效地完成所有转码过程本身就是一门艺术。
所以简而言之,x264不会使用GPU。如果要使用 GPU,则需要使用编码器的硬件实现。哪种实现更好很大程度上取决于您的用例和您关心的内容(质量、成本、周转时间等)
我的背景/免责声明:我在 Bitmovin。我们解决了这个“集群/资源”分配工程问题以及许多其他问题,以从给定的比特率中提取最佳的视频质量。最后,我们提供 API,您只需将它们插入您的工作流程即可。这里表达的观点是我自己的。
The short answer to CPU/GPU is, it depends on how you use
ffmpeg
to do the H264 encoding.Also, you are confusing the H264 and x264. H264 is the video codec standard and x264 is one implementation of H264 standard. x264 is so popular, so sometimes it has become synonymous and confused with H264. The reason that I point that out is x264 is a software-based implementation of H264, which means it will only use the CPU cores for all the processes. There will be no GPU usage in your use case when you use x264 for video encoding.
That being said, maybe what you are trying to ask is whether to go for
There are several implementations available for each available. Ffmpeg already has a nice page on this. If you are planning to use the Nvidia GPU instances, then you would need to compile FFmpeg with NVENC support to get the hardware implementation. Using GPUs/CPUs to efficiently do all your transcoding process is an art itself.
So in short, x264 will not use GPU. If you want to use GPU, you need to use hardware implementations of the encoders. Which implementation is better largely depends upon your use case and what you care about (quality, cost, turnaround time, etc.)
My background/ Disclaimer: I work as a Senior Engineer at Bitmovin. We solve this "cluster/resource" allocation engineering problem, among many many many other problems, to extract the best possible video quality out of a given bitrate. And in the end, we offer APIs where you can just simply plug them into your workflow. The views expressed here are my own.
目前,Amazon EC2 使用现代 NVIDIA GPU 提供(一些)GPU 加速实例,这意味着您可以在它们上利用 NVENC。
In the present, Amazon EC2 offers (some) GPU accelerated instances using modern NVIDIA GPUs, meaning that you can take advantage of NVENC on them.
您可能最好使用像 zencoder.com 这样的服务,他们有一个优秀的 API,您从中获得的质量很可能比花几个小时摆弄 Ffmpeg 参数优化要好。
You are probably better off using a service like zencoder.com, they have an excellent API and the quality you will get out of it will most probably be better than hours of fiddling with Ffmpeg parameters optimisation.