FFMPEG命令行压缩MP4文件时不使用GPU

发布于 2025-01-20 23:50:14 字数 1181 浏览 3 评论 0原文

嘿,我一直在研究一个很好的命令行字符串,用于我的电影,我想将其大小修剪到至少当前大小的一半。

我的 GPU 和计算机系统的手刹信息是这样的:

HandBrake 1.5.1 (2022011000)
OS: Microsoft Windows NT 10.0.19043.0
CPU: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz (12 Cores, 24 Threads)
Ram: 40940 MB, 
GPU Information:
  Microsoft Remote Display Adapter - 10.0.19041.662
  NVIDIA Tesla K10 - 30.0.14.7141
  NVIDIA Tesla K10 - 30.0.14.7141
  Microsoft Basic Display Adapter - 10.0.19041.868

当我最初制作命令行时,我只是用它来将文件复制到需要的位置,如下所示:

ffmpeg -y -hide_banner -线程 8 -hwaccel cuda -hwaccel_device 1 -hwaccel_output_format cuda -v verbose -i "c:\testingvids\AEON FLUX 2005.mp4" -c:v h264_cuvid -gpu:v 1 -preset Slow -c copy "c:\testingvids\AEON FLUX 2005 nvidia.mp4"< /p>

这个产生了 828 倍的处理速度:

在此处输入图像描述

但是对于获取相同的文件并压缩它,我似乎只能获得约 8 倍的速度?

输入图片这里的描述

所以这是一个很大的区别。我是否使用正确的语法,仅使用我的 GPU 使用 h264 nvenc 转换/压缩 mp4?

Hey all I have been working on a good command line string to use for my movies that I would like to trim the size down to at least half the current size.

My handbrake information regaurding my GPU and computer system is this:

HandBrake 1.5.1 (2022011000)
OS: Microsoft Windows NT 10.0.19043.0
CPU: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz (12 Cores, 24 Threads)
Ram: 40940 MB, 
GPU Information:
  Microsoft Remote Display Adapter - 10.0.19041.662
  NVIDIA Tesla K10 - 30.0.14.7141
  NVIDIA Tesla K10 - 30.0.14.7141
  Microsoft Basic Display Adapter - 10.0.19041.868

When I originally made a command line, I was just using it to copy the file over to where it needed to go with the following:

ffmpeg -y -hide_banner -threads 8 -hwaccel cuda -hwaccel_device 1
-hwaccel_output_format cuda -v verbose -i "c:\testingvids\AEON FLUX 2005.mp4" -c:v h264_cuvid -gpu:v 1 -preset slow -c copy "c:\testingvids\AEON FLUX 2005 nvidia.mp4"

This produced a 828x processing speed:

enter image description here

But for taking that same file and compressing it I seem to only get a ~8x speed?

enter image description here

So that is quite a difference there. Am I using the correct syntax for it to only use my GPU to convert/compress the mp4 with the h264 nvenc?

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

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

发布评论

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

评论(1

一刻暧昧 2025-01-27 23:50:14

IMO,其性能几乎达到您对 10 年旧 GPU 的期望。如果您检查此链接并仅显示“GK104 - Kepler”的结果(第一代)”,性能约为 5 fps。 Tesla K10 内置 x2 GK104,因此大约将 10 fps(减去缩放损失)的两倍即可获得您所获得的数字。

此外,您应该将 GPU 性能与可比较的 CPU 编码性能进行比较,而不是复制。使用 -c:v libx264(这是 MP4 的默认编码器)运行 FFmpeg,并找出您的双 CPU 运行的 FPS 类型。然后,选择两者中更强大的一个。

旁注:我发现我的旧低端 GPU(2014 年左右的 GTX 750 Ti)与更新的中端 Ryzen 3600 CPU(2020 年)相比无法进行视频编码。因此,当您的系统像我一样不平衡时,GPU 的编码速度并不总是比 CPU 快。

IMO, the performance is pretty much what you'd expect from a 10-year-old GPU. If you check this link and show only the results of "GK104 - Kepler (1st Gen)" and the performance is around 5 fps. Tesla K10 has x2 GK104 onboard, so roughly double that figure 10 fps (minus the scaling loss) gets you the number you are getting.

Also, you should compare the GPU performance to a comparable CPU encoding performance and not copying. Run FFmpeg with -c:v libx264 (which is the default encoder for MP4) and find out what kind of FPS your dual CPUs run at. Then, pick the more powerful of the two.

Side note: I found out my old low-end GPU (GTX 750 Ti from around 2014) has no business encoding videos over a more recent mid-range Ryzen 3600 CPU (2020). So, GPU does not always encode faster than CPU when your system is unbalanced like mine.

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