美文网首页
保存yuv420p一帧数据

保存yuv420p一帧数据

作者: b036101467d7 | 来源:发表于2019-06-26 10:05 被阅读0次
    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);
    }
    

    相关文章

      网友评论

          本文标题:保存yuv420p一帧数据

          本文链接:https://www.haomeiwen.com/subject/pmyqcctx.html