简体   繁体   English

来自图像的简单视频制作者

[英]Simple videomaker from images

My application generates a set images named sequentially. 我的应用程序生成一个按顺序命名的集合 Eg. 例如。 img1, img2, img3, ... img1,img2,img3,...

I am looking for ways to convert these images into a movie. 我正在寻找将这些图像转换为电影的方法。 So far, I found these options, each with a major disadvantage : 到目前为止,我发现了这些选项,每个选项都有一个主要缺点:

  • ffmpeg - can do the job over command line interface. ffmpeg - 可以通过命令行界面完成工作。 But I need the utility to be an application, not a command line interface. 但我需要该实用程序是一个应用程序,而不是命令行界面。 (Can it be made into an exe?) (它可以成为一个exe吗?)
  • matlab - don't have matlab installed, cost is a concern matlab - 没有安装matlab,成本是一个值得关注的问题
  • Flash - don't know how it's done Flash - 不知道它是如何完成的
  • C++ - No standard library approach, looks complicated through Windows API C ++ - 没有标准库方法,通过Windows API看起来很复杂

Ideally, the utility will be an executable when launched will read all the sequentially named images in its root and generate a video (any format - .avi, .wmv, etc) 理想情况下,该实用程序在启动时将是一个可执行文件,将在其根目录中读取所有按顺序命名的图像并生成视频(任何格式 - .avi,.wmv等)

As this page says: http://www.codeproject.com/Articles/4169/A-simple-interface-to-the-Video-for-Windows-API-fo 正如此页面所示: http//www.codeproject.com/Articles/4169/A-simple-interface-to-the-Video-for-Windows-API-fo

You can do it with Windows API for AVI, just you need to do: 您可以使用适用于AVI的Windows API执行此操作,只需执行以下操作:

#include "aviUtil.h".
Call START_AVI("foo.avi"); // you must include the .avi extention.
Call ADD_FRAME_FROM_DIB_TO_AVI(yourDIB, "DIB", 30); // the dib is passed in as a HANDLE which can be obtained by loading the image with a Image library. (I used CxImage which is available on this site). Put this call in a while or for loop to add all the images you want to the AVI.
Call STOP_AVI(); //this closes the avi and video.

There is a sample on that page. 该页面上有一个示例。 It does exactly what you want 它完全符合你的要求

ffmpeg is built on top of several C libraries, which can be found available through the Libav project (or distributed with ffmpeg itself). ffmpeg建立在几个C库之上,可以通过Libav项目找到它们(或者用ffmpeg本身分发)。 It provides several audio and video encoding and decoding options that may be of interest. 它提供了一些可能感兴趣的音频和视频编码和解码选项。

Buried in the documentation is a set of examples, available here . 文档中埋藏了一组示例,可在此处获得 The video encoding function is I believe the basis of what you want to do. 视频编码功能是我相信你想做的事情的基础。

And no, sadly, I can't promise that the API is very well documented or comprehensible. 不,遗憾的是,我不能保证API有很好的文档记录或可理解性。 You can find scattered examples across the internet implementing the library. 您可以在互联网上找到实施该库的零散示例。

Using OpenCV may help. 使用OpenCV可能会有所帮助。

You can look at THIS tutorial. 你可以看一下这个教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM