init
This commit is contained in:
@@ -9,9 +9,14 @@ import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
|
||||
import com.tencentcloudapi.faceid.v20180301.models.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class TencentAuthClient {
|
||||
|
||||
public static boolean faceDetectIsPass(String bizToken) {
|
||||
@@ -89,6 +94,23 @@ public class TencentAuthClient {
|
||||
// createToken(null,null);
|
||||
GetDetectInfoEnhancedResponse detectInfo = getDetectInfo("09792FA0-C269-401F-B8DB-E68B680E0728");
|
||||
System.out.println(JSON.toJSONString(detectInfo));
|
||||
base64ToVideo(detectInfo.getVideoData().getLivenessVideo(), "C:\\Users\\38320\\Desktop\\123\\123.mp4");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void base64ToVideo(String base64, String targetPath) {
|
||||
try {
|
||||
//base解密
|
||||
byte[] videoByte = new sun.misc.BASE64Decoder().decodeBuffer(base64);
|
||||
File videoFile = new File(targetPath);
|
||||
//输入视频文件
|
||||
FileOutputStream fos = new FileOutputStream(videoFile);
|
||||
fos.write(videoByte, 0, videoByte.length);
|
||||
fos.flush();
|
||||
fos.close();
|
||||
} catch (IOException e) {
|
||||
log.error("base64转换为视频异常",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user