1.
FILE* file =fopen("YUV420P.YUV", "w"); int i; for (i = 0; i<height; i++) { fwrite(pFrame->data[0]+i*pFrame->linesize[0] , 1, width, file); } for (i = 0; i<height / 2; i++) { fwrite(pFrame->data[1]+i*pFrame->linesize[1] , 1, width/2, file); } for (i = 0; i<height / 2; i++) { fwrite(pFrame->data[2]+i*pFrame->linesize[2] , 1, width/2, file); } fclose(file);
https://blog.csdn.net/aphero/article/details/83267878
2.
ffplay -f rawvideo -video_size 640*480 YUV420P.YUV
https://www.cnblogs.com/wangha/p/12510920.html