Community
cancel
Showing results for 
Search instead for 
Did you mean: 
zhang_e_
Beginner
52 Views

how to realtime Recording

Hello
There are two problems
1. Format of the video file is said h.264, but the file name what? I used mp4, h264, avi have to file, but they can not be opened will be displayed incorrectly formatted

Snap1.png
2. How to achieve real-time video, now click on the button to display a screen can not be real-time display

Snap2.png

 private void button4_Click(object sender, EventArgs e)
        {
            // RecordORPlayback(@"C:\RecordTemp\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".h264", true);
            RecordORPlayback(@"C:\RecordTemp\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".mp4", true);
        }
 void RecordORPlayback(String file, Boolean record)
        {
            PXCMSenseManager sm = PXCMSenseManager.CreateInstance();
            sm.captureManager.SetFileName(file, record);
            //sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 640, 480, 0);
            sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 640, 480);
            sm.captureManager.SetRealtime(true);
            sm.Init();

            //for (int i = 0; i < 300; i++)
            //{
                //Console.WriteLine(i);
                if (sm.AcquireFrame(true).IsError()) { }
                PXCMCapture.Sample sample = sm.QuerySample();

                PXCMImage image = sample.color;
                PXCMImage dimage = sample.depth;
                PXCMImage.ImageData data;
                image.AcquireAccess(
                     PXCMImage.Access.ACCESS_READ,
                     PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32,
                     out data);
                Bitmap bm = data.ToBitmap(0,
                                          image.info.width,
                                          image.info.height);
                pictureBox1.Image = bm;

                sm.ReleaseFrame();
            //}
            sm.Dispose();
        }

 

0 Kudos
4 Replies
zhang_e_
Beginner
52 Views

video format is rssdk

but how to open this file ?
 

jb455
Valued Contributor II
52 Views

You have to use the SDK to view it. If you pass your RecordORPlayback method the filename of the video you saved and false, that should do it!

zhang_e_
Beginner
52 Views

Yes i use RecordORPlayback method and change filename is  .rssdk

RecordORPlayback(@"C:\RecordTemp\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".rssdk", true);

But how can I go to verify my video is correct? Or what I by reference the document?

jb455
Valued Contributor II
52 Views

If you call:

RecordORPlayback(@"C:\RecordTemp\%name of file already saved%.rssdk", false);

And run it, your app should play it back.

Alternatively, you could use the Raw Streams sample in Playback mode to view your video.

Reply