Pārlūkot izejas kodu

增加mp4格式转换工具方法

dengsixing 2 gadi atpakaļ
vecāks
revīzija
af99b4fe75

+ 2 - 0
4dkankan-common-utils/src/main/java/com/fdkankan/common/util/ConstantCmd.java

@@ -35,6 +35,8 @@ public class ConstantCmd {
 	//将mp4文件转换成flv
 	public static final String MP4_TO_FLV = "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 ";
 

+ 8 - 0
4dkankan-common-utils/src/main/java/com/fdkankan/common/util/CreateObjUtil.java

@@ -581,6 +581,14 @@ public class CreateObjUtil {
 		log.info("mp4文件转换成flv文件完毕:" + command);
 	}
 
+	//mp4文件转换成flv文件
+	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;