最简单的视频流?
我有一台相机,可以一张一张地拍摄照片(大约每秒 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这根本行不通。
让视频发挥作用有一个技巧。 Apple 的 QuickTime 就实现了这一技巧。微软的一些产品也是如此。加上一些开源视频播放工具。
还有几个密切相关的招数,无一不是令人头疼的。
压缩。全尺寸视频很大。以每秒 30 帧的速度计算 640x480x24 位颜色。加起来很快。如果不进行压缩,您就无法足够快地读取它。
缓冲和计时。有时数据速率和帧速率不一致。您需要一个准备显示帧的缓冲区,并且需要一个非常精确的时钟来让它们以完全正确的间隔显示。
iPhoto 和 iMovie 的用途是将一系列 JPEG 图像制作成影片。
通常,我们所做的是从图像创建视频文件并通过标准视频播放器播放视频文件。从图像制作 QuickTime 影片或 Flash 影片并不难。有很多工具可以帮助从图像制作电影。几乎任何照片管理解决方案都可以创建幻灯片并将其另存为某种标准格式的电影。
事实上,我认为 Graphic Converter 可以做到这一点。
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.
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.
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.