使用 java-ffmpeg 包装器,还是简单地使用 java 运行时来执行 ffmpeg? [英] use java-ffmpeg wrapper, or simply use java runtime to execute ffmpeg?

查看:28
本文介绍了使用 java-ffmpeg 包装器,还是简单地使用 java 运行时来执行 ffmpeg?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Java 很陌生,需要编写一个程序来监听视频转换指令并在新指令到达时转换视频(指令存储在 Amazon SQS 中,但这与我的问题无关)

I'm pretty new to Java, need to write a program that listen to video conversion instructions and convert the video once an new instruction arrives (instructions is stored in Amazon SQS, but it's irrelevant to my question)

我面临一个选择,要么使用 Java RunTime 来执行 'ffmpeg' 转换(比如从命令行),或者我可以使用用 Java 编写的 ffmpeg 包装器 http://fmj-sf.net/ffmpeg-java/getting_started.php

I'm facing a choice, either use Java RunTime to exec 'ffmpeg' conversion (like from command line), or I can use a ffmpeg wrapper written inJava http://fmj-sf.net/ffmpeg-java/getting_started.php

我更喜欢使用 Java 运行时直接执行 ffmpeg,并避免使用 java-ffmpeg 包装器,因为我必须学习该库.所以我的问题是直接使用运行时使用 java-ffmpeg 包装器而不是 exec ffmpeg 有什么好处吗?我不需要 ffmpeg 来播放视频,只需转换视频

I'd much prefer using Java Runtime to exec ffmpeg directly, and avoid using java-ffmpeg wrapper as I have to learn the library. so my question is are there any benefits using java-ffmpeg wrapper over exec ffmpeg directly using Runtime? I don't need ffmpeg to play videos, just convert videos

谢谢

推荐答案

如果我没记错的话,您链接的ffmpeg 包装器"项目已过时且未维护.ffmpeg 是一个非常活跃的项目,一直有很多变化和发布.

If I'm not mistaken, the "ffmpeg wrapper" project you linked to is out of date and not maintained. ffmpeg is a very active project, lot's of changes and releases all the time.

您应该查看 Xuggler 项目,它为您想要做的事情提供了一个 Java API,并且它们与 ffmpeg 紧密集成.

You should look at the Xuggler project, this provides a Java API for what you want to do, and they have tight integration with ffmpeg.

http://www.xuggle.com/xuggler/

如果你选择沿着 Runtime.exec() 路径走下去,这个 Red5 线程应该很有用:

Should you choose to go down the Runtime.exec() path, this Red5 thread should be useful:

http://www.nabble.com/java-call-ffmpeg-ts15886850.html

这篇关于使用 java-ffmpeg 包装器,还是简单地使用 java 运行时来执行 ffmpeg?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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