git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Tue, 22 Mar 2022 13:02:31 +0000 (13:02 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Tue, 22 Mar 2022 13:02:31 +0000 (13:02 +0000)
server/user.jobengine.osgi.commons/src/user/commons/mediaarea/MediaArea.java

index b7aaed57d64491ee691f3b87536df87e904e38c0..6fa5251b9850bf89e914076d004f459e325f8205 100644 (file)
@@ -6,13 +6,19 @@ public class MediaArea {
 \r
        private Path filePath;\r
        private int height;\r
+       private int width;\r
        private String displayAspect;\r
        private String formatProfile = "";\r
        private long frameCount;\r
+       private double frameRate;\r
+       private String format;\r
 \r
        public MediaArea(Path filePath) {\r
                this.filePath = filePath;\r
+       }\r
 \r
+       public Path getFilePath() {\r
+               return filePath;\r
        }\r
 \r
        public String getDisplayAspect() {\r
@@ -27,9 +33,25 @@ public class MediaArea {
                return height;\r
        }\r
 \r
+       public int getWidth() {\r
+               return width;\r
+       }\r
+\r
+       public long getFrameCount() {\r
+               return frameCount;\r
+       }\r
+\r
+       public double getFrameRate() {\r
+               return frameRate;\r
+       }\r
+\r
+       public String getFormat() {\r
+               return format;\r
+       }\r
+\r
        public String inform() {\r
                String result = null;\r
-               //auto closable\r
+               // auto closable\r
                try (MediaInfo mi = new MediaInfo(filePath.toAbsolutePath().toString())) {\r
                        result = mi.inform();\r
                } catch (Exception ex) {\r
@@ -39,19 +61,17 @@ public class MediaArea {
        }\r
 \r
        public void process() {\r
-               //auto closable\r
+               // auto closable\r
                try (MediaInfo mi = new MediaInfo(filePath.toAbsolutePath().toString())) {\r
                        height = Integer.parseInt(mi.get(StreamKind.Video, 0, "Height"));\r
+                       width = Integer.parseInt(mi.get(StreamKind.Video, 0, "Width"));\r
                        displayAspect = mi.get(StreamKind.Video, 0, "DisplayAspectRatio/String");\r
                        formatProfile = mi.get(StreamKind.Video, 0, "Format_Profile").toUpperCase();\r
+                       format = mi.get(StreamKind.Video, 0, "Format").toUpperCase();\r
+                       frameRate = Double.parseDouble(mi.get(StreamKind.Video, 0, "FrameRate"));\r
                        frameCount = Integer.parseInt(mi.get(StreamKind.Video, 0, "FrameCount"));\r
                } catch (Exception ex) {\r
                        throw new RuntimeException(ex);\r
                }\r
-\r
-       }\r
-\r
-       public long getFrameCount() {\r
-               return frameCount;\r
        }\r
 }\r