다음 코드를 사용합니다
AVDictionary *options = NULL;
AVCodec *codec = avcodec_find_encoder(AVCODEC_ID_VP8);
AVCodecContext *ctx = avcodec_alloc_context3(codec);
av_dict_set(&options, "option", "value", 0);
int res = avcodec_open2(ctx, codec, &options);
if (res < 0)
error();
while (..) {
res = avcodec_encode_video2(ctx, ..);
if (res < 0)
error();
}
avcodec_close(ctx);
avcodec_free_context(ctx);
관련 "옵션을"/ "값"쌍은 예로부터 VP8 인코딩 가이드에서 얻을 것이 무엇 있습니다 FFmpeg 위키. 예를 들어, 사용, 1 Mbps의 비트 레이트 (위키 첫 번째 예)를 설정 :
av_dict_set_int(&options, "b", 1024 * 1024, 0);
또는
av_dict_set(&options, "b", "1M", 0);
내가 대신 VP8의 VP9을 사용하는 것이 좋습니다, 당신은 좋은 품질을받지 않습니다 VP8과 함께,하지만 그것은 분명히 당신의 선택입니다.
감사합니다.이 도움이되었습니다. –