合作的方式,利用在C#中的图像视频 [英] Working way to make video from images in C#

查看:124
本文介绍了合作的方式,利用在C#中的图像视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人有一个已知可靠的方法来从一系列图像文件的视频?你mod我失望张贴问题之前,不寻找答案,你火了像一个简单的消息之前使用FFMPEG,读此消息的其余部分之前。

Does anybody have a known reliable way to create a video from a series of image files? Before you mod me down for not searching for the answer before posting the question, and before you fire off a simple message like "use FFMPEG," read the rest of this message.

我试图创建一个视频,它并没有太大的关系是什么,只要它的广泛的支持,从一系列图像(.JPG,.BMP等)的格式。我的平台是Windows Server 2008中,64位。如果我可以从我的C#程序中作出的视频,这是伟大的,但我不反对写一系列图像文件到一个目录,然后发射了外部程序,从这些图像进行视频。

I'm trying to create a video, it doesn't matter too much what format as long as it's widely supported, from a series of images (.jpg, .bmp, etc.). My platform is Windows Server 2008, 64-bit. If I can make the video from within my C# program, that's great, but I'm not averse to writing a series of image files to a directory and then firing off an external program to make a video from those images.

唯一的限制是:它必须我的Windows Server 2008系统上工作,并编写脚本。也就是说,需要操作人员的干预没有GUI程序。

The only constraints are: it must work on my Windows Server 2008 system, and be scriptable. That is, no GUI programs that require operator intervention.

我发现了一些在计算器上类似的问题,并尝试了好几种解决方案,都伴有不同程度的挫折,没有与成功一样东西。

I found a number of similar questions on StackOverflow, and have tried several of the solutions, all with varying degrees of frustration and none with anything like success.

FFMPEG看起来像一个伟大的计划。也许是,在Linux上。两个窗口建立我下载被打破。鉴于此命令行:

FFMPEG looks like a great program. Maybe it is, on Linux. The two Windows builds I downloaded are broken. Given this command line:

  ffmpeg -r 1 -f image2 -i jpeg\*.jpg video.avi

之一建立读取图像,然后崩溃由于数据执行prevention。另读取第一个文件,然后吐出来,说:找不到文件JPEG / image2.jpg适合codeC的错误消息。乐于助人,那个。在任何情况下,FFMPEG看起来像在Windows下一个非首发。

One of the builds reads the images and then crashes due to data execution prevention. The other reads the first file and then spits out an error message that says "cannot find suitable codec for file jpeg/image2.jpg". Helpful, that. In any case, FFMPEG looks like a non-starter under Windows.

一个答案到previous发帖建议捻接器。它看起来像pretty好code。我整理样品,并试图运行,但有大约找不到文件中的一些神秘的错误消息。它看起来像一个COM类没有注册。我想我需要安装的东西(的DirectShow,也许,虽然我认为这是已经安装了?)。根据需要的是什么,我可能有困难的时候,证明其安装在服务器上。 (什么?你为什么需要在服务器上?)

One answer to a previous posting recommended Splicer . It looks like pretty good code. I compiled the samples and tried to run, but got some cryptic error message about a file not found. It looks like a COM class isn't registered. I suppose I need to install something (DirectShow, maybe, although I thought that was already installed?). Depending on what's required, I might have a difficult time justifying its installation on a server. ("What? Why do you need that on a server?")

另一个答案建议 AVIFILE 库。这看起来很简单:各地的Windows AVIFILE子系统的包装。除了AVI文件包创建似乎有所有的帧,但只在第一帧显示了当我在Windows Media Player播放AVI。嗯,如果你尝试创建一个COM pressed视频,程序会抛出异常。

Another answer suggested the AviFile library from Code Project. That looks simple enough: a wrapper around the Windows AviFile subsystem. Except that the AVI files the package creates appear to have all of the frames, but only the first frame shows when I play the AVI in Windows Media Player. Well, that and if you try to create a compressed video, the program throws an exception.

所以,我在想,如果有一个很好的,可靠的方法做我想做的:在Windows系统上,创建一系列图像的AVI或其他常见的视频文件格式,无论是通过.NET API或使用外部程序。任何帮助吗?

So, I'm left wondering if there is a good, reliable way to do what I want: on a Windows system, create an AVI or other common video file format from a series of images, either through a .NET API or using an external program. Any help?

推荐答案

与它的工作了一段时间,并采取看看X264和VideoLAN的后,我又回到了捻接器。事实证明,在神秘的错误信息是由于我的code错误。

After working with it a while and taking a look at x264 and VideoLan, I went back to Splicer. It turns out that the cryptic error message was due to an error in my code.

它看起来像捻接器将做我想做的:编程方式从一系列图像创建视频

It looks like Splicer will do what I want: programmatically create videos from a series of images.

感谢所有谁回答。

这篇关于合作的方式,利用在C#中的图像视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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