wangyunpeng hai 1 día
pai
achega
10e4fffac3

+ 14 - 14
core/src/main/java/com/tzld/supply/dao/mapper/supply/spider/ToolsAudioTransRecordMapper.java

@@ -10,7 +10,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     long countByExample(ToolsAudioTransRecordExample example);
 
@@ -18,7 +18,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int deleteByExample(ToolsAudioTransRecordExample example);
 
@@ -26,7 +26,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int deleteByPrimaryKey(Long id);
 
@@ -34,7 +34,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int insert(ToolsAudioTransRecord record);
 
@@ -42,7 +42,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int insertSelective(ToolsAudioTransRecord record);
 
@@ -50,7 +50,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     List<ToolsAudioTransRecord> selectByExampleWithBLOBs(ToolsAudioTransRecordExample example);
 
@@ -58,7 +58,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     List<ToolsAudioTransRecord> selectByExample(ToolsAudioTransRecordExample example);
 
@@ -66,7 +66,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     ToolsAudioTransRecord selectByPrimaryKey(Long id);
 
@@ -74,7 +74,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int updateByExampleSelective(@Param("record") ToolsAudioTransRecord record, @Param("example") ToolsAudioTransRecordExample example);
 
@@ -82,7 +82,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int updateByExampleWithBLOBs(@Param("record") ToolsAudioTransRecord record, @Param("example") ToolsAudioTransRecordExample example);
 
@@ -90,7 +90,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int updateByExample(@Param("record") ToolsAudioTransRecord record, @Param("example") ToolsAudioTransRecordExample example);
 
@@ -98,7 +98,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int updateByPrimaryKeySelective(ToolsAudioTransRecord record);
 
@@ -106,7 +106,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int updateByPrimaryKeyWithBLOBs(ToolsAudioTransRecord record);
 
@@ -114,7 +114,7 @@ public interface ToolsAudioTransRecordMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     int updateByPrimaryKey(ToolsAudioTransRecord record);
 }

+ 5 - 5
core/src/main/java/com/tzld/supply/job/VideoGenerateJob.java

@@ -139,7 +139,7 @@ public class VideoGenerateJob {
             produceVideoAudioMapper.insertSelective(audio);
 
             // 生成srt
-            toolsAudioTransService.getAudioTransResults(voiceUrl, true);
+            new Thread(() -> toolsAudioTransService.getAudioTransResults(video.getId(), voiceUrl, true)).start();
         }
         return ReturnT.SUCCESS;
     }
