- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我看到了this回答,但它有点旧。也许情况发生了变化?
我想使用 ffmpeg 将来自 IP 摄像机的流重新编码为 WebM(VP8 或 VP9)格式。我需要实时速度,但我的 CPU 是 Core i5 (2017) 并且太忙了(平均负载超过 100%)。
我可以购买更适合此类编码任务的硬件吗?
建议实时转码使用 ffmpeg 的哪些参数?
目前我正在使用这个命令(使用覆盖色度键):
./ffmpeg \
-i \
bg.jpg \
-thread_queue_size 512 \
-rtsp_transport tcp -i rtsp://ip_cam:port/stream \
-codec:v libvpx -quality realtime -r 25 -crf 30 \
-b:v 2M -qmin 10 -qmax 50 -maxrate 2.5M -bufsize 5M \
-speed 1 \
-b:v 2M \
-cpu-used 0 -threads 4 \
-auto-alt-ref 0 \
-c:a libopus -b:a 96k \
-filter_complex "[1:v]chromakey=0x70de77:0.1:0.0[ckout];[0:v][ckout]overlay[out]" \
-map "[out]" \
-f webm udp://ip_destination:1935/name/stream
最佳答案
VP8/VP9 的速度/质量选项在 the documentation 中有解释。 .请注意,在 ffmpeg 中,您必须以不同方式指定参数(参见 ffmpeg -h encoder=libvpx-vp9
):
-cpu-used
(旧选项:-speed
)--cpu-used
-deadline realtime
,-deadline good
(旧选项:-quality
)--rt
, --good
-cpu-used
应该是您的主要控制旋钮。虽然默认值为 0
,但文档指出:
Setting
--cpu-used=1
or--cpu-used=2
will give further significant boosts to encode speed, but will start to have a more noticeable impact on quality and may also start to effect the accuracy of the data rate control.Setting a value of 4 or 5 will turn off "rate distortion optimisation" which has a big impact on quality, but also greatly speeds up the encoder.
特别是对于实时编码,您需要设置-deadline realtime
:
--rt
Real-time mode allows the encoder to auto adjust the speed vs. quality trade-off in order to try and hit a particular cpu utilisation target. In this mode the--cpu-used
parameter controls the %cpu target as follows:target cpu utilisation = (100*(16-cpu-used)/16)%
Legal values for
-cpu-used
when combined with--rt
mode are (0-15).It is worth noting that in
--rt
mode the encode quality will depend on how hard a particular clip or section of a clip is and how fast the encoding machine is. In this mode the results will thus vary from machine to machine and even from run to run depending on what else you are doing.
当然,对于 i5 CPU,根据您拥有的并行转码任务数量、您想要达到的质量水平以及最终延迟应该是多少,投资购买最新 Intel i7 系列的强大 CPU有道理。
英特尔的 Kaby Lake 芯片显然通过英特尔 QuickSync 和 ffmpeg 支持硬件辅助编码 supports that through VA-API .
关于video - 使用 ffmpeg 进行慢速 VP8 和 VP9 编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44850269/
这是关于 Espresso 的。我在模拟器上成功运行了集成测试。我认为有些测试失败是因为它运行得太快了。有没有办法降低执行/播放速度? 最佳答案 测试失败不可能导致速度加快。 Espresso 可以将
我在 JQuery 和 JS 中有这样的函数。我有一个带有复选框的 div 列表,并将它们添加到我的列表中。这对于 40 个 div 来说效果很好,但有时我有 2,000 个 div,它会导致 Chr
我们在 Linux 环境上部署了 Websphere 版本 6.1。要打开 https 连接,我们对 java.net.URL 对象调用 openConnection() 和 connect()。 打
我有一个度量的累积总和,结构如下: Aggregate ( { NULL : [Date].[Year - Month - Date].CurrentMember } ,[Measur
我有两个基本表: CREATE TABLE IF NOT EXISTS `users` ( `id` INT(32) NOT NULL auto_increment UNIQUE, `
使用 Canvas 元素,我从一个元素到另一个元素绘制一条线另一个元素是可拖动的,当拖动该元素时,该线会跟随可拖动的元素。 我的问题是渲染速度很慢(Mac PowerBook 上的 Fx 3.5)我想
我有这个网页:http://miloarc.pyrogenicmedia.com/ 哪个atm没什么特别的。它有一些影响,但没有一个让你倾家荡产。 如果您将鼠标悬停在图 block 上,它应该会更改其
我有一个 Collection View ,可以获取我存储的图像并显示它们。但是,当我运行它时,出现内存错误和非常慢/滞后的显示。这是我的代码: var players = ["1", "2", "3
谁能给我一些关于如何让这个运行速度更快的建议? return mb_entities.prospects. FirstOrDefault(x => x.address == pers
我需要读取和处理超过1亿个文件,但我只需要读取每个文件的前4个字节,因为我只需要读取文件头。 我已经创建了一个 .net core 2.2 批处理来处理它们,并且我已经使用多线程来最大化并发处理,但是
我有一张包含用户投票的大表。我尝试了几乎所有关于 INDEX 用法的教程和文章,但在失败之后……将字段作为键的所有可能组合,但查询仍然很慢。 我可以使用任何索引来加快速度吗? (到目前为止,我不会向你
我有一个大型文档,我想为它建立索引以进行单词搜索。 (我听说这种类型的数组真的叫做索引)。目前大约需要 10 分钟。有快速的方法吗?目前我遍历每个段落,如果我找到一个我以前没有遇到过的词,我也会将它添
我尝试将我的数据保存到 MySql(本地数据库)抛出 HibernateTemplate - getHibernateTemplate().execute(new HibernateCallback(
用于涉及复杂查询的数据集分页的一些策略是什么? count(*) 需要大约 1.5 秒,所以我们不想为每个页面 View 访问数据库。目前,此查询返回了约 45k 行。 以下是我考虑过的一些方法: 缓
我有一个 Web 服务器(DMZ 中的 Windows Server 2003)使用 JDBC 连接到 Informix 数据库(在本地网络中的 Windows Server 2012 上运行)。 将
即将推出的 Redis 4 中有异步 UNLINK,但在那之前,有哪些好的替代方案可以在没有阻塞或阻塞最少的情况下实现大型键集的 DELete? 重命名为某个唯一名称后跟 EXPIRE 1 秒是一个好
我有一段 Javascript 代码可以随机更改背景图像并且工作正常,但非常粗糙。我想在图像之间进行某种过渡,我想使用 fadeIn(slow) 但不知道如何将其合并到我的代码中,有人可以帮助我吗?干
我目前正在编写一个操作,作为其中的一部分,检查并递增 orderID 值并在对话中使用它进行响应。 该代码目前可以运行,但部分执行可能需要长达 10 秒的时间才能执行,这可能会使 action-on-
我正在使用 Java 学习 Swing,很早就遇到了让我的组件在窗口中显示的问题。如果我使用以下代码: import javax.swing.*; public class win extends J
好的,所以我的托管公司已经第四次暂停我的帐户了。这让我很烦,因为他们说的代码导致了问题: # Mon Mar 5 11:00:00 2012 # Query_time: 4.028706 Lock
我是一名优秀的程序员,十分优秀!