最简单的视频流?

发布于 2024-09-28 20:35:17 字数 174 浏览 6 评论 0原文

我有一台相机,可以一张一张地拍摄照片(大约每秒 10 张照片)并将其发送到 PC。我需要在 PC 中将传入的图像序列显示为实时视频。

仅使用一些 Python GUI 框架,创建一个将保存单个图像的控件并快速更改控件中的图像是否足够?

或者这只是蹩脚的?我应该使用某种视频流库吗?如果是,您有什么推荐?

I have a camera that is taking pictures one by one (about 10 pictures per second) and sending them to PC. I need to show this incoming sequence of images as a live video in PC.

Is it enough just to use some Python GUI framework, create a control that will hold a single image and just change the image in the control very fast?

Or would that be just lame? Should I use some sort of video streaming library? If yes, what do you recommend?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幽蝶幻影 2024-10-05 20:35:17

或者这只是蹩脚?

不,这根本行不通。

让视频发挥作用有一个技巧。 Apple 的 QuickTime 就实现了这一技巧。微软的一些产品也是如此。加上一些开源视频播放工具。

还有几个密切相关的招数,无一不是令人头疼的。

  1. 压缩。全尺寸视频很大。以每秒 30 帧的速度计算 640x480x24 位颜色。加起来很快。如果不进行压缩,您就无法足够快地读取它。

  2. 缓冲和计时。有时数据速率和帧速率不一致。您需要一个准备显示帧的缓冲区,并且需要一个非常精确的时钟来让它们以完全正确的间隔显示。

iPhoto 和 iMovie 的用途是将一系列 JPEG 图像制作成影片。

通常,我们所做的是从图像创建视频文件并通过标准视频播放器播放视频文件。从图像制作 QuickTime 影片或 Flash 影片并不难。有很多工具可以帮助从图像制作电影。几乎任何照片管理解决方案都可以创建幻灯片并将其另存为某种标准格式的电影。

事实上,我认为 Graphic Converter 可以做到这一点。

Or would that be just lame?

No. It wouldn't work at all.

There's a trick to getting video to work. Apple's QuickTime implements that trick. So does a bunch of Microsoft product. Plus some open source video playback tools.

There are several closely-related tricks, all of which are a huge pain in the neck.

  1. Compression. Full-sized video is Huge. Do the math 640x480x24-bit color at 30 frames per second. It adds up quickly. Without compression, you can't read it in fast enough.

  2. Buffering and Timing. Sometimes the data rates and frame rates don't align well. You need a buffer of ready-to-display frames and you need a deadly accurate clock to get them do display at exactly the right intervals.

Making a sequence of JPEG images into a movie is what iPhoto and iMovie are for.

Usually, what we do is create the video file from the image and play the video file through a standard video player. Making a QuickTime movie or Flash movie from images isn't that hard. There are a lot of tools to help make movies from images. Almost any photo management solution can create a slide show and save it as a movie in some standard format.

Indeed, I think that Graphic Converter can do this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文