@@ -437,11 +437,11 @@ public class VideoGenerateJob {
             if (materialList.size() < 10 || (mediaList.size() * 1.0 / totalMediaSize) > 0.1) {
                 continue;
             }
-            ProduceVideoAudio audio = getProduceAudio(produceVideo);
+            ProduceVideoAudio audio = getProduceAudio(produceVideo.getId());
             if (audio == null) {
                 continue;
             }
-            ToolsAudioTransRecord audioTransRecord = toolsAudioTransService.getExistToolsAudioTransRecord(audio.getUrl());
+            ToolsAudioTransRecord audioTransRecord = toolsAudioTransService.getExistToolsAudioTransRecordByProduceVideoId(produceVideo.getId());
             if (audioTransRecord == null) {
                 continue;
             }
@@ -592,9 +592,9 @@ public class VideoGenerateJob {
         return videoUrls;
     }
 
-    private ProduceVideoAudio getProduceAudio(ProduceVideo produceVideo) {
+    private ProduceVideoAudio getProduceAudio(String produceVideoId) {
         ProduceVideoAudioExample example = new ProduceVideoAudioExample();
-        example.createCriteria().andProduceVideoIdEqualTo(produceVideo.getId()).andStatusEqualTo(1);
+        example.createCriteria().andProduceVideoIdEqualTo(produceVideoId).andStatusEqualTo(1);
         List<ProduceVideoAudio> audioList = produceVideoAudioMapper.selectByExample(example);
         if (CollectionUtil.isEmpty(audioList)) {
             return null;

+ 67 - 31
core/src/main/java/com/tzld/supply/model/po/supply/spider/ToolsAudioTransRecord.java

@@ -11,10 +11,21 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.id
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private Long id;
 
+    /**
+     * Database Column Remarks:
+     *   生成视频ID
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column tools_audio_trans_record.produce_video_id
+     *
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
+     */
+    private String produceVideoId;
+
     /**
      * Database Column Remarks:
      *   文件url
@@ -22,7 +33,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.file_url
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private String fileUrl;
 
@@ -33,7 +44,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.file_url_md5
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private String fileUrlMd5;
 
@@ -44,7 +55,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.task_id
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private String taskId;
 
@@ -55,7 +66,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.status
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private Integer status;
 
@@ -66,7 +77,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.create_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private Long createTimestamp;
 
@@ -77,7 +88,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.exe_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private Long exeTimestamp;
 
@@ -88,7 +99,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.finish_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private Long finishTimestamp;
 
@@ -99,7 +110,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.result
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private String result;
 
@@ -110,7 +121,7 @@ public class ToolsAudioTransRecord {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column tools_audio_trans_record.words
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     private String words;
 
@@ -120,7 +131,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.id
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Long getId() {
         return id;
@@ -132,19 +143,43 @@ public class ToolsAudioTransRecord {
      *
      * @param id the value for tools_audio_trans_record.id
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setId(Long id) {
         this.id = id;
     }
 
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column tools_audio_trans_record.produce_video_id
+     *
+     * @return the value of tools_audio_trans_record.produce_video_id
+     *
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
+     */
+    public String getProduceVideoId() {
+        return produceVideoId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column tools_audio_trans_record.produce_video_id
+     *
+     * @param produceVideoId the value for tools_audio_trans_record.produce_video_id
+     *
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
+     */
+    public void setProduceVideoId(String produceVideoId) {
+        this.produceVideoId = produceVideoId;
+    }
+
     /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column tools_audio_trans_record.file_url
      *
      * @return the value of tools_audio_trans_record.file_url
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public String getFileUrl() {
         return fileUrl;
@@ -156,7 +191,7 @@ public class ToolsAudioTransRecord {
      *
      * @param fileUrl the value for tools_audio_trans_record.file_url
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setFileUrl(String fileUrl) {
         this.fileUrl = fileUrl;
@@ -168,7 +203,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.file_url_md5
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public String getFileUrlMd5() {
         return fileUrlMd5;
@@ -180,7 +215,7 @@ public class ToolsAudioTransRecord {
      *
      * @param fileUrlMd5 the value for tools_audio_trans_record.file_url_md5
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setFileUrlMd5(String fileUrlMd5) {
         this.fileUrlMd5 = fileUrlMd5;
@@ -192,7 +227,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.task_id
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public String getTaskId() {
         return taskId;
@@ -204,7 +239,7 @@ public class ToolsAudioTransRecord {
      *
      * @param taskId the value for tools_audio_trans_record.task_id
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setTaskId(String taskId) {
         this.taskId = taskId;
@@ -216,7 +251,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.status
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Integer getStatus() {
         return status;
@@ -228,7 +263,7 @@ public class ToolsAudioTransRecord {
      *
      * @param status the value for tools_audio_trans_record.status
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setStatus(Integer status) {
         this.status = status;
@@ -240,7 +275,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.create_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Long getCreateTimestamp() {
         return createTimestamp;
@@ -252,7 +287,7 @@ public class ToolsAudioTransRecord {
      *
      * @param createTimestamp the value for tools_audio_trans_record.create_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setCreateTimestamp(Long createTimestamp) {
         this.createTimestamp = createTimestamp;
@@ -264,7 +299,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.exe_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Long getExeTimestamp() {
         return exeTimestamp;
@@ -276,7 +311,7 @@ public class ToolsAudioTransRecord {
      *
      * @param exeTimestamp the value for tools_audio_trans_record.exe_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setExeTimestamp(Long exeTimestamp) {
         this.exeTimestamp = exeTimestamp;
@@ -288,7 +323,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.finish_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Long getFinishTimestamp() {
         return finishTimestamp;
@@ -300,7 +335,7 @@ public class ToolsAudioTransRecord {
      *
      * @param finishTimestamp the value for tools_audio_trans_record.finish_timestamp
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setFinishTimestamp(Long finishTimestamp) {
         this.finishTimestamp = finishTimestamp;
@@ -312,7 +347,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.result
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public String getResult() {
         return result;
@@ -324,7 +359,7 @@ public class ToolsAudioTransRecord {
      *
      * @param result the value for tools_audio_trans_record.result
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setResult(String result) {
         this.result = result;
@@ -336,7 +371,7 @@ public class ToolsAudioTransRecord {
      *
      * @return the value of tools_audio_trans_record.words
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public String getWords() {
         return words;
@@ -348,7 +383,7 @@ public class ToolsAudioTransRecord {
      *
      * @param words the value for tools_audio_trans_record.words
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setWords(String words) {
         this.words = words;
@@ -358,7 +393,7 @@ public class ToolsAudioTransRecord {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     @Override
     public String toString() {
@@ -367,6 +402,7 @@ public class ToolsAudioTransRecord {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
+        sb.append(", produceVideoId=").append(produceVideoId);
         sb.append(", fileUrl=").append(fileUrl);
         sb.append(", fileUrlMd5=").append(fileUrlMd5);
         sb.append(", taskId=").append(taskId);

+ 87 - 17
core/src/main/java/com/tzld/supply/model/po/supply/spider/ToolsAudioTransRecordExample.java

@@ -8,7 +8,7 @@ public class ToolsAudioTransRecordExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     protected String orderByClause;
 
@@ -16,7 +16,7 @@ public class ToolsAudioTransRecordExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     protected boolean distinct;
 
@@ -24,7 +24,7 @@ public class ToolsAudioTransRecordExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     protected List<Criteria> oredCriteria;
 
@@ -32,7 +32,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public ToolsAudioTransRecordExample() {
         oredCriteria = new ArrayList<Criteria>();
@@ -42,7 +42,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setOrderByClause(String orderByClause) {
         this.orderByClause = orderByClause;
@@ -52,7 +52,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public String getOrderByClause() {
         return orderByClause;
@@ -62,7 +62,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void setDistinct(boolean distinct) {
         this.distinct = distinct;
@@ -72,7 +72,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public boolean isDistinct() {
         return distinct;
@@ -82,7 +82,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public List<Criteria> getOredCriteria() {
         return oredCriteria;
@@ -92,7 +92,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void or(Criteria criteria) {
         oredCriteria.add(criteria);
@@ -102,7 +102,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Criteria or() {
         Criteria criteria = createCriteriaInternal();
@@ -114,7 +114,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public Criteria createCriteria() {
         Criteria criteria = createCriteriaInternal();
@@ -128,7 +128,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     protected Criteria createCriteriaInternal() {
         Criteria criteria = new Criteria();
@@ -139,7 +139,7 @@ public class ToolsAudioTransRecordExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public void clear() {
         oredCriteria.clear();
@@ -151,7 +151,7 @@ public class ToolsAudioTransRecordExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
@@ -254,6 +254,76 @@ public class ToolsAudioTransRecordExample {
             return (Criteria) this;
         }
 
+        public Criteria andProduceVideoIdIsNull() {
+            addCriterion("produce_video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdIsNotNull() {
+            addCriterion("produce_video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdEqualTo(String value) {
+            addCriterion("produce_video_id =", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdNotEqualTo(String value) {
+            addCriterion("produce_video_id <>", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdGreaterThan(String value) {
+            addCriterion("produce_video_id >", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdGreaterThanOrEqualTo(String value) {
+            addCriterion("produce_video_id >=", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdLessThan(String value) {
+            addCriterion("produce_video_id <", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdLessThanOrEqualTo(String value) {
+            addCriterion("produce_video_id <=", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdLike(String value) {
+            addCriterion("produce_video_id like", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdNotLike(String value) {
+            addCriterion("produce_video_id not like", value, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdIn(List<String> values) {
+            addCriterion("produce_video_id in", values, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdNotIn(List<String> values) {
+            addCriterion("produce_video_id not in", values, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdBetween(String value1, String value2) {
+            addCriterion("produce_video_id between", value1, value2, "produceVideoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProduceVideoIdNotBetween(String value1, String value2) {
+            addCriterion("produce_video_id not between", value1, value2, "produceVideoId");
+            return (Criteria) this;
+        }
+
         public Criteria andFileUrlIsNull() {
             addCriterion("file_url is null");
             return (Criteria) this;
@@ -709,7 +779,7 @@ public class ToolsAudioTransRecordExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated do_not_delete_during_merge Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated do_not_delete_during_merge Fri Nov 14 13:29:39 CST 2025
      */
     public static class Criteria extends GeneratedCriteria {
 
@@ -722,7 +792,7 @@ public class ToolsAudioTransRecordExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table tools_audio_trans_record
      *
-     * @mbg.generated Thu Nov 13 19:18:13 CST 2025
+     * @mbg.generated Fri Nov 14 13:29:39 CST 2025
      */
     public static class Criterion {
         private String condition;

+ 4 - 4
core/src/main/java/com/tzld/supply/service/ToolsAudioTransService.java

@@ -6,16 +6,16 @@ import com.tzld.supply.model.po.supply.spider.ToolsAudioTransRecord;
 
 public interface ToolsAudioTransService {
 
-    AliVoiceResultData getAudioTransResults(String audioUrl, boolean needWords);
-
     /**
      *
+     * @param produceVideoId
      * @param audioUrl
      * @param needWords
-     * @param provider aliyun / volcengine
      * @return
      */
-    AliVoiceResultData getAudioTransResults(String audioUrl, boolean needWords, String provider);
+    AliVoiceResultData getAudioTransResults(String produceVideoId, String audioUrl, boolean needWords);
 
     ToolsAudioTransRecord getExistToolsAudioTransRecord(String audioUrl);
+
+    ToolsAudioTransRecord getExistToolsAudioTransRecordByProduceVideoId(String produceVideoId);
 }

+ 13 - 5
core/src/main/java/com/tzld/supply/service/impl/ToolsAudioTransServiceImpl.java

@@ -31,13 +31,9 @@ public class ToolsAudioTransServiceImpl implements ToolsAudioTransService {
     @Autowired
     VolcengineVoiceTransTextClient volcengineVoiceTransTextClient;
 
-    @Override
-    public AliVoiceResultData getAudioTransResults(String audioUrl, boolean needWords) {
-        return getAudioTransResults(audioUrl, needWords, "volcengine");
-    }
 
     @Override
-    public AliVoiceResultData getAudioTransResults(String audioUrl, boolean needWords, String provider) {
+    public AliVoiceResultData getAudioTransResults(String produceVideoId, String audioUrl, boolean needWords) {
         AliVoiceResultData resultData = new AliVoiceResultData();
         if (!StringUtils.hasText(audioUrl)) {
             return resultData;
@@ -68,6 +64,7 @@ public class ToolsAudioTransServiceImpl implements ToolsAudioTransService {
             try {
                 if (Objects.isNull(existRecord)) {
                     ToolsAudioTransRecord record = new ToolsAudioTransRecord();
+                    record.setProduceVideoId(produceVideoId);
                     record.setFileUrl(audioUrl);
                     record.setFileUrlMd5(Md5Util.encoderByMd5(audioUrl));
                     record.setTaskId(taskId);
@@ -139,4 +136,15 @@ public class ToolsAudioTransServiceImpl implements ToolsAudioTransService {
         }
         return null;
     }
+
+    @Override
+    public ToolsAudioTransRecord getExistToolsAudioTransRecordByProduceVideoId(String produceVideoId) {
+        ToolsAudioTransRecordExample example = new ToolsAudioTransRecordExample();
+        example.createCriteria().andProduceVideoIdEqualTo(produceVideoId);
+        List<ToolsAudioTransRecord> list = toolsAudioTransRecordMapper.selectByExampleWithBLOBs(example);
+        if (CollectionUtil.isNotEmpty(list)) {
+            return list.get(0);
+        }
+        return null;
+    }
 }

+ 49 - 31
core/src/main/resources/mapper/supply/spider/ToolsAudioTransRecordMapper.xml

@@ -5,9 +5,10 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="produce_video_id" jdbcType="VARCHAR" property="produceVideoId" />
     <result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
     <result column="file_url_md5" jdbcType="VARCHAR" property="fileUrlMd5" />
     <result column="task_id" jdbcType="VARCHAR" property="taskId" />
@@ -20,7 +21,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     <result column="result" jdbcType="LONGVARCHAR" property="result" />
     <result column="words" jdbcType="LONGVARCHAR" property="words" />
@@ -29,7 +30,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -63,7 +64,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -97,15 +98,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
-    id, file_url, file_url_md5, task_id, `status`, create_timestamp, exe_timestamp, finish_timestamp
+    id, produce_video_id, file_url, file_url_md5, task_id, `status`, create_timestamp, 
+    exe_timestamp, finish_timestamp
   </sql>
   <sql id="Blob_Column_List">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     `result`, words
   </sql>
@@ -113,7 +115,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     select
     <if test="distinct">
@@ -134,7 +136,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     select
     <if test="distinct">
@@ -153,7 +155,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -166,7 +168,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     delete from tools_audio_trans_record
     where id = #{id,jdbcType=BIGINT}
@@ -175,7 +177,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     delete from tools_audio_trans_record
     <if test="_parameter != null">
@@ -186,28 +188,31 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
-    insert into tools_audio_trans_record (id, file_url, file_url_md5, 
-      task_id, `status`, create_timestamp, 
-      exe_timestamp, finish_timestamp, `result`, 
-      words)
-    values (#{id,jdbcType=BIGINT}, #{fileUrl,jdbcType=VARCHAR}, #{fileUrlMd5,jdbcType=VARCHAR}, 
-      #{taskId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}, 
-      #{exeTimestamp,jdbcType=BIGINT}, #{finishTimestamp,jdbcType=BIGINT}, #{result,jdbcType=LONGVARCHAR}, 
-      #{words,jdbcType=LONGVARCHAR})
+    insert into tools_audio_trans_record (id, produce_video_id, file_url, 
+      file_url_md5, task_id, `status`, 
+      create_timestamp, exe_timestamp, finish_timestamp, 
+      `result`, words)
+    values (#{id,jdbcType=BIGINT}, #{produceVideoId,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, 
+      #{fileUrlMd5,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{exeTimestamp,jdbcType=BIGINT}, #{finishTimestamp,jdbcType=BIGINT}, 
+      #{result,jdbcType=LONGVARCHAR}, #{words,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.supply.model.po.supply.spider.ToolsAudioTransRecord">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     insert into tools_audio_trans_record
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
         id,
       </if>
+      <if test="produceVideoId != null">
+        produce_video_id,
+      </if>
       <if test="fileUrl != null">
         file_url,
       </if>
@@ -240,6 +245,9 @@
       <if test="id != null">
         #{id,jdbcType=BIGINT},
       </if>
+      <if test="produceVideoId != null">
+        #{produceVideoId,jdbcType=VARCHAR},
+      </if>
       <if test="fileUrl != null">
         #{fileUrl,jdbcType=VARCHAR},
       </if>
@@ -273,7 +281,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     select count(*) from tools_audio_trans_record
     <if test="_parameter != null">
@@ -284,13 +292,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     update tools_audio_trans_record
     <set>
       <if test="record.id != null">
         id = #{record.id,jdbcType=BIGINT},
       </if>
+      <if test="record.produceVideoId != null">
+        produce_video_id = #{record.produceVideoId,jdbcType=VARCHAR},
+      </if>
       <if test="record.fileUrl != null">
         file_url = #{record.fileUrl,jdbcType=VARCHAR},
       </if>
@@ -327,10 +338,11 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     update tools_audio_trans_record
     set id = #{record.id,jdbcType=BIGINT},
+      produce_video_id = #{record.produceVideoId,jdbcType=VARCHAR},
       file_url = #{record.fileUrl,jdbcType=VARCHAR},
       file_url_md5 = #{record.fileUrlMd5,jdbcType=VARCHAR},
       task_id = #{record.taskId,jdbcType=VARCHAR},
@@ -348,10 +360,11 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     update tools_audio_trans_record
     set id = #{record.id,jdbcType=BIGINT},
+      produce_video_id = #{record.produceVideoId,jdbcType=VARCHAR},
       file_url = #{record.fileUrl,jdbcType=VARCHAR},
       file_url_md5 = #{record.fileUrlMd5,jdbcType=VARCHAR},
       task_id = #{record.taskId,jdbcType=VARCHAR},
@@ -367,10 +380,13 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     update tools_audio_trans_record
     <set>
+      <if test="produceVideoId != null">
+        produce_video_id = #{produceVideoId,jdbcType=VARCHAR},
+      </if>
       <if test="fileUrl != null">
         file_url = #{fileUrl,jdbcType=VARCHAR},
       </if>
@@ -405,10 +421,11 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     update tools_audio_trans_record
-    set file_url = #{fileUrl,jdbcType=VARCHAR},
+    set produce_video_id = #{produceVideoId,jdbcType=VARCHAR},
+      file_url = #{fileUrl,jdbcType=VARCHAR},
       file_url_md5 = #{fileUrlMd5,jdbcType=VARCHAR},
       task_id = #{taskId,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
@@ -423,10 +440,11 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 13 19:18:13 CST 2025.
+      This element was generated on Fri Nov 14 13:29:39 CST 2025.
     -->
     update tools_audio_trans_record
-    set file_url = #{fileUrl,jdbcType=VARCHAR},
+    set produce_video_id = #{produceVideoId,jdbcType=VARCHAR},
+      file_url = #{fileUrl,jdbcType=VARCHAR},
       file_url_md5 = #{fileUrlMd5,jdbcType=VARCHAR},
       task_id = #{taskId,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},

+ 77 - 2
server/src/test/java/ProduceTest.java

@@ -1,10 +1,22 @@
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.tzld.supply.Application;
+import com.tzld.supply.api.FFmpegApiService;
+import com.tzld.supply.dao.mapper.supply.spider.ProduceVideoAudioMapper;
 import com.tzld.supply.dao.mapper.supply.spider.ProduceVideoMapper;
+import com.tzld.supply.dao.mapper.supply.spider.SubtitleStyleMapper;
+import com.tzld.supply.dao.mapper.supply.spider.ToolsAudioTransRecordMapper;
 import com.tzld.supply.job.ContentMediaSearchJob;
 import com.tzld.supply.job.VideoGenerateJob;
-import com.tzld.supply.model.po.supply.spider.ProduceVideo;
-import com.tzld.supply.model.po.supply.spider.ProduceVideoExample;
+import com.tzld.supply.model.entity.ali.AliVoiceResultSentenceData;
+import com.tzld.supply.model.param.FFmpeg.VideoAddAssSubtitleParam;
+import com.tzld.supply.model.param.FFmpeg.VideoInfoParam;
+import com.tzld.supply.model.po.supply.spider.*;
+import com.tzld.supply.service.ToolsAudioTransService;
+import com.tzld.supply.util.AssSubtitleUtil;
+import com.tzld.supply.util.TimelineUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -20,7 +32,17 @@ public class ProduceTest {
     @Autowired
     private VideoGenerateJob videoGenerateJob;
     @Autowired
+    private ToolsAudioTransService toolsAudioTransService;
+    @Autowired
+    private FFmpegApiService ffmpegApiService;
+    @Autowired
     private ProduceVideoMapper produceVideoMapper;
+    @Autowired
+    private ProduceVideoAudioMapper produceVideoAudioMapper;
+    @Autowired
+    private SubtitleStyleMapper subtitleStyleMapper;
+    @Autowired
+    private ToolsAudioTransRecordMapper toolsAudioTransRecordMapper;
 
     @Test
     public void test() {
@@ -39,4 +61,57 @@ public class ProduceTest {
         videoGenerateJob.videoMaterialGenerateJob(produceVideo.getId());
         videoGenerateJob.videoGenerateJob(produceVideo.getId());
     }
+
+    @Test
+    public void produceSrt() {
+        String produceVideoId = "20251113150815425774994";
+        ProduceVideoAudioExample example = new ProduceVideoAudioExample();
+        example.createCriteria().andProduceVideoIdEqualTo(produceVideoId).andStatusEqualTo(1);
+        List<ProduceVideoAudio> audioList = produceVideoAudioMapper.selectByExample(example);
+        if (CollectionUtil.isEmpty(audioList)) {
+            return;
+        }
+        ProduceVideoAudio audio =  audioList.get(0);
+        toolsAudioTransService.getAudioTransResults(produceVideoId, audio.getUrl(), true);
+    }
+
+    @Test
+    public void addSubtitle() {
+        String videoUrl = "https://rescdn.yishihui.com/videoComposite/34c885bcda4b46b0b5da4be0e0fee640.mp4";
+        // 添加字幕
+        SubtitleStyle subtitleStyle = subtitleStyleMapper.selectByPrimaryKey("subtitle_style_109");
+        int lineWidth = 80;
+        String mediaInfoStr = ffmpegApiService.videoInfo(new VideoInfoParam(videoUrl));
+        VideoGenerateJob.MediaInfo mediaInfo =  JSONObject.parseObject(mediaInfoStr, VideoGenerateJob.MediaInfo.class);
+        if (mediaInfo.getWidth() > mediaInfo.getHeight()) {
+            lineWidth = 220;
+        }
+        ToolsAudioTransRecord audioTransRecord = toolsAudioTransRecordMapper.selectByPrimaryKey(594084L);
+        String srt = null;
+        // 提取SRT
+        if (StringUtils.isNotBlank(audioTransRecord.getResult())) {
+            List<AliVoiceResultSentenceData> sentences = JSONObject.parseArray(audioTransRecord.getResult(), AliVoiceResultSentenceData.class);
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < sentences.size(); i++) {
+                AliVoiceResultSentenceData sentenceData = sentences.get(i);
+                if (org.springframework.util.StringUtils.hasText(sentenceData.getText())) {
+                    sb.append(i + 1).append("\n");
+                    sb.append(TimelineUtils.convertMillisToStringTime(sentenceData.getBeginTime(), ",")).append(" --> ")
+                            .append(TimelineUtils.convertMillisToStringTime(sentenceData.getEndTime(), ",")).append("\n");
+                    sb.append(sentenceData.getText()).append("\n");
+                    sb.append("\n");
+                }
+            }
+            srt = sb.toString();
+        }
+        String assSubtitleData = AssSubtitleUtil.buildAssSubtitleData(subtitleStyle.getAssStyleData(),
+                "下", "中", subtitleStyle.getFontName(),
+                srt, lineWidth);
+        VideoAddAssSubtitleParam addAssSubtitleParam = VideoAddAssSubtitleParam.builder()
+                .videoUrl(videoUrl)
+                .assSubtitle(assSubtitleData)
+                .build();
+        String addAssSubtitleVideoUrl = ffmpegApiService.videoAddAssSubtitle(addAssSubtitleParam);
+        System.out.println(addAssSubtitleVideoUrl);
+    }
 }