如何在java中将视频文件压缩为3gp或mp4?
我有一个视频文件,我需要转换成3gp,mp4使用java 是否有任何库可以执行此操作或任何示例 如果你们中的任何人已经做过或知道样本,请指导我做上述工作或提供示例如何在java中将视频文件压缩为3gp或mp4?,java,Java,我有一个视频文件,我需要转换成3gp,mp4使用java 是否有任何库可以执行此操作或任何示例 如果你们中的任何人已经做过或知道样本,请指导我做上述工作或提供示例 谢谢使用像ffmpeg()或mconvert(from)或之类的工具。您可以使用ProcessBuilder或。使用ffmpeg()或mconvert(from)或之类的工具从Java调用它们。您可以使用ProcessBuilder或。从Java调用它们。但它是一个web服务。您可能已经看过了。但它是一个web服务。如果必须使用Jav
谢谢使用像
ffmpeg
()或mconvert
(from)或之类的工具。您可以使用ProcessBuilder
或。使用ffmpeg
()或mconvert
(from)或之类的工具从Java调用它们。您可以使用ProcessBuilder
或。从Java调用它们。但它是一个web服务。您可能已经看过了。但它是一个web服务。如果必须使用Java,请检查Java媒体框架
如果必须使用Java,请检查Java媒体框架
用java压缩视频您可以使用IVCompressor 非常容易使用
欲了解更多详情,请访问 简单代码
<dependency>
<groupId>io.github.techgnious</groupId>
<artifactId>IVCompressor</artifactId>
<version>1.0.1</version>
</dependency>
public static void main(String[] args) throws VideoException, IOException {
IVCompressor compressor = new IVCompressor();
IVSize customRes = new IVSize();
customRes.setWidth(400);
customRes.setHeight(300);
File file = new File("D:/Testing/20.mp4");
compressor.reduceVideoSizeAndSaveToAPath(file,VideoFormats.MP4,ResizeResolution.R480P,"D:/Testing/Custome");
}
io.github.techgnious
IVA压缩机
1.0.1
公共静态void main(字符串[]args)引发VideoException、IOException{
IVCompressor压缩机=新的IVCompressor();
IVSize customRes=新的IVSize();
自定义设置宽度(400);
客户设置高度(300);
File File=新文件(“D:/Testing/20.mp4”);
compressor.reducevideosizeandsavetopath(文件,VideoFormats.MP4,ResizeResolution.R480P,“D:/Testing/Custome”);
}
用java压缩视频您可以使用IVCompressor
非常容易使用欲了解更多详情,请访问 简单代码
<dependency>
<groupId>io.github.techgnious</groupId>
<artifactId>IVCompressor</artifactId>
<version>1.0.1</version>
</dependency>
public static void main(String[] args) throws VideoException, IOException {
IVCompressor compressor = new IVCompressor();
IVSize customRes = new IVSize();
customRes.setWidth(400);
customRes.setHeight(300);
File file = new File("D:/Testing/20.mp4");
compressor.reduceVideoSizeAndSaveToAPath(file,VideoFormats.MP4,ResizeResolution.R480P,"D:/Testing/Custome");
}
io.github.techgnious
IVA压缩机
1.0.1
公共静态void main(字符串[]args)引发VideoException、IOException{
IVCompressor压缩机=新的IVCompressor();
IVSize customRes=新的IVSize();
自定义设置宽度(400);
客户设置高度(300);
File File=新文件(“D:/Testing/20.mp4”);
compressor.reducevideosizeandsavetopath(文件,VideoFormats.MP4,ResizeResolution.R480P,“D:/Testing/Custome”);
}