|
|
@@ -1,10 +1,14 @@
|
|
|
+import cn.reghao.dfs.store.service.media.MediaQuality;
|
|
|
+import cn.reghao.dfs.store.service.media.MediaResolution;
|
|
|
import cn.reghao.dfs.store.util.media.ImageOps;
|
|
|
+import cn.reghao.dfs.store.util.media.VideoOps;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.*;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author reghao
|
|
|
@@ -39,4 +43,21 @@ public class FileTest {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void videoQualityTest() throws IOException {
|
|
|
+ String filePath = "/run/media/reghao/98ecd3fd-ec20-4566-acfc-fba9b9c7c9c2/1ren.tv/32987234/rtmp_20220827_190000.mp4";
|
|
|
+ Map<String, Object> map = VideoOps.videoProps(new File(filePath));
|
|
|
+ int width = (Integer) map.get("width");
|
|
|
+ int height = (Integer) map.get("height");
|
|
|
+ boolean horizontal = width >= height;
|
|
|
+ int duration = ((Long) map.get("duration")).intValue();
|
|
|
+ double fps = (Double) map.get("fps");
|
|
|
+ int frameLength = (Integer) map.get("frameLength");
|
|
|
+ int length = (Integer) map.get("length");
|
|
|
+ String rotate = (String) map.get("rotate");
|
|
|
+
|
|
|
+ MediaResolution reqQuality = MediaQuality.getQuality(width, height);
|
|
|
+ System.out.println();
|
|
|
+ }
|
|
|
}
|