美文网首页
I420图片格式dump

I420图片格式dump

作者: Ed_Lannister | 来源:发表于2022-06-28 19:57 被阅读0次
        if (!yplane || !uplane || !vplane) {
            RTC_LOG(LS_INFO) << "ELSCU yplane uplane vplane buffer is NULL";
        } else {
            RTC_LOG(LS_INFO) << "ELSCU write buffer";
            std::fstream ifs;
            ifs.open("/sdcard/capturedI420Buf2.yuv", std::ios::out | std::ios::binary);
            ifs.write(reinterpret_cast<const char *>(yplane), stride*h);
            ifs.write(reinterpret_cast<const char *>(uplane), stride*h/4);
            ifs.write(reinterpret_cast<const char *>(vplane), stride*h/4);
            ifs.close();
        }
    

    连续dump

    RTC_LOG(LS_INFO) << "ELSCU write buffer";
                    std::fstream ifs;
                    std::string finalpath ="/sdcard/capturedbuff" + std::to_string(frameCount) + ".I420";
                    ifs.open(finalpath, std::ios::out | std::ios::binary);
                    ifs.write(reinterpret_cast<const char *>(yplane), stride * h);
                    ifs.write(reinterpret_cast<const char *>(uplane), stride * h / 4);
                    ifs.write(reinterpret_cast<const char *>(vplane), stride * h / 4);
                    ifs.close();
    

    相关文章

      网友评论

          本文标题:I420图片格式dump

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