This encoder requires using the avcodec_send_frame() API

asked 2017-12-09 12:55:57 -0600

Steven P. Goldsmith gravatar image

updated 2017-12-12 10:47:49 -0600

Using opevcv 3.3.x dev from source (Ubuntu 16.04 on ARM) and I get "This encoder requires using the avcodec_send_frame() API" trying to use video writer with and h264 codec. Looking at the source for libav it appears to expect and audio component:

 1270 int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
 1271                                               AVPacket *avpkt,
 1272                                               const AVFrame *frame,
 1273                                               int *got_packet_ptr)
 1274 {
 1275     AVFrame tmp;
 1276     AVFrame *padded_frame = NULL;
 1277     int ret;
 1278     int user_packet = !!avpkt->data;
 1279 
 1280     *got_packet_ptr = 0;
 1281 
 1282     if (!avctx->codec->encode2) {
 1283         av_log(avctx, AV_LOG_ERROR, "This encoder requires using the avcodec_send_frame() API.\n");
 1284         return AVERROR(ENOSYS);
 1285     }

Not sure if this is a libav issue of opencv issue. If I switch codec to MPEG it works fine. I'm also seeing issues with video capture using H264.

I rolled back to the build I did in May and no problems. Will try Ubuntu upgrade first, then build of OpenCV from source.

edit retag flag offensive close merge delete