首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ffmpeg:无法打开libx265编码器。初始化输出流0:0时出错--打开输出流#0:0的编码器时出错

ffmpeg:无法打开libx265编码器。初始化输出流0:0时出错--打开输出流#0:0的编码器时出错
EN

Stack Overflow用户
提问于 2018-05-16 21:12:45
回答 1查看 3.8K关注 0票数 5

对不起,我的英语不好。我正在尝试使用ffmpeg将一些图像转换为heic格式。他们中的大多数都成功了,但一些大的jpeg (似乎只有jpeg,png就可以了)文件就不行了。

如何改进我的命令以兼容所有图像,以便自动转换它们?

代码语言:javascript
复制
➜  ~ ffmpeg -i sample.jpg -crf 12 -preset placebo -pix_fmt yuv420p -f hevc bitstream.265
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, image2, from 'sample.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 5226869 kb/s
    Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 13333x4200, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> hevc (libx265))
Press [q] to stop, [?] for help
[swscaler @ 0x7fd2e3006000] deprecated pixel format used, make sure you did set range correctly
x265 [info]: HEVC encoder version 2.7
x265 [info]: build info [Mac OS X][clang 9.0.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [error]: Picture width must be an integer multiple of the specified chroma subsampling
[libx265 @ 0x7fd2e2802a00] Cannot open libx265 encoder.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
EN

回答 1

Stack Overflow用户

发布于 2018-05-16 21:59:06

就像上面说的,Picture width must be an integer multiple of the specified chroma subsampling。对于yuv420p,这是2。

您可以只删除一列,如果需要,也可以删除一行。

代码语言:javascript
复制
ffmpeg -i sample.jpg -vf crop='iw-mod(iw,2)':'ih-mod(ih,2)' -crf 12 -preset placebo -pix_fmt yuv420p -f hevc bitstream.265
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50371919

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档