public class FfmpegUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
FfmpegUtils.ACodecs
音频编码格式
|
class |
FfmpegUtils.FormatParams
视频编码信息
|
static class |
FfmpegUtils.VCodecs
视频编码格式
|
| 限定符和类型 | 字段和说明 |
|---|---|
FfmpegUtils.FormatParams |
formatParams
视频编码参数
|
| 构造器和说明 |
|---|
FfmpegUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getFfmpegBin() |
String |
getFfprobeBin() |
FfmpegUtils.FormatParams |
getFormatParams() |
void |
initEncodingFormat(String filePath)
获取视频编码信息
|
void |
setFfmpegBin(String ffmpegBin) |
void |
setFfprobeBin(String ffprobeBin) |
void |
setFormatParams(FfmpegUtils.FormatParams formatParams) |
String |
transcode(String inputPath,
String outputPath,
FfmpegUtils.VCodecs vcodec)
简单转码,默认音频编码为AAC
|
String |
transcode(String inputPath,
String outputPath,
FfmpegUtils.VCodecs vcodec,
FfmpegUtils.ACodecs acodec)
简单转码
|
String |
transcodeH264(String inputPath,
String outputPath)
简单转码,转码为H264编码
|
public FfmpegUtils.FormatParams formatParams
public void initEncodingFormat(String filePath) throws Exception
filePath - 视频文件路径Exceptionpublic String transcodeH264(String inputPath, String outputPath)
inputPath - 源视频文件地址outputPath - 输出视频文件地址public String transcode(String inputPath, String outputPath, FfmpegUtils.VCodecs vcodec)
inputPath - 源视频文件地址outputPath - 输出视频文件地址vcodec - 视频编码public String transcode(String inputPath, String outputPath, FfmpegUtils.VCodecs vcodec, FfmpegUtils.ACodecs acodec)
inputPath - 源视频文件地址outputPath - 输出视频文件地址vcodec - 视频编码acodec - 音频编码public String getFfmpegBin()
public void setFfmpegBin(String ffmpegBin)
public String getFfprobeBin()
public void setFfprobeBin(String ffprobeBin)
public FfmpegUtils.FormatParams getFormatParams()
public void setFormatParams(FfmpegUtils.FormatParams formatParams)
Copyright © 2022. All rights reserved.