I420图片格式dump

    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(yplane), stride*h);
        ifs.write(reinterpret_cast(uplane), stride*h/4);
        ifs.write(reinterpret_cast(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(yplane), stride * h);
                ifs.write(reinterpret_cast(uplane), stride * h / 4);
                ifs.write(reinterpret_cast(vplane), stride * h / 4);
                ifs.close();

你可能感兴趣的:(I420图片格式dump)