java 视频转码

闲话少说  直接上代码

jave2  github 地址 https://github.com/a-schild/jave2    


    ws.schild
    jave-all-deps
    2.6.0

 

File source = new File("");
File target = new File("");
AudioAttributes audio = new AudioAttributes();
audio.setCodec("aac");
VideoAttributes video = new VideoAttributes();
video.setCodec("h264");
video.setBitRate(new Integer(2325 * 1024));
//Encoding attributes
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp4");
attrs.setAudioAttributes(audio);
attrs.setVideoAttributes(video);
//Encode
Encoder encoder = new Encoder();
encoder.encode(new MultimediaObject(source), target, attrs);

你可能感兴趣的:(java8)