Skip to content

Frame mismatch #118

@MTinside

Description

@MTinside

My camera outputs in YUYV format, Whenever I read the frame by logging it, I find it mismatched. I used wireshark to read to read the data on the bus and when i compared it with the logs, there were striking difference. for example if I send ff 80 as the input the log shows it to be EB 80 (hex) . similarly if i send 00 80 (black) it shows 10 80 (hex) . Any suggestion would be appreciated thanks !

mCameraHelper.setFrameCallback(frame -> {
if (mCustomFPS != null) {
mCustomFPS.doFrame(); // Calculate FPS for each frame
}

            byte[] frameData = new byte[frame.remaining()];
            frame.get(frameData);

// Save the YUYV data
saveFrameYUYV(frameData);

// Rewind buffer for additional processing
frame.rewind();
// Now you can read again for other processing

            // Optionally process the frame (if required)
            byte[] raw = new byte[frame.remaining()];
            frame.get(raw, 0, raw.length);

            if (mNv21ToBitmap == null) {
                mNv21ToBitmap = new NV21ToBitmap(BasicPreviewActivity.this);
            }
            Bitmap bitmap = mNv21ToBitmap.nv21ToBitmap(raw, mCurrentWidth, mCurrentHeight);

        }, UVCCamera.PIXEL_FORMAT_RAW);

        // Initialize FPS calculation
        initFPS();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions