如何在 Java 中使用 FFMPEG?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10612871/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 01:49:16  来源:igfitidea点击:

How to use FFMPEG with java?

javaffmpeg

提问by Shyam

I'm using the following command to convert sequence of images to a video.

我正在使用以下命令将图像序列转换为视频。

ffmpeg -r 1 -i sample%d.png -s 320x240 -aspect 4:3 output.flv

This works fine for me!

这对我来说很好用!

Now i'm trying to use the above command to run through java code.

现在我正在尝试使用上面的命令来运行 java 代码。

How can i run the ffmpeg command using Runtime.getRuntime()from my java code.

如何使用Runtime.getRuntime()我的 java 代码运行 ffmpeg 命令。

Please share your thoughts..

请分享您的想法..

回答by Yusuf X

Runtime.getRuntime().exec("ffmpeg -r 1 -i sample%d.png -s 320x240 -aspect 4:3 output.flv");