Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6563943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:54:25+00:00 2026-05-25T13:54:25+00:00

I have a video stream coming in from the Kinect. It’s data is packed

  • 0

I have a video stream coming in from the Kinect. It’s data is packed in a 32bit BGRX format. I would like to move this data directly into a Texture2d but I cant find a matching SurfaceFormat. The closest thing I can find is SurfaceFormat.Color which looks to be 32bit RGBX.

Assuming that there is not a compatible format. What is the quickest way to convert and push the data to a texture 2d

I was thinking something like this would be good, but it seems to slow down the framerate:

Edit: I changed the algorithm a bit and it seems to be running decently now.

    void nui_VideoFrameReady(object sender, ImageFrameReadyEventArgs e)
    {
        byte x;
        for (int i = 0; i < e.ImageFrame.Image.Bits.Length; i += 4)
        {
            x = e.ImageFrame.Image.Bits[i];
            e.ImageFrame.Image.Bits[i] = e.ImageFrame.Image.Bits[i + 2];
            e.ImageFrame.Image.Bits[i + 2] = x;
        }
        canvas.SetData(e.ImageFrame.Image.Bits);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:54:26+00:00Added an answer on May 25, 2026 at 1:54 pm

    This is the fastest thing I have been able to come up with:

        void nui_VideoFrameReady(object sender, ImageFrameReadyEventArgs e)
        {
            byte[] bits = e.ImageFrame.Image.Bits;
            for (int i = 0; i < bits.Length; i += 4)
            {
                frameBuffer[i] = bits[i + 2];
                frameBuffer[i + 1] = bits[i + 1];
                frameBuffer[i + 2] = bits[i];
            }
            canvas.SetData(frameBuffer);
        }
    

    Without the kinect involved at all I get a framerate of 4200

    Moving the bytes directly to the texture2d without correcting the format difference yield: 3100

    If you give your self a local variable with e.ImageFrame.Image.Bits and copy the bytes into a preallocated buffer fixing the bytes as you go I get: 2700

    The algorithm i have listed in my original question where you swap the bits in place and then send to texture2d yield about 750

    So to recap changing to this algorithm bumped the framerate to 2700 up from 750

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the rtsp URL for a live video stream which I would like
This should be easy. I have a video stream coming in from my webcam.
So I have a local URL like http://localhost:port/ with live video stream in it.
We have been requested to stream a single video (+500MB) from a web site.
We have a whole catalogue of videos which we would like to stream to
I have a video stream coming in on rtp to ffmpeg and I want
I would like to read in a colour video and have the output as
I have a raw H.264 Stream from an IP Camera packed in RTP frames.
Is there a simple way to remove the video-stream from a IMediaWriter? I have
I would like to get video stream with some real-time events synchronized with it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.