如何根据一组图像编写电影的脚本? [英] How can I script the creation of a movie from a set of images?

查看:133
本文介绍了如何根据一组图像编写电影的脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法使用Python加载了一组图像.

我希望我的脚本拍摄这一系列图像(以我需要的任何格式),并从中创建视频.所有这些的最大限制是我正在寻找易于安装的东西.理想情况下,使用标准的OS X安装过程:

  • 下载.dmg
  • 点击
  • 移至应用程序文件夹

我不想花费很多精力来安装视频编辑程序.只是一些简单的可行的方法.


问题

  1. 我应该瞄准什么格式?我需要我的视频能够在Linux,Mac和Windows系统上播放.这些图像是图形,因此我们所说的是谨慎的图像,而不是照片.压缩它应该很容易.大约有1000张图像,所以这将是一部短片.

  2. 我应该使用哪些工具来制作实际的视频?我需要使用为此目的而设计的库从Python直接执行此操作,或者通过编写从Python调用的命令行工具来编写脚本.

解决方案

如果您不反对使用命令行,则可以使用ImageMagick软件包中的convert命令.它适用于Mac,Linux和Windows.参见 http://www.imagemagick.org/script/index.php .. >

它支持多种图像格式,您可以将电影输出为mpeg文件:

convert -quality 100 *.png outvideo.mpeg

或作为动画gif以便上传到网页:

convert -set delay 3 -loop 0 -scale 50% *.png animation.gif

convert命令的更多选项可在此处获得: ImageMagick v6示例- 动画基础

I managed to get a set of images loaded using Python.

I'd like my script to take this series of images (in whatever format I need them), and create a video from them. The big limit in all this is that I am looking for something easy and simple to install. Ideally, using the standard OS X installation procedure:

  • download .dmg
  • click
  • move into the application folder

I do not want to expend a lot of effort to install the video editing program. Just something simple that works.


Questions

  1. What format should I aim for? I need my video to be playable on Linux, Mac, and Windows systems. The images are graphs, so we are speaking of discreet images, not photographs. It should be pretty easy to compress it. There will be about 1000 images, so this will be a short movie.

  2. What tools should I use to produce the actual video? I need to either do it directly from Python using a library designed for this purpose, or by scripting command-line tools called from Python.

解决方案

If you're not averse to using the command-line, there's the convert command from the ImageMagick package. It's available for Mac, Linux, Windows. See http://www.imagemagick.org/script/index.php.

It supports a huge number of image formats and you can output your movie as an mpeg file:

convert -quality 100 *.png outvideo.mpeg

or as animated gifs for uploading to webpages:

convert -set delay 3 -loop 0 -scale 50% *.png animation.gif

More options for the convert command available here: ImageMagick v6 Examples - Animation Basics

这篇关于如何根据一组图像编写电影的脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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