从一系列图像创建一个视频流(AVI) [英] Create a Video Stream (AVI) from a Series of Images

查看:221
本文介绍了从一系列图像创建一个视频流(AVI)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个IP网络摄像头,我写了一个.NET类的某个时候前。这基本上是一个定时器实现,坪快照CGI脚本从相机中每五秒钟。相机本身是非常rudamentary;它没有任何类型的API为我工作着,​​我唯一能做的编程方式(远程)是调用此脚本。该脚本返回一个640×480的JPEG图像。简单的。

There is an IP web camera that I wrote a .NET class for sometime ago. It's basically a Timer implementation that pings a snapshot CGI script from the camera every five seconds. The camera itself is very rudamentary; it does not have any sort of API for me to work with, the only thing I can do programmatically (remotely) is invoke this script. The script returns a 640x480 JPEG image. Simple.

现在我需要能够做的就是一次值得这些图像的日子,并创建一个时间流逝的AVI视频流出来的,最终将被嵌入到网页中。我怎样才能做到这一点用VB.NET?

Now what I need to be able to do is take a days worth of these images, and create a "time lapse" AVI video stream out of it that will eventually be embedded into a web page. How can I do this with VB.NET?

推荐答案

.NET不直接支持的视频格式。你最好的选择是使用第三方工具来生成的.avi。

.net doesn't directly support video formats. Your best option would be to use a 3rd party tool to generate the .avi.

ffmpeg的是一种选择。您可以直接通过类似这样的命令行访问:

ffmpeg is one option. You could access it directly via a command line like this:

ffmpeg -f image2 -i img%d.jpg /output/a.mpg

您需要命名的图像img1.jpg,img2.jpg等详情请参阅 ffmpeg的常见问题解答。你也应该发现,在常见问题解答细节如何输出不同的视频格式。

You would need to name your images img1.jpg, img2.jpg etc. For more details see the ffmpeg faq. You should also find details in the faq for how to output different video formats.

您可以从VB使用的Process.Start()启动一个进程。事情是这样的:

You can start a process from vb using Process.Start(). Something like this:

Process.Start("ffmpeg.exe", "-f image2 -i img%d.jpg /output/a.mpg")

您也可以看看 ffmpeg的锐利或的 Tao.FFmpeg ,他们是.NET包装的ffmpeg的库。我没有尝试过任何个人,但看起来它可能会帮助你。

You could also take a look at ffmpeg-sharp or Tao.FFmpeg, they are .net wrappers for the ffmpeg libraries. I haven't tried either personally, but it looks like it might help you out.

另一种方法是将一起来看看男人codeR ,具有类似的功能。您应该能够查找此工具类似的命令行。

Another alternative would be to take a look at MEncoder, which has similar functionality. You should be able to look up a similar command line for this tool.

[相关SO问题:<一href="http://stackoverflow.com/questions/271003/anyone-know-of-a-set-of-c-bindings-for-ffmpeg">271003]

这篇关于从一系列图像创建一个视频流(AVI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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