问题
I'm working on a project in which we use a radio modem to transmit data (video and telemetry) from an unmanned aerial vehicle to a ground station. What we need to do is display the video in real-time and be able to know which frame corresponds to each chunk of telemetry data in C#.
The data is decapsulated to bytes of telemetry and video (mpeg4). As I've got some experience with OpenCV, I'd like to use it to decode, display and grab clicks position from the video. To do so I'm using the OpenCV wrapper for C# called Emgu.
The problem is that OpenCV loads video from a device or from a file and I've got only a callback with some bytes. I've tried writing those bytes to a file and opening this file with OpenCV, but once it gets to the end, I need to reopen it and continue from where it stopped, which generates lag.
Anyone got any idea how to do this?
回答1:
Some helpful links
http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.aspx
http://www.developerfusion.com/article/3918/socket-programming-in-c-part-1/
http://msdn.microsoft.com/en-us/magazine/cc300760.aspx
http://en.wikipedia.org/wiki/Stream_socket
http://beej.us/guide/bgnet/output/html/multipage/theory.html
Hope that helps!
来源:https://stackoverflow.com/questions/11317143/how-do-i-display-a-video-with-opencv-from-bytes