使用c ++的视频流 [英] Video streaming using c++

查看:177
本文介绍了使用c ++的视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将在c ++中创建一个创建照片流的应用程序,然后将它们作为视频流发送到另一个应用程序。任何想法如何可以开始?我的意思是,我应该使用什么库和什么编码?我正在考虑MJPEG和UDP或RTP作为协议....任何帮助将非常感激。

I'm going to build an application in c++ that creates stream of photos and then sends them as video stream to another application. any ideas about how can i start? what I mean is, what libraries should i use and what the encoding? I'm thinking about MJPEG, and UDP or RTP as protocol.... any help would be greatly appreciated.

推荐答案

你的输入数据只是一堆随机图像,而不是视频,你不会做视频流。你只是要发送一堆完整的图像。不需要涉及视频编码技术,只是做最简单的可能的图像传输。视频编码器依赖于与先前具有各种关系的每一帧,如在实际视频中常见的。对于随机图像的输入,它们不能压缩这么多,并且单帧压缩(例如JPEG / PNG /任何其他)很可能已经应用于您的输入数据。

If your input data is just a bunch of random images, not video, you're not going to do "video streaming". You're just going to be sending a bunch of full images. No need to involve video encoding technology, just do the simplest possible transmission of images. Video encoders rely on each frame having various relationships to the previous, as is common in actual video. For inputs of random images, they're not going to be able to compress that much, and single-frame compression (e.g. JPEG/PNG/whatever) is very likely already going to be applied to your input data.

可能最容易发送每个文件的内容以及原始文件名,并让接收客户端在磁盘上重新创建文件,并使用现有的面向磁盘的库来打开和解码图片。

Probably easiest to send the contents of each file, together with the original filename, and have the receiving client re-create the file on disk, and use existing disk-oriented libraries to open and decode the image.

您可能只需要使用TCP,您的需求中没有指示您需要使用更复杂和容易出错的基于UDP / RTP的解决方案。

You should probably just use TCP for this, nothing in your requirements that indicate you need to use the more complicated and error-prone UDP/RTP-based solutions.

这篇关于使用c ++的视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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