ソースを参照

增加视频转换方法

dengsixing 2 年 前
コミット
10874bb6b9

+ 2 - 0
4dkankan-utils-model/src/main/java/com/fdkankan/model/constants/ConstantCmd.java

@@ -35,6 +35,8 @@ public class ConstantCmd {
 	//将mp4文件转换成flv
 	public static final String MP4_TO_FLV = "sudo bash /monchickey/ffmpeg/bin/ff_mp4TOflv.sh ";
 
+	public static final String FORMAT_MP4 = "bash /monchickey/ffmpeg/bin/ff_formatMp4.sh ";
+
 	//删除/mnt/data/下的数据脚本
 	public static final String DELETE_FILE = "bash /monchickey/ffmpeg/bin/delete.sh ";
 

+ 7 - 0
4dkankan-utils-model/src/main/java/com/fdkankan/model/utils/CreateObjUtil.java

@@ -578,6 +578,13 @@ public class CreateObjUtil {
 		log.info("mp4文件转换成flv文件完毕:" + command);
 	}
 
+	public static void formatMp4(String oldVideo, String newVideo) throws Exception{
+		String command = ConstantCmd.FORMAT_MP4 + " " + oldVideo + " " + newVideo;
+		log.info("mp4格式转换开始:{}", command);
+		callshell(command);
+		log.info("mp4格式转换完毕:{}", command);
+	}
+
 	//删除/mnt/data/下的数据
 	public static void deleteFile(String filePath) throws Exception{
 		String command = ConstantCmd.DELETE_FILE + " " + filePath;