瀏覽代碼

2022-09-29 修改音乐文件合成,补全linux命令地址。

zhuchangxue 3 年之前
父節點
當前提交
5483c61cb3

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabAudioSynthesisServiceImpl.java

@@ -100,7 +100,7 @@ public class LabAudioSynthesisServiceImpl implements ILabAudioSynthesisService
         if(flag>0){
 
 //            FfmpegConsole console = new FfmpegConsole();
-            String cmd ="ffmpeg -i "+labAudioSynthesis.getMusicUrl()+" -i "+labAudioSynthesis.getBgmusicUrl()+" -filter_complex \"[0:a]aformat=sample_fmts=fltp:channel_layouts=stereo,volume="+labAudioSynthesis.getMusicVolume()+"[a0]; [1:a]aformat=sample_fmts=fltp:channel_layouts=stereo,volume="+labAudioSynthesis.getBgmusicVolume()+",adelay=5000|5000|5000,apad[a1]; [a0][a1]amerge=inputs=2[aout]\" -shortest -map \"[aout]\" -ac 2 "+localFilePath+"";
+            String cmd ="/usr/bin/ffmpeg -i "+labAudioSynthesis.getMusicUrl()+" -i "+labAudioSynthesis.getBgmusicUrl()+" -filter_complex \"[0:a]aformat=sample_fmts=fltp:channel_layouts=stereo,volume="+labAudioSynthesis.getMusicVolume()+"[a0]; [1:a]aformat=sample_fmts=fltp:channel_layouts=stereo,volume="+labAudioSynthesis.getBgmusicVolume()+",adelay=5000|5000|5000,apad[a1]; [a0][a1]amerge=inputs=2[aout]\" -shortest -map \"[aout]\" -ac 2 "+localFilePath+"";
             log.error("cmd:"+cmd);
             try {
                 new Thread(()->this.exec(cmd)).start();