通过运行 ffmpeg -h encoder=apng
,我明白了:
APNG encoder AVOptions:
-dpi <int> E..V..... Set image resolution (in dots per inch) (from 0 to 65536) (default 0)
-dpm <int> E..V..... Set image resolution (in dots per meter) (from 0 to 65536) (default 0)
-pred <int> E..V..... Prediction method (from 0 to 5) (default none)
none E..V.....
sub E..V.....
up E..V.....
avg E..V.....
paeth E..V.....
mixed E..V.....
-pred
指定的这些预测方法之间有什么区别? ?我在 ffmpeg.org 或其他任何地方都找不到任何文档。
最佳答案
PNG specification指定 5 种不同的过滤器类型,用于使图像数据在压缩前更易于压缩:none、sub、up、average 和 Paeth。每个过滤器的想法是从附近的像素中导出当前像素,然后只存储多少来调整该估计以获得真实值。图像的每条扫描线都有一个为其指定的过滤器。每个过滤器在不同的情况下效果最好。过滤器不会影响实际的图像数据,只会影响它的存储方式。mixed
不是过滤器,而是告诉 ffmpeg 为每一行选择最佳过滤器。这也称为动态过滤。这会使编码变慢,因为需要为每一行尝试 5 种不同的过滤器,但可以产生更好的压缩效果。使用 minimum sum of absolute differences method 找到最佳过滤器.
关于ffmpeg - 这些 FFmpeg APNG 编码器预测方法是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65619177/