代码拉取完成,页面将自动刷新
package cn.angs;
import java.io.File;
import java.io.InputStream;
/**
* ClassName: Test.java
* Description:
*
* @author wangshun@cloudwalk.cn
* @version 1.0.0
* @date 2021/07/22 13:55
*/
public class Test {
public static void main(String[] args) throws Exception {
System.out.println(Test.class.getClassLoader().getResource(""));
File source = new File("C:\\Users\\YCKJ2817\\Desktop\\测试\\123.flv");
File target = new File("C:\\Users\\YCKJ2817\\Desktop\\测试\\1234.mp4");
Encoder encoder = new Encoder();
MultimediaInfo info = null;
try {
info = encoder.getInfo(source);
} catch (EncoderException e) {
e.printStackTrace();
}
System.out.println(info.getFormat());
try {
VideoAttributes video = new VideoAttributes();
video.setCodec("libx264");
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp4");
attrs.setVideoAttributes(video);
encoder.encode(source, target, attrs);
} catch (IllegalArgumentException | EncoderException e) {
e.printStackTrace();
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。