0

In my WinForm app, I managed to display the camera feed to a pictureBox.

using System.Drawing;
using Image = Microsoft.Azure.Kinect.Sensor.Image;
using BitmapData = System.Drawing.Imaging.BitmapData;

Bitmap colorBitmap;
Bitmap depthBitmap;

(...)

Image depthImage = capture.Depth;
ushort[] depthArray = depthImage.GetPixels<ushort>().ToArray();
BitmapData bitmapData = depthBitmap.LockBits(...)

(...)

colorBitmap = new Bitmap(...)

(...)

depthBitmap.UnlockBits(bitmapData);
pictureBox2.Image = depthBitmap;
pictureBox1.Image = colorBitmap;

Similar to I set these images to a pictureBox, can I record these bitmap images to a video file?

I could simply save the image depthBitmap.save(...) and colorBitmap.save(...) to a create a sequence of png files but not a video.

I tried using Accord.Video.FFMPEG and AForge.Video.FFMPEG but none of them work with x64 arcticute that I requrire for to build Azure apps.

Appriciate your thoughts on this.

Mad
  • 435
  • 2
  • 17
  • @Franck Appreciate it if you could share an online resource that you found via your search. I actually did Google research before posting this here but I couldn't find a direct solution to address this question. Maybe my Google search skill is not that good. :) – Mad May 13 '21 at 11:10
  • type "bitmap to video file c#" that simple – Franck May 13 '21 at 11:14
  • Well, it is the same set of results that I got as well. I did not see a solution that runs on .NET framework 4.7.2. Many suggested using AForge.Video.FFMPEG library which is not supported by this version of .NET – Mad May 13 '21 at 11:23
  • If using a toolkit is an option for you, this can be done using [LEADTOOLS Multimedia SDK](https://www.leadtools.com/sdk/engine/multimedia) (Disclaimer: I am a LEADTOOLS employee). There’s a C# demo with the SDK named GenerateAVI which generates a video file from bitmaps displayed using the Image property of a `System.Windows.Forms.PictureBox` control. I built this demo as x64 using .NET framework 4.7.2 and it worked with the SDK without any problems. If you would like to try it, there’s a free evaluation [here](https://www.leadtools.com/downloads). – Amin Dodin May 23 '21 at 16:06

0 Answers0