\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
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
}\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