Getting jpeg images or video data from multiple video sources at the same time

I’m trying to get video data as jpegs from multiple video sources simultaneously but the way I implemented it which is like I saw in your example ‘MediaPlaybackViewer’ project uses too much of CPU power and a long latency. I saw in your documentation that you say:

JPEGVideoSource gets recorded video image formatted as JPEGs. Please note that all calls to the methods in this class MUST be coming from the same thread! When getting images from the server, it should be considered that the Get() method can take some time and is not ideal to execute on a UI thread.

Is there way to get the images from multiple sources at the same time in more efficient way? I’m taking the images and sending them to the browser as video so I need much better performance.

In Live mode using the JPEGLiveSource class it works great as I’m getting a callback on each frame and I don’t need to pull the data from the server. Is there a way to work the same way with with playback video?

You can probably speed up the fetching of JPEGs by using GetNext() on the JPEGVideoSource. Behind the scenes the JPEGVideoSource fetches a GOP if the camera is setup to use H264, H265 or similar and keeps a cache and you can ensure to get the next image without asking the recording server by using GetNext. (It will give you the next frame as JPEG until it reach the last frame of the GOP where reading a new GOP from Recording Server is needed.)

All the XLiveSource and XVideoSource classes are implemented with support for hardware acceleration. Just like you can greatly improve the performance of the Smart Client you can also improve the performance here by running on a PC or server with a supported graphics card.