| @@ -424,6 +424,7 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @AuthIgnore | |||||
| @ApiOperation("视频超分") | @ApiOperation("视频超分") | ||||
| @GetMapping("/videoHy") | @GetMapping("/videoHy") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| @@ -439,26 +440,22 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| if (StringUtils.isEmpty(speakVideo.getSaveDir())){ | if (StringUtils.isEmpty(speakVideo.getSaveDir())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"save_dir为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"save_dir为空"); | ||||
| } | } | ||||
| if(!speakVideo.getUserId().equals(getMemberId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到用户数据"); | |||||
| } | |||||
| if(!EnumVideoStatus.upload_success.getCode().equals(speakVideo.getVideoStatus())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"原始视频生成未完成"); | |||||
| } | |||||
| // if(!speakVideo.getUserId().equals(getMemberId())){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到用户数据"); | |||||
| // } | |||||
| if(EnumVideoStatus.ing.getCode().equals(speakVideo.getVideoHyStatus()) | |||||
| || EnumVideoStatus.success.getCode().equals(speakVideo.getVideoHyStatus()) | |||||
| || EnumVideoStatus.upload_ing.getCode().equals(speakVideo.getVideoHyStatus()) | |||||
| || EnumVideoStatus.upload_fail.getCode().equals(speakVideo.getVideoHyStatus())){ | |||||
| if(EnumVideoStatus.hy_ing.getCode().equals(speakVideo.getVideoStatus()) | |||||
| || EnumVideoStatus.hy_success.getCode().equals(speakVideo.getVideoStatus()) | |||||
| || EnumVideoStatus.hy_upload_ing.getCode().equals(speakVideo.getVideoStatus()) | |||||
| || EnumVideoStatus.hy_upload_fail.getCode().equals(speakVideo.getVideoStatus())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频生成中"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频生成中"); | ||||
| } | } | ||||
| if(EnumVideoStatus.upload_success.getCode().equals(speakVideo.getVideoHyStatus())){ | |||||
| if(EnumVideoStatus.hy_upload_success.getCode().equals(speakVideo.getVideoStatus())){ | |||||
| //上传阿里云状态 生成成功 | //上传阿里云状态 生成成功 | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频已生成完成"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频已生成完成"); | ||||
| } | } | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.ing.getCode()); | |||||
| speakVideo.setVideoStatus(EnumVideoStatus.hy_ing.getCode()); | |||||
| speakVideo.setVideoMsg(""); | speakVideo.setVideoMsg(""); | ||||
| speakVideo.setIsHy(EnumYesOrNo.YES.getCode()); | speakVideo.setIsHy(EnumYesOrNo.YES.getCode()); | ||||
| speakVideo.setUpdateDate(new Date()); | speakVideo.setUpdateDate(new Date()); | ||||
| @@ -85,7 +85,7 @@ public class VideoCallbackController extends BaseController { | |||||
| if (Integer.parseInt(code) != 4000){ | if (Integer.parseInt(code) != 4000){ | ||||
| String returnMsg; | String returnMsg; | ||||
| if (sr){ | if (sr){ | ||||
| photoSpeakVideo.setVideoHyStatus(EnumVideoStatus.fail.getCode()); | |||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| returnMsg = "超分视频生成失败"; | returnMsg = "超分视频生成失败"; | ||||
| }else { | }else { | ||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | ||||
| @@ -106,7 +106,7 @@ public class VideoCallbackController extends BaseController { | |||||
| } | } | ||||
| if (sr){ | if (sr){ | ||||
| photoSpeakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); | |||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.hy_success.getCode()); | |||||
| }else { | }else { | ||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.success.getCode()); | photoSpeakVideo.setVideoStatus(EnumVideoStatus.success.getCode()); | ||||
| } | } | ||||
| @@ -24,9 +24,10 @@ public class BaiduImageCheckUtil { | |||||
| // 获取token | // 获取token | ||||
| private final static String auth_url = "https://aip.baidubce.com/oauth/2.0/token?"; | private final static String auth_url = "https://aip.baidubce.com/oauth/2.0/token?"; | ||||
| // 百度API Key | // 百度API Key | ||||
| private final static String apiKey = "Your API Key"; | |||||
| private final static String apiKey = "qnx99HW0HY9xoOEEVRuvtnQ4"; | |||||
| // 百度Secret Key | // 百度Secret Key | ||||
| private final static String secretKey = "Your Secret Key"; | |||||
| private final static String secretKey = "RY5YCqGejrc32xT5kIxDj0mqP9QRiKfD"; | |||||
| //写死的 access_token | //写死的 access_token | ||||
| private final static String access_token = "24.c1c7992795301773c60c8cf01abfe759.2592000.1689236723.282335-33618414"; | private final static String access_token = "24.c1c7992795301773c60c8cf01abfe759.2592000.1689236723.282335-33618414"; | ||||
| @@ -111,4 +112,8 @@ public class BaiduImageCheckUtil { | |||||
| System.out.println(response.body().string()); | System.out.println(response.body().string()); | ||||
| return response.body().string(); | return response.body().string(); | ||||
| } | } | ||||
| public static void main(String[] args) throws IOException { | |||||
| System.out.println(getAuth()); | |||||
| } | |||||
| } | } | ||||
| @@ -143,7 +143,7 @@ public class PhotoSpeakSchedule { | |||||
| video.setVideoPlayUrl(videoDetail.getVideoUrl()); | video.setVideoPlayUrl(videoDetail.getVideoUrl()); | ||||
| video.setVideoTime(videoDetail.getDuration()); | video.setVideoTime(videoDetail.getDuration()); | ||||
| video.setVideoSize(videoDetail.getSize()); | video.setVideoSize(videoDetail.getSize()); | ||||
| video.setVideoHyStatus(EnumVideoStatus.upload_success.getCode()); | |||||
| video.setVideoStatus(EnumVideoStatus.hy_upload_success.getCode()); | |||||
| photoSpeakVideoService.updateById(video); | photoSpeakVideoService.updateById(video); | ||||
| } | } | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -160,7 +160,7 @@ public class PhotoSpeakSchedule { | |||||
| public void photoSpeakCreateHySchedule() { | public void photoSpeakCreateHySchedule() { | ||||
| PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); | PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); | ||||
| videoUpd.setVideoStartDate(DateUtils.getHourDateBefore(2,new Date())); | videoUpd.setVideoStartDate(DateUtils.getHourDateBefore(2,new Date())); | ||||
| videoUpd.setVideoHyStatus(EnumVideoStatus.fail.getCode()); | |||||
| videoUpd.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| List<PhotoSpeakVideo> list = photoSpeakVideoService.findList(videoUpd); | List<PhotoSpeakVideo> list = photoSpeakVideoService.findList(videoUpd); | ||||
| if (list != null && list.size() > 0) { | if (list != null && list.size() > 0) { | ||||
| for (PhotoSpeakVideo video : list) { | for (PhotoSpeakVideo video : list) { | ||||
| @@ -157,7 +157,7 @@ public class PhotoSpeakVideo extends TenantEntity { | |||||
| private String saveDir; | private String saveDir; | ||||
| private Integer videoHyStatus; | |||||
| // private Integer videoHyStatus; | |||||
| private Integer isHy;//是否超分(1、是,0、否) | private Integer isHy;//是否超分(1、是,0、否) | ||||
| @@ -15,7 +15,15 @@ public enum EnumVideoStatus { | |||||
| fail(3, "生成视频失败"), | fail(3, "生成视频失败"), | ||||
| upload_ing(4,"上传视频中"), | upload_ing(4,"上传视频中"), | ||||
| upload_success(5,"上传视频成功"), | upload_success(5,"上传视频成功"), | ||||
| upload_fail(6,"上传视频失败") | |||||
| upload_fail(6,"上传视频失败"), | |||||
| // 超分视频状态 | |||||
| hy_ing(7, "超分视频生成中"), | |||||
| hy_success(8,"超分视频生成成功"), | |||||
| hy_fail(9, "超分视频生成失败"), | |||||
| hy_upload_ing(10,"超分视频上传中"), | |||||
| hy_upload_success(11,"超分视频上传成功"), | |||||
| hy_upload_fail(12,"超分视频上传失败"), | |||||
| ; | ; | ||||
| public static EnumVideoStatus getEnum(Integer code) { | public static EnumVideoStatus getEnum(Integer code) { | ||||
| @@ -358,44 +358,47 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| try { | try { | ||||
| AiVideoHqResult result = AiVideoHelper.videoHq(param); | AiVideoHqResult result = AiVideoHelper.videoHq(param); | ||||
| if (result.isSuccess()) { | if (result.isSuccess()) { | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); | |||||
| speakVideo.setVideoStatus(EnumVideoStatus.hy_success.getCode()); | |||||
| speakVideo.setVideoMsg("超分视频生成成功"); | speakVideo.setVideoMsg("超分视频生成成功"); | ||||
| speakVideo.setVideoPath(result.getUrl()); | speakVideo.setVideoPath(result.getUrl()); | ||||
| this.updateById(speakVideo); | this.updateById(speakVideo); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | |||||
| speakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| speakVideo.setVideoMsg("Mata视频超分失败"); | speakVideo.setVideoMsg("Mata视频超分失败"); | ||||
| speakVideo.setIsHy(EnumYesOrNo.NO.getCode()); | |||||
| this.updateById(speakVideo); | this.updateById(speakVideo); | ||||
| return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | ||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | |||||
| speakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| speakVideo.setVideoMsg("Mata视频超分失败"); | speakVideo.setVideoMsg("Mata视频超分失败"); | ||||
| speakVideo.setIsHy(EnumYesOrNo.NO.getCode()); | |||||
| this.updateById(speakVideo); | this.updateById(speakVideo); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); | ||||
| } | } | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | |||||
| speakVideo.setVideoMsg("接口请求异常"); | |||||
| speakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| speakVideo.setVideoMsg("超分视频接口请求异常"); | |||||
| speakVideo.setIsHy(EnumYesOrNo.NO.getCode()); | |||||
| this.updateById(speakVideo); | this.updateById(speakVideo); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "接口请求异常"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "超分视频接口请求异常"); | |||||
| } | } | ||||
| } | } | ||||
| @Async | @Async | ||||
| @Override | @Override | ||||
| public void uploadHyVideo(PhotoSpeakVideo mouldVideo){ | public void uploadHyVideo(PhotoSpeakVideo mouldVideo){ | ||||
| if(EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoHyStatus()) | |||||
| || EnumVideoStatus.upload_fail.getCode().equals(mouldVideo.getVideoHyStatus())){ | |||||
| if(EnumVideoStatus.hy_success.getCode().equals(mouldVideo.getVideoStatus()) | |||||
| || EnumVideoStatus.hy_upload_fail.getCode().equals(mouldVideo.getVideoStatus())){ | |||||
| String url = hy_url + mouldVideo.getVideoPath(); | String url = hy_url + mouldVideo.getVideoPath(); | ||||
| VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoPath(mouldVideo.getTitle(), url); | VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoPath(mouldVideo.getTitle(), url); | ||||
| if(result.isSuccess()){ | if(result.isSuccess()){ | ||||
| PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); | PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); | ||||
| videoUpd.setId(mouldVideo.getId()); | videoUpd.setId(mouldVideo.getId()); | ||||
| videoUpd.setVideoId(result.getVideoId()); | videoUpd.setVideoId(result.getVideoId()); | ||||
| videoUpd.setVideoHyStatus(EnumVideoStatus.upload_ing.getCode()); | |||||
| videoUpd.setVideoStatus(EnumVideoStatus.hy_upload_ing.getCode()); | |||||
| this.saveOrUpdate(videoUpd); | this.saveOrUpdate(videoUpd); | ||||
| AtomicInteger integer = new AtomicInteger(30); | AtomicInteger integer = new AtomicInteger(30); | ||||
| @@ -412,22 +415,23 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| mouldVideo.setVideoPlayUrl(videoDetail.getVideoUrl()); | mouldVideo.setVideoPlayUrl(videoDetail.getVideoUrl()); | ||||
| mouldVideo.setVideoTime(videoDetail.getDuration()); | mouldVideo.setVideoTime(videoDetail.getDuration()); | ||||
| mouldVideo.setVideoSize(videoDetail.getSize()); | mouldVideo.setVideoSize(videoDetail.getSize()); | ||||
| mouldVideo.setIsHy(2);//超分视频生成成功了状态为2 | |||||
| mouldVideo.setVideoHyStatus(EnumVideoStatus.upload_success.getCode()); | |||||
| mouldVideo.setVideoStatus(EnumVideoStatus.hy_upload_success.getCode()); | |||||
| this.updateById(mouldVideo); | this.updateById(mouldVideo); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (integer.getAndDecrement() <= 0){ | if (integer.getAndDecrement() <= 0){ | ||||
| mouldVideo.setVideoHyStatus(EnumVideoStatus.fail.getCode()); | |||||
| mouldVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| mouldVideo.setIsHy(EnumYesOrNo.NO.getCode()); | |||||
| mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); | mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); | ||||
| this.updateById(mouldVideo); | this.updateById(mouldVideo); | ||||
| break; | break; | ||||
| } | } | ||||
| } catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| mouldVideo.setVideoHyStatus(EnumVideoStatus.fail.getCode()); | |||||
| mouldVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); | |||||
| mouldVideo.setIsHy(EnumYesOrNo.NO.getCode()); | |||||
| mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); | mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); | ||||
| this.updateById(mouldVideo); | this.updateById(mouldVideo); | ||||
| } | } | ||||
| @@ -439,7 +443,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| @Override | @Override | ||||
| public List<PhotoSpeakVideo> getUpLoadHyIngList() { | public List<PhotoSpeakVideo> getUpLoadHyIngList() { | ||||
| PhotoSpeakVideo umVideoQ = new PhotoSpeakVideo(); | PhotoSpeakVideo umVideoQ = new PhotoSpeakVideo(); | ||||
| umVideoQ.setVideoHyStatus(EnumVideoStatus.upload_ing.getCode()); | |||||
| umVideoQ.setVideoStatus(EnumVideoStatus.hy_upload_ing.getCode()); | |||||
| return photoSpeakVideoMapper.getSortList(umVideoQ); | return photoSpeakVideoMapper.getSortList(umVideoQ); | ||||
| } | } | ||||
| @@ -447,8 +451,8 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| public List<PhotoSpeakVideo> getNotHyUploadList() { | public List<PhotoSpeakVideo> getNotHyUploadList() { | ||||
| PhotoSpeakVideo umVideoQ = new PhotoSpeakVideo(); | PhotoSpeakVideo umVideoQ = new PhotoSpeakVideo(); | ||||
| List<Integer> videoStatuss = new ArrayList<>(); | List<Integer> videoStatuss = new ArrayList<>(); | ||||
| videoStatuss.add(EnumVideoStatus.success.getCode()); | |||||
| videoStatuss.add(EnumVideoStatus.upload_fail.getCode()); | |||||
| videoStatuss.add(EnumVideoStatus.hy_success.getCode()); | |||||
| videoStatuss.add(EnumVideoStatus.hy_upload_fail.getCode()); | |||||
| umVideoQ.setVideoStatuss(videoStatuss); | umVideoQ.setVideoStatuss(videoStatuss); | ||||
| return photoSpeakVideoMapper.getSortList(umVideoQ); | return photoSpeakVideoMapper.getSortList(umVideoQ); | ||||
| } | } | ||||
| @@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import sun.net.www.content.audio.wav; | |||||
| import java.nio.charset.StandardCharsets; | import java.nio.charset.StandardCharsets; | ||||
| import java.security.MessageDigest; | import java.security.MessageDigest; | ||||
| @@ -48,15 +49,13 @@ public class AiVideoHelper { | |||||
| } | } | ||||
| private static String hy_url; | private static String hy_url; | ||||
| @Value("${photo.hy_url}") | @Value("${photo.hy_url}") | ||||
| public void setHyUrl(String url){ | |||||
| this.hy_url = url; | |||||
| public void setHyUrl(String hyUrl){ | |||||
| this.hy_url = hyUrl; | |||||
| } | } | ||||
| private static String talk_url; | private static String talk_url; | ||||
| @Value("${photo.talk}") | @Value("${photo.talk}") | ||||
| public void setTalkUrl(String url){ | |||||
| this.talk_url = url; | |||||
| public void setTalkUrl(String talkUrl){ | |||||
| this.talk_url = talkUrl; | |||||
| } | } | ||||
| public static String photo_speak_suffix = "/img_talking"; | public static String photo_speak_suffix = "/img_talking"; | ||||
| public static String image_quality_suffix = "/image_qualit"; | public static String image_quality_suffix = "/image_qualit"; | ||||
| @@ -248,9 +247,11 @@ public class AiVideoHelper { | |||||
| } | } | ||||
| public static AiVideoHqResult videoHq(AiVideoHqParam param) { | public static AiVideoHqResult videoHq(AiVideoHqParam param) { | ||||
| String response = doPost(hy_url + video_hq, JSONObject.toJSONString(param)); | |||||
| // String response = doPost(hy_url + video_hq, JSONObject.toJSONString(param)); | |||||
| String response = doPost("http://111.198.0.15:22288" + video_hq, JSONObject.toJSONString(param)); | |||||
| log.info("视频超分 end response:" + response); | log.info("视频超分 end response:" + response); | ||||
| log.info("视频超分 IP:" + hy_url + video_hq); | |||||
| // log.info("视频超分 IP:" + hy_url + video_hq); | |||||
| log.info("视频超分 IP:" + "http://111.198.0.15:22288" + video_hq); | |||||
| AiVideoHqResult result = new AiVideoHqResult(); | AiVideoHqResult result = new AiVideoHqResult(); | ||||
| if (StringUtils.isBlank(response)) { | if (StringUtils.isBlank(response)) { | ||||
| @@ -273,7 +274,7 @@ public class AiVideoHelper { | |||||
| result.setMsg("(MetaService)视频超分异常,请稍后重试"); | result.setMsg("(MetaService)视频超分异常,请稍后重试"); | ||||
| return result; | return result; | ||||
| } | } | ||||
| if (code.intValue() == 3000) { | |||||
| if (code.intValue() == 5000) { | |||||
| result.setCode(200); | result.setCode(200); | ||||
| result.setSuccess(true); | result.setSuccess(true); | ||||
| result.setUrl(url + strURL); | result.setUrl(url + strURL); | ||||
| @@ -319,16 +320,16 @@ public class AiVideoHelper { | |||||
| // param.setUrl("None"); | // param.setUrl("None"); | ||||
| // AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | // AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | ||||
| AiPhotoSpeakParam param = new AiPhotoSpeakParam(); | |||||
| param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); | |||||
| param.setTask_id(836805079248850944L); | |||||
| param.setGen_txt("None"); | |||||
| param.setImg(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/capi/2023-06-07/6da595fe12ef405bb6434f31e6bad4ec.png")); | |||||
| param.setGender("None"); | |||||
| param.setVoice_id("default"); | |||||
| param.setVoice_style("default"); | |||||
| param.setUrl("https://video.metavatar.cc/sv/262b03bd-18929af12fd/262b03bd-18929af12fd.mp3"); | |||||
| AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | |||||
| // AiPhotoSpeakParam param = new AiPhotoSpeakParam(); | |||||
| // param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); | |||||
| // param.setTask_id(836805079248850944L); | |||||
| // param.setGen_txt("None"); | |||||
| // param.setImg(Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/capi/2023-06-07/6da595fe12ef405bb6434f31e6bad4ec.png")); | |||||
| // param.setGender("None"); | |||||
| // param.setVoice_id("default"); | |||||
| // param.setVoice_style("default"); | |||||
| // param.setUrl("https://video.metavatar.cc/sv/262b03bd-18929af12fd/262b03bd-18929af12fd.mp3"); | |||||
| // AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | |||||
| // AiCheckPhotoParam param = new AiCheckPhotoParam(); | // AiCheckPhotoParam param = new AiCheckPhotoParam(); | ||||
| // String img = Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personmould/16760216806604820_cSHoijDX_grace_1080.jpg"); | // String img = Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personmould/16760216806604820_cSHoijDX_grace_1080.jpg"); | ||||
| @@ -344,11 +345,13 @@ public class AiVideoHelper { | |||||
| // AiPreviewResult result = AiVideoHelper.voicePreview(param); | // AiPreviewResult result = AiVideoHelper.voicePreview(param); | ||||
| // System.out.println(result); | // System.out.println(result); | ||||
| // AiVideoHqParam param = new AiVideoHqParam(); | |||||
| // param.setSave_dir("static/video/2023-07-06/16886220017209544_wav.mp4"); | |||||
| // param.setAudio_path("static/mp3/2023-07-06/291ab7dc-18929b6e89e_convert.wav"); | |||||
| // AiVideoHqResult result = AiVideoHelper.videoHq(param); | |||||
| // System.out.println(result); | |||||
| AiVideoHqParam param = new AiVideoHqParam(); | |||||
| param.setSave_dir("static/tts/2023-07-07/16886958135060428.wav.mp4"); | |||||
| param.setAudio_path("static/tts/2023-07-07/16886958135060428.wav"); | |||||
| param.setCallback_url("https://phototest.metavatar.cc/C/callback/photo/speak"); | |||||
| param.setTask_id(836541377936281600L); | |||||
| AiVideoHqResult result = AiVideoHelper.videoHq(param); | |||||
| System.out.println(result); | |||||
| } | } | ||||