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 8953077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:01:10+00:00 2026-06-15T14:01:10+00:00

I am using the Simple C# Wrapper for the AviFile Library , and the

  • 0

I am using the Simple C# Wrapper for the AviFile Library, and the code snippet I found here in order create an avi file from Kinect’s color frames.

And I get this exception: “Exception in AVIFileOpen: -2147205009”

        aviManager = new AviManager(@"C:\temp\temp.avi", false);
        aviStream = aviManager.AddVideoStream(false, 30, _firstBitmap);

Where the “_firstBitmap” is generated with the function mentioned above

Bitmap ImageToBitmap(ColorImageFrame Image)
{
     byte[] pixeldata = new byte[Image.PixelDataLength];
     Image.CopyPixelDataTo(pixeldata);
     Bitmap bmap = new Bitmap(Image.Width, Image.Height, PixelFormat.Format32bppRgb);
     BitmapData bmapdata = bmap.LockBits(
         new Rectangle(0, 0, Image.Width, Image.Height),
         ImageLockMode.WriteOnly, 
         bmap.PixelFormat);
     IntPtr ptr = bmapdata.Scan0;
     Marshal.Copy(pixeldata, 0, ptr, Image.PixelDataLength);
     bmap.UnlockBits(bmapdata);
     return bmap;
 }

And the Color frame image is provided from the Kinect SDK’s ColorFrameReady delegate

private void SensorColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
{
    using (ColorImageFrame colorFrame = e.OpenColorImageFrame())
    {
        if (colorFrame != null)
        {
            // Copy the pixel data from the image to a temporary array
            colorFrame.CopyPixelDataTo(this.colorPixels);

            // Write the pixel data into our bitmap
            this.colorBitmap.WritePixels(
                new Int32Rect(0, 0, this.colorBitmap.PixelWidth, this.colorBitmap.PixelHeight),
                this.colorPixels,
                this.colorBitmap.PixelWidth * sizeof(int),
                0);
            AviManager aviManager = new AviManager(@"C:\temp\temp.avi", false);
            VideoStream aviStream = aviManager.AddVideoStream(false, 30, bmp);

            Bitmap bitmap = ImageToBitmap(colorFrame);
            aviStream.AddFrame(bitmap);
            bitmap.Dispose();
            aviManager.Close();
        }
    }
}

Thank you !

  • 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-06-15T14:01:11+00:00Added an answer on June 15, 2026 at 2:01 pm

    The AForge.NET framework provides several functions that allow you to easily write AVI, or other, video files. It also provides direct support for the Kinect, allowing you to get access to the video camera.

    However, per information on the website, it requires libfreenect. I am unaware if libfreenect and the office Kinect SDK can live in harmony with each other in the same application.

    The AVIWriter class is pretty straight forward and would not necessarily require you to use AForge.NET’s Kinect access. You could just as easily get the latest color frame from the official Kinect SDK, convert it to a Bitmap and output it.

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

Sidebar

Related Questions

I'm using simple-html-dom to try and pull some code from another site. Here's some
i want to create some simple wrapper classes for an existing class library. To
I tried doing a simple commit through my wrapper library for Mercurial, using the
I'm using Twython (Python wrapper for Twitter API, found here .) Objective: I'm trying
I have been using Swig to create a Java wrapper for a a library
I have a simple wrapper around a WYSIWYG editor (TinyMCE). I'm using JSNI to
I'm using SWIG to make a Java wrapper of a C++ library (about Json
I'm trying to create an API wrapper for Issuu using ruby and am running
I can't get ZeroMQ C++ wrapper to receive multipart messages. The same code using
I decided to try creating a simple C wrapper for the V8 API using

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.