|
package com.jd.brand.approve.controller.approve;
import org.bytedeco.ffmpeg.global.avcodec;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import java.io.File;
public class VideoDecoder {//HEVC,AAC
public static void main(String[] args) {
String videoPath = "/Users/xuhaojie/Desktop/视频.mp4"; // 视频文件路径
try {
final FFmpegFrameGrabber fFmpegFrameGrabber = new FFmpegFrameGrabber(videoPath);
fFmpegFrameGrabber.start();
final int videoCodec = fFmpegFrameGrabber.getVideoCodec();
final String videoCodecName = fFmpegFrameGrabber.getVideoCodecName();
System.out.println("h264:" + avcodec.AV_CODEC_ID_H264);
System.out.println("h265:" + avcodec.AV_CODEC_ID_H265);
System.out.println("hevc:" + avcodec.AV_CODEC_ID_HEVC);
System.out.println(videoCodec);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|