Browse Source

3subtitle

private_deployment
谈文友 1 year ago
parent
commit
0e6468a633
2 changed files with 38 additions and 32 deletions
  1. +5
    -1
      suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java
  2. +33
    -31
      suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java

+ 5
- 1
suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java View File

@@ -13,7 +13,9 @@ import lombok.ToString;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;


import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;


@TableName(value = "photo_speak_video") @TableName(value = "photo_speak_video")
@Data @Data
@@ -56,6 +58,8 @@ public class PhotoSpeakVideo extends TenantEntity {


@io.swagger.annotations.ApiModelProperty(value="字幕参数",name="subtitleParams") @io.swagger.annotations.ApiModelProperty(value="字幕参数",name="subtitleParams")
private String subtitleParams; private String subtitleParams;
@io.swagger.annotations.ApiModelProperty(value="字幕参数",name="subtitleParams")
private Map<String,Object> reSubtitleParams = new HashMap<>();


@io.swagger.annotations.ApiModelProperty(value="EnumVoiceFrom 声音来源",name="voiceFrom") @io.swagger.annotations.ApiModelProperty(value="EnumVoiceFrom 声音来源",name="voiceFrom")
private Integer voiceFrom; private Integer voiceFrom;
@@ -153,5 +157,5 @@ public class PhotoSpeakVideo extends TenantEntity {
private Integer videoHyStatus; private Integer videoHyStatus;


private Integer isHy;//是否超分(1、是,0、否) private Integer isHy;//是否超分(1、是,0、否)
} }

+ 33
- 31
suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java View File

@@ -220,38 +220,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService {


Integer voiceFrom = photoSpeakVideo.getVoiceFrom(); Integer voiceFrom = photoSpeakVideo.getVoiceFrom();
String voiceMaterialUrl = photoSpeakVideo.getVoiceMaterialUrl(); String voiceMaterialUrl = photoSpeakVideo.getVoiceMaterialUrl();
if (photoSpeakVideo.getSubtitleEnabled()==1){
// //开启字幕 查询字幕列表
Map reSubtitle = new HashMap();
Map params = new HashMap();
JSONObject subtitle = JSON.parseObject(photoSpeakVideo.getSubtitleParams());
params.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname")));
params.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize")));
params.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour")));
params.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour")));
params.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour")));
params.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour")));
params.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold")));
params.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic")));
params.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline")));
params.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout")));
params.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX")));
params.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY")));
params.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing")));
params.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle")));
params.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle")));
params.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline")));
params.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow")));
params.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment")));
params.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL")));
params.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR")));
params.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV")));
reSubtitle.put("enabled",1);
reSubtitle.put("text",photoSpeakVideo.getPaperwork());
reSubtitle.put("params",params);
param.setSubtitle_params(reSubtitle);


}
// List<PhotoSpeakVideo> videoMapperList = photoSpeakVideoMapper.findList(speakVideoUpd); // List<PhotoSpeakVideo> videoMapperList = photoSpeakVideoMapper.findList(speakVideoUpd);
// for (PhotoSpeakVideo speakVideo : videoMapperList) { // for (PhotoSpeakVideo speakVideo : videoMapperList) {
// if (speakVideo.getSubtitleEnabled()==1){ // if (speakVideo.getSubtitleEnabled()==1){
@@ -355,6 +324,39 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService {
videoUpd.setVideoId(result.getVideoId()); videoUpd.setVideoId(result.getVideoId());
videoUpd.setVideoStatus(EnumVideoStatus.upload_ing.getCode()); videoUpd.setVideoStatus(EnumVideoStatus.upload_ing.getCode());
videoUpd.setUpdateDate(new Date()); videoUpd.setUpdateDate(new Date());
if (mouldVideo.getSubtitleEnabled()==1){
// //开启字幕 查询字幕列表
Map reSubtitle = new HashMap();
Map params = new HashMap();
JSONObject subtitle = JSON.parseObject(mouldVideo.getSubtitleParams());
params.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname")));
params.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize")));
params.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour")));
params.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour")));
params.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour")));
params.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour")));
params.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold")));
params.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic")));
params.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline")));
params.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout")));
params.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX")));
params.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY")));
params.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing")));
params.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle")));
params.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle")));
params.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline")));
params.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow")));
params.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment")));
params.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL")));
params.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR")));
params.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV")));
reSubtitle.put("enabled",1);
reSubtitle.put("text",mouldVideo.getPaperwork());
reSubtitle.put("params",params);
videoUpd.setReSubtitleParams(reSubtitle);

}

this.saveOrUpdate(videoUpd); this.saveOrUpdate(videoUpd);


PhotoSpeakVideo videoUrlUpd = new PhotoSpeakVideo(); PhotoSpeakVideo videoUrlUpd = new PhotoSpeakVideo();


Loading…
Cancel
Save