Prechádzať zdrojové kódy

formatCovert 方法添加视频封装格式参数

reghao 2 rokov pred
rodič
commit
67050eb563

+ 3 - 3
media/src/main/java/cn/reghao/jutil/media/FFmpegWrapper.java

@@ -109,9 +109,9 @@ public class FFmpegWrapper {
         return null;
     }
 
-    public static int formatCovert(String srcPath, String destPath) {
-        String cmd = String.format("%s -loglevel error -y -i '%s' -c:a aac -c:v libx264 -f mp4 '%s'",
-                ffmpeg, srcPath, destPath);
+    public static int formatCovert(String srcPath, String destPath, String format) {
+        String cmd = String.format("%s -loglevel error -y -i '%s' -c:a aac -c:v libx264 -f %s '%s'",
+                ffmpeg, srcPath, format, destPath);
         return Shell.exec(cmd);
     }