Using NDIlib_util_V210_to_P216() in the loop that do NDIlib_send_send_video_v2() is too slow to send 4K video

Gil Graiber

New member
Hi,

My video comes in V.210 format.
Therefor, I need to convert it to P216 for maximum quality.
When NDIlib_util_V210_to_P216() is used, this loop is not fast enough to send 4K video at 59.94 FPS.
There average time between frames is more than 16.66ms (~18ms) like it should be and is when sending 1080P 59.94
This is my sending loop:

while (!m_stoppedWorker) {
m_FrameCount++;

if(NDIlib_frame_format_type_progressive == NDI_video_frame_10bit.frame_format_type)
{
//DEBUG_MSG(NDI_SDI, L_ERROR, "progressive\n");
m_pISDITransmitter->FetchData(&packet, NDI_video_frame_10bit.p_data);
}




// Convert into the destination
NDIlib_util_V210_to_P216(&NDI_video_frame_10bit, &NDI_video_frame_16bit);

// We now submit the frame. Note that this call will be clocked so that we end up submitting at exactly 29.97fps.
NDIlib_send_send_video_v2(pNDI_send, &NDI_video_frame_16bit);
//usleep(100);

}
}

When I remove the call to NDIlib_util_V210_to_P216(), the loop is fast enough for 4K video.
I have a server with 56 logical cores that are all free, when I run 4K, the maximum usage of a core is 83% (one of the cores only).
Any ideas?

Thanks,
Gil.
 

livepad

Member
Try sending the video async.
NDIlib_send_send_video_async_v2
This will allow your preparation code to run whilst the last frame is being emitted in another thread async
Note that you may need to double buffer.
 

Jarno

Post-LW Engineer
Also keep in mind that 4K video at 60fps is about 500 million pixels per second. On a 5GHz core that gives a budget of 10 clock cycles per pixel to do the conversion. I doubt it is possible to do that.

I would suggest setting up a multithreaded pipeline to convert frames asynchronously from sending, at the cost of increased latency.

---JvdL---
 

Gil Graiber

New member
Also keep in mind that 4K video at 60fps is about 500 million pixels per second. On a 5GHz core that gives a budget of 10 clock cycles per pixel to do the conversion. I doubt it is possible to do that.

I would suggest setting up a multithreaded pipeline to convert frames asynchronously from sending, at the cost of increased latency.

---JvdL---
Thanks, but it seems NDIlib_send_send_video_async_v2() solved the problem.
 
Top Bottom