I have been trying to use NDI SDK 4.5, in a Objective-C iOS-13 app, to broadcast camera capture from iPhone device.
My sample code is in public Github repo: https://github.com/bharatbiswal/CameraExampleObjectiveC
Following is how I send CMSampleBufferRef
sampleBuffer:
CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
NDIlib_video_frame_v2_t video_frame;
video_frame.xres = VIDEO_CAPTURE_WIDTH;
video_frame.yres = VIDEO_CAPTURE_HEIGHT;
video_frame.FourCC = NDIlib_FourCC_type_UYVY; // kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
video_frame.line_stride_in_bytes = VIDEO_CAPTURE_WIDTH * VIDEO_CAPTURE_PIXEL_SIZE;
video_frame.p_data = CVPixelBufferGetBaseAddress(pixelBuffer);
NDIlib_send_send_video_v2(self.my_ndi_send, &video_frame);
I have been using "NewTek NDI Video Monitor" to receive the video from network. However, even though it shows as source, the video does not play.
Has anyone used NDI SDK in iOS to build broadcast sender or receiver functionalities? Please help.
To view an NDI stream, you need the NDI Studio Monitor (Windows) or NDI Video Monitor (macOS) application installed on your machine. The monitor searches your network for NDI signals from Nuke or Nuke Studio and allows you to select the stream you'd like to view.
Use in Wi-Fi and wide area networks Some NDI adopters have run the protocol across fibre connections up to 15 km, although NDI's use of the TCP protocol makes it less suitable for long-distance, high-latency connections due to factors such as bandwidth-delay product and TCP packet loss recovery.
Developer Kit. The NDI SDK allows you to develop applications with native IP video and audio support for free and commercial NDI use - across almost all platforms (Windows, macOS, Linux, iOS, tvOS and ipadOS, with Intel and ARM architecture CPUs.)
NDI uses compression to enable transmission of a large number of video streams across existing infrastructure, specifically discrete cosine transform (DCT), which converts video signals into elementary frequency components.
You should use kCVPixelFormatType_32BGRA
in video settings. And NDIlib_FourCC_type_BGRA
as FourCC in NDIlib_video_frame_v2_t.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With