Я пытаюсь закодировать видео, используя libavcodec/libavformat. Аудио отлично работает, но когда я пытаюсь кодировать видео я получаю следующие ошибки:Как закодировать h.264 с помощью libavcodec/x264?
[libx264 @ 0x10182a000]broken ffmpeg default settings detected
[libx264 @ 0x10182a000]use an encoding preset (vpre)
легко исправить с помощью FFmpeg командной строки, но я пытаюсь сделать это в C. мои варианты
AVStream *pVideoOutStream = av_new_stream(pOutFormatCtx, 0);
AVCodecContext *pVideoOutCodecCtx = pVideoOutStream->codec;
pVideoOutCodecCtx->codec_id = CODEC_ID_H264;
pVideoOutCodecCtx->codec_type = CODEC_TYPE_VIDEO;
pVideoOutCodecCtx->bit_rate = pVideoInCodecCtx->bit_rate;
pVideoOutCodecCtx->width = pVideoInCodecCtx->width;
pVideoOutCodecCtx->height = pVideoInCodecCtx->height;
pVideoOutCodecCtx->pix_fmt = pVideoInCodecCtx->pix_fmt;
pVideoOutCodecCtx->sample_rate = pVideoInCodecCtx->sample_rate;
pVideoOutCodecCtx->gop_size = 30;
, но avcodec_open() не работает.
Какие еще значения необходимо установить, чтобы сделать x264 счастливым?
Посмотрите на рабочие примеры: официальные https://github.com/FFmpeg/FFmpeg/tree/n3.0/doc/examples, мое: HTTP: // StackOverflow .com/a/36405714/895245 –