El 5/4/21 a las 05:13, Сергей Икол escribió:
Gonzalo Garramuño
Thank you very much for your help.
I think I'm completely confused ((
line 352 (avcodec_send_frame ()) constantly returns -22
it seems to me that somewhere I am making a fundamental mistake ((
You are not initializing the codec for encoding nor opening the context,
which are the one line in avcodec_send_frame which returns -22.
AVCodec *codec = avcodec_find_decoder(in_cctx->codec_id)
AVCodec *encoder = avcodec_find_encoder(in_cctx->codec_id);
avcodec_open2(in_cctx, codec, NULL);
out_cctx = avcodec_alloc_context3(encoder);
out_cctx->codec = encoder;
out_cctx->bit_rate = in_cctx->bit_rate;
out_cctx->width = outWidth;
out_cctx->height = outHeight;
out_cctx->pix_fmt = AV_PIX_FMT_YUV420P;
out_cctx->time_base = (AVRational){1, 25};
out_cctx->framerate = (AVRational){25, 1};
avcodec_open2(out_cctx, encoder, NULL);
}
int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const
AVFrame *frame)
{
if (!avcodec_is_open(avctx) || !av_codec_is_encoder(avctx->codec))
return AVERROR(EINVAL);
// ...etc...
}
That should get you past the -22, albeit it later segfaults for unknown
reasons (you'll need to hunt this one yourself).
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".