|
@@ -67,6 +67,7 @@ AVFrame *cvmatToAvframe(cv::Mat *image, AVFrame *frame) {
|
|
|
frame = av_frame_alloc();
|
|
|
av_image_alloc(frame->data, frame->linesize, width, height, AVPixelFormat::AV_PIX_FMT_YUV420P, 1);
|
|
|
}
|
|
|
+ printf("cvmatToAvframe width=%d height=%d linesize[0]=%d linesize[1]=%d linesize[2]=%d \n",width,height,frame->linesize[0],frame->linesize[1],frame->linesize[2]);
|
|
|
SwsContext *conversion = sws_getContext(width, height, AVPixelFormat::AV_PIX_FMT_BGR24, width, height,
|
|
|
(AVPixelFormat) frame->format, SWS_FAST_BILINEAR, NULL, NULL, NULL);
|
|
|
sws_scale(conversion, &image->data, cvLinesizes, 0, height, frame->data, frame->linesize);
|