gpt4 book ai didi

ffmpeg 宽度不能被 2 (375x500) 整除错误

转载 作者:行者123 更新时间:2023-12-04 22:45:10 24 4
gpt4 key购买 nike

我尝试使用 ffmpeg 将视频缩放到 375x500。
ffmpeg -i input.mp4 -s 375x500 -c:a copy output.mp4
出现此错误,[libx264 @ 0x5639d358ad60] 宽度不能被 2 整除 (375x500)
初始化输出流 0:0 时出错 - 打开输出流 #0:0 的编码器时出错 - 可能参数不正确,例如 bit_rate、速率、宽度或高度。

我尝试了很多命令,但我没有得到我的解决方案。

最佳答案

使用标准 yuv420p 像素格式时,libx264 要求宽度/高度可被 2 整除。请参阅有关如何修复 not divisible by 2 的许多建议。比例/垫/裁剪错误:

  • FFMPEG (libx264) “height not divisible by 2”
  • ffmpeg : width not divisible by 2 (when keep proportions)
  • ffmpeg add watermark libx264 width not divisible by 2 (853x480)

  • 但是,如果您 必须正好有 375x500 那么你必须使用支持这个大小的像素格式:
    ffmpeg -i input.mp4 -vf "format=yuv444p,scale=375:500" -c:a copy output.mp4

    缺点是几乎没有播放器或设备能够播放它(除非它使用 FFmpeg)。

    formatscale过滤文档和 ffmpeg -pix_fmts 的输出了解更多信息。

    关于ffmpeg 宽度不能被 2 (375x500) 整除错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60788967/

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