如何使用FFMPEG与java? [英] How to use FFMPEG with java?

查看:339
本文介绍了如何使用FFMPEG与java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

这对我来说很好!



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



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



请分享你的想法..


解决方案

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


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.

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

Please share your thoughts..

解决方案

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

这篇关于如何使用FFMPEG与java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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