【问题标题】:How to encode a picture into H264 using x264 API?如何使用 x264 API 将图片编码为 H264?
【发布时间】:2011-11-10 23:34:22
【问题描述】:

我按照链接How does one encode a series of images into H264 using the x264 C API?对图片进行编码,但每次x264_encoder_encode(encoder, &nals, &i_nals, &pic_in, &pic_out) 都返回0。

【问题讨论】:

  • 回答的有点模糊;我建议在ffmpeg中启用日志并检查;顺便说一句,返回值 0 不是表示成功吗?

标签: c++ x264


【解决方案1】:

x264_encoder_delayed_frames 返回什么?根据底部的KillianDS's edit,如果有延迟帧,x264_encoder_encode可能会返回0。

当你使用其他参数时,会有延迟帧,我的参数不是这种情况(主要是由于 nolatency 选项)。如果是这种情况,frame_size 有时会为零,只要函数 x264_encoder_delayed_frames 不返回 0,您就必须调用 x264_encoder_encode。但是对于此功能,您应该更深入地了解 x264.c 和 x264.h。

【讨论】:

    猜你喜欢
    • 2015-06-12
    • 2010-12-30
    • 1970-01-01
    • 2013-08-08
    • 1970-01-01
    • 2012-05-11
    • 2011-02-24
    • 2014-03-10
    • 1970-01-01
    相关资源
    最近更新 更多