java实现视频压缩

weblog 1295 0 0

测试类

package it.sauronsoftware.main;
import java.io.File;

import it.sauronsoftware.jave.AudioAttributes;
import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.EncoderException;
import it.sauronsoftware.jave.EncodingAttributes;
import it.sauronsoftware.jave.VideoAttributes;

public class Snippet {
    public static void main(String[] args) {
        File source = new File("E:\\test\\2019.mp4");
        File target = new File("E:\\test\\2019-1.mp4");
        try {
            AudioAttributes audio = new AudioAttributes();
            audio.setCodec("libmp3lame");
            audio.setBitRate(new Integer(56000));
            audio.setChannels(new Integer(1));
            audio.setSamplingRate(new Integer(22050));
            VideoAttributes video = new VideoAttributes();
            video.setCodec("mpeg4");
            video.setBitRate(new Integer(800000));
            video.setFrameRate(new Integer(15));
            EncodingAttributes attrs = new EncodingAttributes();
            attrs.setFormat("mp4");
            attrs.setAudioAttributes(audio);
            attrs.setVideoAttributes(video);
            Encoder encoder = new Encoder();
            encoder.encode(source, target, attrs);
        } catch (EncoderException e) {
            e.printStackTrace();
        }
    }
}
猜你喜欢
工具 1464 javazip工具类packagecom.dzqc.yx.util;importjava.io.File;importjava.io.FileInputStream
java基础 1427 java文件参考:http://www.jiajiajia.club/blog/artical/1en1qpemej45/499一
win rar 989 winrar工具(windows)自从电脑被p2p垃圾软件恶意捆绑了一堆垃圾软件后,对这种软件有了后遗症。安装的时候要小心。
算法基础 1520 前端项目正式发布时一般需要混淆js、css文件等,一方面能够使文件体积更小,更多的节约网络io资源,另一方面能避免被人读懂你的代码!!!!!!工具可以使用uglifyjs2。安装通过npm安
java基础 958 核心类ZipOutputStream的api文档请参考:https://nowjava.com/docs/java-api-11/java.base/java/util/zip
工具 5590 java完美html转pdf1.pom依赖:dependencygroupIdcom.itextpdf/groupIdartifactIditextpdf
前端,javascript 80 =device-width,initial-scale=1.0" title图片拖拽与放/title style #content{ } /style /head body divid="content
webrtc,srs,音视频 994 ://nginx.org/download/nginx-1.13.7.tar.gz#解并进入目录[root@localhostlocal]tar-zxvfnginx-1.13.7.tar.gz[root
目录