Browse Source

feat: 更新java工具

hexleo 5 years ago
parent
commit
e799814c9e

+ 1 - 0
Android/PlayerProj/animtool/src/main/java/com/tencent/qgame/playerproj/animtool/AnimTool.java

@@ -26,6 +26,7 @@ public class AnimTool {
 
     private static final String TAG = "AnimTool";
 
+    public static final String OUTPUT_DIR = "output"+ File.separator;
     public static final String FRAME_IMAGE_DIR = "frames"+ File.separator;
     public static final String VIDEO_FILE = "video.mp4";
     public static final String TEM_VIDEO_FILE = "tmp_video.mp4";

+ 2 - 1
Android/PlayerProj/animtool/src/main/java/com/tencent/qgame/playerproj/animtool/CommonArg.java

@@ -30,12 +30,13 @@ public class CommonArg {
 
     public String inputPath; // 输入帧文件地址
 
-    public String outputPath; // 输出地址
 
 
     /**
      * 无需手动配置
      */
+    public String outputPath; // 输出地址
+
     public String frameOutputPath; // 帧图片输出路径
 
     public int version = 2;

+ 5 - 4
Android/PlayerProj/animtool/src/main/java/com/tencent/qgame/playerproj/animtool/CommonArgTool.java

@@ -19,6 +19,9 @@ class CommonArgTool {
      */
     static boolean autoFillAndCheck(CommonArg commonArg) throws Exception {
 
+        String os = System.getProperty("os.name");
+        TLog.i(TAG, os);
+
         //  路径检查
         File input = new File(commonArg.inputPath);
         if (!input.exists()) {
@@ -29,10 +32,8 @@ class CommonArgTool {
         if (!File.separator.equals(commonArg.inputPath.substring(commonArg.inputPath.length() - 1))) {
             commonArg.inputPath = commonArg.inputPath + File.separator;
         }
-        if (!File.separator.equals(commonArg.outputPath.substring(commonArg.outputPath.length() - 1))) {
-            commonArg.outputPath = commonArg.outputPath + File.separator;
-        }
-
+        // output path
+        commonArg.outputPath = commonArg.inputPath + AnimTool.OUTPUT_DIR;
 
         // 帧图片生成路径
         commonArg.frameOutputPath = commonArg.outputPath + AnimTool.FRAME_IMAGE_DIR;

+ 2 - 10
Android/PlayerProj/animtool/src/main/java/com/tencent/qgame/playerproj/animtool/Main.java

@@ -16,16 +16,11 @@
 package com.tencent.qgame.playerproj.animtool;
 
 
-
 public class Main {
 
 
     public static void main(String[] args) throws Exception {
-        try {
-            animTool();
-        } catch (Throwable throwable) {
-            throwable.printStackTrace();
-        }
+        animTool();
     }
 
 
@@ -60,16 +55,13 @@ public class Main {
         /*
          * 是否开启h265(默认关闭)
          * 优点:压缩率更高,视频更清晰
-         * 缺点:Android 4.x系统 & 部分低端机 无法播放265视频
+         * 缺点:Android 4.x系统 & 极少部分低端机 无法播放265视频
          */
         commonArg.enableH265 = true;
         // fps
         commonArg.fps = 24;
         // 素材文件路径
         commonArg.inputPath = "/path/to/your/demo";
-        // 中间素材输出路径
-        commonArg.outputPath = commonArg.inputPath + "/output";
-
 
         // 开始运行
         AnimTool animTool = new AnimTool();