如何从字节显示带有opencv的视频? [英] How do I display a video with opencv from bytes?

查看:114
本文介绍了如何从字节显示带有opencv的视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,在该项目中,我们使用无线电调制解调器将数据(视频和遥测)从无人飞行器传输到地面站.我们需要做的是实时显示视频,并能够知道哪个帧对应于C#中的每个遥测数据块.

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#.

将数据解封装为遥测和视频字节(mpeg4).有了OpenCV的经验,我想用它来解码,显示和获取视频中的点击位置.为此,我正在使用称为Emgu的C#的OpenCV包装器.

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.

问题是OpenCV从设备或文件加载视频,而我只有一些字节的回调.我曾尝试将这些字节写入文件并使用OpenCV打开该文件,但是一旦结束,我需要重新打开它并从停止的地方继续,这会产生滞后.

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.

有人知道怎么做吗?

推荐答案

一些有用的链接

http://msdn.microsoft.com/zh-cn/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

希望有帮助!

这篇关于如何从字节显示带有opencv的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