ffmpeg, YUV420P写文件

        AVFrame *frame = av_frame_alloc();
			FILE* file = 0;
			fopen_s(&file, "YUV420P.YUV", "ab+");
			fwrite(frame->data[0], 1, frame->linesize[0] * frame->height, file);
			fwrite(frame->data[1], 1, frame->linesize[1] * frame->height / 2, file);
			fwrite(frame->data[2], 1, frame->linesize[2] * frame->height / 2, file);
			fclose(file);

你可能感兴趣的:(C++,FFMPEG)