public class Commands extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
HW_H264_ENC
启用的硬件加速的h264编码方式,例如 h264_nvenc
|
static String |
HWACCEL
启用的硬件加速方式,例如 cuvid
|
static String |
PATH_FFMPEG
ffmpeg 执行文件目录和文件名 ,例如 c:/ffmpeg/bin/ffmpeg.exe
|
static String |
PATH_FFPROBE
ffprobe 执行文件目录和文件名 ,例如 c:/ffmpeg/bin/ffprobe.exe
|
| 构造器和说明 |
|---|
Commands() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Command |
createConvert2Mp4(File sourceFile,
File outFile,
String codec,
long videoBitRate,
VideoScale outVideoScale,
Watermark waterMark)
转换成mp4文件
|
static Command |
createConvert2Mp4(String sourceFile,
String outFile,
String codec,
long videoBitRate,
VideoScale outVideoScale,
Watermark waterMark)
转换成mp4文件
|
static Command |
createCovert2TsCommand(File sourceFile,
File tsFile)
转换为ts文件
|
static Command |
createCovert2TsCommand(String sourceFileName,
String tsFileName)
转换为ts文件
|
static Command |
createGetCoverCommand(File sourceFile,
File coverImagePath)
创建 获取视频的一张封面图(关键帧)命令
|
static Command |
createGetCoverCommand(String sourceFile,
String coverImagePath)
创建 获取视频的一张封面图(关键帧)命令
|
static Command |
createM3u8Command(String sourceFile,
String m3u8IndexName,
String segmentPrefix)
创建 转码m3u8 视频格式文件,按照每5秒分割一个
|
static Command |
createM3u8Command(String sourceFile,
String m3u8IndexName,
String segmentPrefix,
int segmentTime)
创建 转码m3u8 视频格式文件
|
public static String PATH_FFMPEG
public static String PATH_FFPROBE
public static String HWACCEL
public static String HW_H264_ENC
public static Command createGetCoverCommand(File sourceFile, File coverImagePath)
sourceFile - 来源视频文件coverImagePath - 创建图片文件public static Command createGetCoverCommand(String sourceFile, String coverImagePath)
sourceFile - 来源视频文件路径coverImagePath - 创建图片路径public static Command createM3u8Command(String sourceFile, String m3u8IndexName, String segmentPrefix)
sourceFile - 来源文件m3u8IndexName - m3u8索引文件 (含输出目录)segmentPrefix - 分片文件前缀 (含输出目录)public static Command createM3u8Command(String sourceFile, String m3u8IndexName, String segmentPrefix, int segmentTime)
sourceFile - 来源文件m3u8IndexName - m3u8索引文件 (含输出目录)segmentPrefix - 分片文件前缀 (含输出目录)segmentTime - 分割的时间(秒)public static Command createCovert2TsCommand(File sourceFile, File tsFile)
sourceFile - 视频源文件tsFile - 输出ts视频文件public static Command createCovert2TsCommand(String sourceFileName, String tsFileName)
sourceFileName - 视频源,文件目录及文件名tsFileName - 输出ts视频,文件目录及文件名public static Command createConvert2Mp4(File sourceFile, File outFile, String codec, long videoBitRate, VideoScale outVideoScale, Watermark waterMark)
sourceFile - 原始文件outFile - 输出文件codec - 编码videoBitRate - 视频比特率 ,例如 2 * 1024 * 1024 /2koutVideoScale - 输出视频比例,400:-1, 1024:-1 ...waterMark - 在视频上添加的水印public static Command createConvert2Mp4(String sourceFile, String outFile, String codec, long videoBitRate, VideoScale outVideoScale, Watermark waterMark)
sourceFile - 原始文件outFile - 输出文件codec - 编码videoBitRate - 视频比特率 ,例如 2 * 1024 * 1024 /2koutVideoScale - 输出视频比例,400:-1, 1024:-1 ...waterMark - 在视频上添加的水印Copyright © 2021. All rights reserved.