void SaveYuv(unsigned char *buf, int wrap, int xsize, int ysize)
{
for (int i = 0; i<ysize; i++)
{
mOut.write((const char *)(buf + i * wrap), xsize);
}
}
void saveFrame(AVFrame *frame) {
SaveYuv(frame->data[0], frame->linesize[0], frame->width, frame->height);
SaveYuv(frame->data[1], frame->linesize[1], frame->width/2, frame->height/2);
SaveYuv(frame->data[2], frame->linesize[2], frame->width/2, frame->height/2);
}
网友评论