gpt4 book ai didi

video - ffmpeg 状态和质量/cuda (CPU/GPU)

转载 作者:行者123 更新时间:2023-11-28 21:42:49 25 4
gpt4 key购买 nike

ffmpeg 我做对了吗?

自从我使用 ffmpeg 在我的家庭网络服务器上转换剪辑以来已经过去了很多时间,现在 mp4(h264 和 aac)是当前的总体标准(适用于每个控制台、智能手机、智能电视、个人电脑)我决定转换我从各种数码相机到这个新容器/编解码器的旧剪辑。

  1. 更少的空间和相同的质量。
  2. 兼容性
  3. 支持标签(mac 的 subler)

经过一些研究,由于各种原因我选择了 ffmpeg

  1. 命令行(我用默认设置制作了简单的网络界面,我用 php 的 exec 执行)
  2. 质量/大小数量

我了解到许多昂贵的视频转换软件无法正确处理低比特率视频。我还测试了其中的一些,但我个人找不到合适的导出设置,或者我对结果印象不深……有些具有固定的默认导出设置,但大多数在相同文件大小下的视频质量较低。 ffmpeg 允许我设置 -crf(通常为 18-24)和 -preset(非常慢,快速..)女巫允许我大幅减少文件大小并保持相同看得见的质量。

说 O 在使用预设时非常慢(也有安慰剂,但最终视频文件的大小仅小 1%)。

这是我使用的命令

ffmpeg
-y //overwrite the file if it exists

-i INPUTFILE // replace with the input file

-metadata title=THETITLE // set a nice title, visible on modern devices
-metadata date=THEDATE // set a nice title, visible on modern devices

-c:v libx264 // use the h264 codec
-crf 21 // try different numbers between 18-26
-preset veryslow // placebo,slow,fast,ultrafast==big file
-tune film // tune it a little
-pix_fmt yuv420p // preferred on most modern devices
-profile:v main // preferred on most modern devices
-level 3.1 // preferred on most modern devices
-refs 4 // preferred on most modern devices

-c:a libfdk_aac // use aac
-metadata:s:a language=eng // set a language, visible on modern devices
-b:a 128k // audio bitrate 128k is like mp3 192k
-ar 48000 // 44100 ... whatever
-ac 2 // audiochannels
-movflags +faststart //move the metadata in the front of the video so it loads faster

OUTPUTFILE

一些带有 m2ts 的摄像机剪辑已经有 avc/h264 兼容的编解码器,所以我只是复制流。
有些有 ac3/杜比环绕声音频。我转换音频但保留 ac3 作为映射 ffmpeg 流的第二音轨。这允许我在浏览器和移动设备上观看 mp4,但我能够保持环绕声在某些电视、高级媒体播放器或设备上播放就像苹果电视。

并不是说我对速度(使用四核)不满意,但我最近再次阅读了有关 cuda opencl 的内容,还有一个简单的事实,即我很长时间以来都没有使用 ffmpeg 以外的其他转换器。

ffmpeg(使用我使用的设置)是否是一个很好的转换器,可以保持与源相同的视频质量,减少占用的空间,平均减少 30-40%?

GPU 转换真的那么糟糕吗(cuda .. 测试 gtx970)?通过同时使用 gpu 和 cpu 为转换增加一些速度会很好..但据我所知,它们不能一起工作???并且仅使用 GPU 会造成严重的质量损失……cpu si 更精确,GPU 的计算速度更快,从我读到的内容来看太不精确了……如此昂贵的软件仅将 cuda 用于预览目的……对吗?

ffmpeg或其他软件兼容CPU+GPU编码吗?我真的不记得在哪里,但我读到 ffmpeg 不是一个好的视频转换器。

我对尺寸/质量非常满意,空间平均增加了 30%,没有明显的质量损失。通过一些额外的参数,我可以调整一些以非常糟糕的方式去隔行的非常老的模拟视频。

maybe I could gain more size/quality with another software???

注意:我喜欢 ffmpeg。它是免费的,它有命令行,所以我可以用 php html 和 js 创建我自己的界面,并在各种机器上使用它,而不需要在我使用的每台设备上安装它。我将 idevice 剪辑直接上传到 ffmpeg 服务器。

编辑:

@talonmies ...删除了 cuda 标签:

http://www.nvidia.com/object/cuda_home_new.html

CUDA® is a parallel computing platform and programming model inventedby NVIDIA. It enables dramatic increases in computing performance byharnessing the power of the graphics processing unit (GPU). Withmillions of CUDA-enabled GPUs sold to date, software developers,scientists and researchers are finding broad-ranging uses for GPUcomputing with CUDA. Here are a few examples: - See more at:http://www.nvidia.com/object/cuda_home_new.html#sthash.dEYaqae7.dpuf

cuda 不是理论上的 ffmpeg 库应该支持的编程模型来处理 gtx 970 等 nvidia 卡上的 GPU 编码吗?喜欢 badaboom 软件 http://www.geforce.com/games-applications/pc-applications/badaboom-media-converter .

最佳答案

Is ffmpeg (with the setting i use) a good converter to keep the same video quality than the source reducing the space occupied by and average of 30-40% ?

有许多因素需要考虑,但作为广泛的概括,您可能能够实现“视觉上无损或几乎如此但大多数用户无法分辨,但技术上并非无损”的输出也小于输入。从 ~-crf 18 开始,然后增加它直到达到仍然提供可接受质量的最高值。将该值用于其余的编码。

如果速度太慢,请使用更快的 -preset

参见 FFmpeg Wiki: H.264 Video Encoding Guide了解更多信息。

Is ffmpeg or another software compatible with CPU+GPU encoding?

  • FFmpeg 支持nvenc。得到 NVIDIA Video Coding SDK然后用--enable-nonfree --enable-nvenc编译ffmpeg。当提供类似质量时,它可能比 x264 慢,但如果您的 CPU 已被占用,它可能会有用。

  • x264 可以支持 OpenCL(--opencl 选项)进行前瞻,也许还有其他一些东西,但它可能不值得使用,甚至可能更慢。您只需要尝试一下并进行比较即可;假设您有兼容的硬件。

  • 声称以某种方式使用“(GP)GPU”的编码器通常比普通 x264 更慢和/或质量更低。

i read that the ffmpeg is not a good videoconverter

没有任何理由,这听起来像是一个未经证实的意见。

关于video - ffmpeg 状态和质量/cuda (CPU/GPU),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26721272/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com