问题描述
目前,正常运行的原型具有所需的一切:半透明窗口,可以轻松调整要记录的位置,多个线程来管理屏幕截图等,但最后一项任务我需要它几个月来我一直没有找到。我需要将我在一个名为 temp
的文件夹中转储的所有图像(我在完成所有操作后删除)转换为电影。
Currently, the functioning prototype has everything it needs to work: A semi-transparent window for easy resizing on the place you want to record, multiple threads to manage screen shot taking, etc., but one last task I need it to do has eluded me for months. I need to convert all of the images I dumped in a folder I made called temp
(that I delete after everything is done) into a movie.
我已经找到但它是你在shell中使用的一种独立的东西。我需要调整它以便它只转换所有图像( screencapture1.jpg
, screencapture2.jpg
等等。)成一部电影。
I already have found this, but it is a standalone sort of thing you use in a shell. I need to just tweak it so that it just converts all the images (screencapture1.jpg
, screencapture2.jpg
, etc.) into a single movie.
为什么我自己不能这样做?因为我很难理解其他人的工作,所以编程语言。我不知道为什么,但除非这是最简单的事情,我似乎永远无法理解它。
Why can't I do this myself? Because I suck at understanding the work of other people, programming language-wise. I don't know why, but unless it's the simplest thing, I can never seem to understand it.
推荐答案
我会建议学习如何从java程序中调用外部程序。然后,您可以运行您链接到的示例程序。或者,如果您想要更多功能,请使用,它也会自动从命令行执行此操作:
I'd suggest just learning how to call external programs from your java program. Then you can just run that example program you linked to. Or if you want even more capability, use ffmpeg which will do this automatically from the command line as well:
ffmpeg -i screencapture%d.jpg -vcodec mpeg4 outfile.avi
ffmpeg允许您自定义有关输出视频的大量内容。只需查看所有选项的文档。
ffmpeg allows you to customize a lot of things about the output video. Just check out the documentation for all the options.
Java命令 Runtime.getRuntime()。exec(...)
将允许您运行传递它的任何命令行。如果你谷歌它有很多如何做到这一点的例子。
The Java command Runtime.getRuntime().exec(...)
will let you run whatever command line you pass it. There are many examples of how to do this if you Google it.
这篇关于将一系列图像转换为Java中的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!