gpt4 book ai didi

ffmpeg - 在没有质量损失的情况下将 mp4 转换为 webp (ffmpeg)

转载 作者:行者123 更新时间:2023-12-04 23:18:48 31 4
gpt4 key购买 nike

我怎样才能做到这一点?

ffmpeg -y -i input.mp4 -vcodec libwebp -lossless 0 -compression_level 0 -loop 0 output_lossless0_comp0.webp
ffmpeg -i input.mp4 -vcodec libwebp -filter:v fps=fps=20 -lossless 0  -compression_level 3 -q:v 70 -loop 1 -preset picture -an -vsync 0 -s 800:600 output.webp
导致大量质量损失。
我在其他地方找到的所有其他命令行都会导致无限的编码时间和荒谬的文件大小(源为 3 MB 时为 500+ MB)。
我所需要的只是将 mp4 转换为 webp 而不会压缩或质量损失。

最佳答案

仅限 -c:v copy选项可以保证输出的大小相似而不会损失质量,但是 webp不支持 mp4编解码器,因此您需要使用“某些”编码器,并且任何编码器都​​会导致输出文件的质量下降或更大(这是一种权衡)。
如果您使用 libwebp ( documentation ) 那么您将需要对其参数的不同值进行试验,以获得在尺寸、质量和时间方面对您有利的结果。
我会从 -lossless 0 开始任何测试或 -lossless 1以及 -compression_level 的不同值范围:

For lossy, this is a quality/speed tradeoff. Higher values give betterquality for a given size at the cost of increased encoding time. Forlossless, this is a size/speed tradeoff. Higher values give smallersize at the cost of increased encoding time. More specifically, itcontrols the number of extra algorithms and compression tools used,and varies the combination of these tools. This maps to the methodoption in libwebp. The valid range is 0 to 6. Default is 4.

关于ffmpeg - 在没有质量损失的情况下将 mp4 转换为 webp (ffmpeg),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71092597/

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