Results 1 to 3 of 3

Thread: Recording source in c# examples

  1. #1
    Registered User
    Join Date
    Jul 2019
    Location
    Netherlands
    Posts
    2

    Recording source in c# examples

    Hi All!

    I have the examples working so far.
    I send screenshots to the sender and that all works!

    What i can't seem to figure out and cant find any documentation about is how to record the stream.

    the
    Code:
    _canRecord = NDIlib.recv_recording_is_supported(_recvInstancePtr);
    alsways returns false.

    Also
    Code:
    // frame settings - check for extended functionality
                    case NDIlib.frame_type_e.frame_type_status_change:
                        // check for PTZ
                        IsPtz = NDIlib.recv_ptz_is_supported(_recvInstancePtr);
    
                        // Check for recording
                        IsRecordingSupported = NDIlib.recv_recording_is_supported(_recvInstancePtr);
    
                        // Check for a web control URL
                        // We must free this string ptr if we get one.
                        IntPtr webUrlPtr = NDIlib.recv_get_web_control(_recvInstancePtr);
                        if (webUrlPtr == IntPtr.Zero)
                        {
                            WebControlUrl = String.Empty;
                        }
                        else
                        {
                            // convert to managed String
                            WebControlUrl = NDI.UTF.Utf8ToString(webUrlPtr);
    
                            // Don't forget to free the string ptr
                            NDIlib.recv_free_string(_recvInstancePtr, webUrlPtr);
                        }
    
                        break;
    is never run.


    but when i installed IsoRecorder i can record the same input without problem?.....

    Am i missing any flags/options i need to set to be able to record?...


    My main Sender Functions:
    Code:
     // callback function, called when a new screenshot is taken.
            private static void Render(object sender, Bitmap image)
            {
                if (!Directory.Exists(imageFolder))
                    Directory.CreateDirectory(imageFolder);
    
               // string str = $"{DateTime.Now.Minute.ToString()}{DateTime.Now.Second.ToString()}{DateTime.Now.Millisecond.ToString()}";
                //image.Save(Path.Combine(imageFolder, $"{str}.bmp"));
    
                BitmapData data = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppPArgb);
                videoFrame.BufferPtr = data.Scan0;
                sendInstance.Send(videoFrame); 
                
                image.UnlockBits(data);
            }
    
            static void Main()
            {
                failoverName = String.Format("{0} (NDIlib Send Example)", System.Net.Dns.GetHostName());
                sendInstance = new Sender("Example", true, false, null, failoverName);
                
                videoFrame = new VideoFrame(1920, 1080, (16.0f / 9.0f), 1000, 30);
                
                audioFrame = new AudioFrame(1700, 48000, 2);
                bmp = new Bitmap(videoFrame.Width, videoFrame.Height, videoFrame.Stride, System.Drawing.Imaging.PixelFormat.Format32bppPArgb, videoFrame.BufferPtr);
                ScreenShotThread = new Thread(new ThreadStart(ScreenShot));
                ScreenShotThread.Start();
                Console.ReadLine();
            } // Main
    Last edited by Wyvern_010; 07-07-2019 at 06:36 AM.

  2. #2
    Registered User
    Join Date
    Aug 2015
    Location
    london
    Posts
    228
    Quote Originally Posted by Wyvern_010 View Post
    Hi All!
    What i can't seem to figure out and cant find any documentation about is how to record the stream.
    The NDI Record function you mention is really asking if the sending device is capable of recording *itself*. For example an NDI PTZ Camera with an on-board SD card recorder.

    ISOCorder is actually doing all the work itself to receive the frames in the normal way and then encoding that disk.

  3. #3
    Registered User
    Join Date
    Jul 2019
    Location
    Netherlands
    Posts
    2
    Quote Originally Posted by livepad View Post
    The NDI Record function you mention is really asking if the sending device is capable of recording *itself*. For example an NDI PTZ Camera with an on-board SD card recorder.

    ISOCorder is actually doing all the work itself to receive the frames in the normal way and then encoding that disk.
    Thanks for your response!

    Guess i will be going deeper into the rabit hole.

    Any recomandations to library that do most of the work for me/us? (something with re-inventing the wheel)

    Currently experimenting with AForge/Accord

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •