opencv读取视频,Mat->ffmpeg, BGR24->YUV420最后压缩成H264格式,写成MP4文件
static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt,
FILE *outfile)
{
int ret;
/* send the frame to the encoder */
if (frame)
printf("Send frame %lld\n", frame->pts);
ret = avcodec_send_frame(enc_ctx, frame);
if (ret <.
原创
2020-09-11 14:56:16 ·
1370 阅读 ·
1 评论