if(0)//(got_frame)
{
int size = frame->height * frame->width * 3 / 2;
char* buf = new char[size];
memset(buf, 0, size);
int height = frame->height;
int width = frame->width;
printf("decode video ok format [%d] size [%dX%d] n",frame->format,width,height);
printf("line[0,1,2]=[%d,%d,%d]n",frame->linesize[0],frame->linesize[1],frame->linesize[2]);
int a = 0, i;
#if 0
for (i = 0; i<height; i++)
{
memcpy(buf + a, frame->data[0] + i * frame->linesize[0], width);
a += width;
}
for (i = 0; i<height / 2; i++)
{
memcpy(buf + a, frame->data[1] + i * frame->linesize[1], width);
a += width / 2;
}
for (i = 0; i<height / 2; i++)
{
memcpy(buf + a, frame->data[2] + i * frame->linesize[2], width / 2);
a += width / 2;
}
fwrite(buf, 1, frame->height * frame->width * 3 / 2, pFile);
#else
fwrite(frame->data[0],1,frame->height * frame->width,pFile);//Y
fwrite(frame->data[1],1,frame->height * frame->width/4,pFile); //U
fwrite(frame->data[2],1,frame->height * frame->width/4,pFile);
#endif
delete buf;
buf = NULL;
}
最后
以上就是忧虑蜡烛最近收集整理的关于ffmpeg 解码出来的YUV数据写文件的全部内容,更多相关ffmpeg内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复