V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bihui
V2EX  ›  FFmpeg

ffmpeg 转换 h265 4k 视频的问题,尺寸小于 1280 就 ok!

  •  
  •   bihui · Jun 3, 2020 · 4285 views
    This topic created in 2167 days ago, the information mentioned may be changed or developed.
    原始文件是 h265 的,转换就是普通的转换命令,但是只要输出尺寸大于 1280 就提示

    原始尺寸是大于 3800x3800 的。

    Error initializing output stream 0:0 --
    Error while opening encoder for output stream #0:0 (Video) -
    maybe incorrect parameters such as bit_rate, rate, width or height

    这个错误我郁闷了好几个月了,今天又遇到。
    3 replies    2020-08-20 16:25:46 +08:00
    aliofwind
        1
    aliofwind  
       Jun 3, 2020
    命令参数是什么,这个报错看起来是参数冲突之类的
    hardwork
        2
    hardwork  
       Jun 3, 2020
    ffmpeg 命令行吗,发出来看看
    hungkuishing
        3
    hungkuishing  
       Aug 20, 2020
    视频编码器 open 失败就会报这个错,ffmpeg 代码如下:

    if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
    if (ret == AVERROR_EXPERIMENTAL)
    abort_codec_experimental(codec, 1);
    snprintf(error, error_len,
    "Error while opening encoder for output stream #%d:%d - "
    "maybe incorrect parameters such as bit_rate, rate, width or height",
    ost->file_index, ost->index);
    return ret;
    }

    一些编码器对输入的宽高、码率有限制,如果参数不符合编码器要求,就会导致 open 失败,比如
    H.261 需要输入的视频分辨率是 176x144 或者 352x288 ;
    H.263 需要输入的视频分辨率是 128x96, 176x144, 352x288, 704x576, 或者 1408x1152 。

    你可以把命令行、以及终端打印贴出来,方便定位问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 22:51 · PVG 06:51 · LAX 15:51 · JFK 18:51
    ♥ Do have faith in what you're doing.