Commit 34a7eeb58024377bfcce251d75a149342139b90b
1 parent
753efef3
添加合并文件性能限制
Showing
3 changed files
with
14 additions
and
0 deletions
src/main/java/top/panll/assist/dto/UserSettings.java
| ... | ... | @@ -21,6 +21,9 @@ public class UserSettings { |
| 21 | 21 | @Value("${userSettings.ffprobe}") |
| 22 | 22 | private String ffprobe; |
| 23 | 23 | |
| 24 | + @Value("${userSettings.threads:2}") | |
| 25 | + private int threads; | |
| 26 | + | |
| 24 | 27 | public String getRecord() { |
| 25 | 28 | return record; |
| 26 | 29 | } |
| ... | ... | @@ -64,4 +67,12 @@ public class UserSettings { |
| 64 | 67 | public void setRecordTempDay(int recordTempDay) { |
| 65 | 68 | this.recordTempDay = recordTempDay; |
| 66 | 69 | } |
| 70 | + | |
| 71 | + public int getThreads() { | |
| 72 | + return threads; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setThreads(int threads) { | |
| 76 | + this.threads = threads; | |
| 77 | + } | |
| 67 | 78 | } | ... | ... |
src/main/java/top/panll/assist/service/FFmpegExecUtils.java
| ... | ... | @@ -116,6 +116,7 @@ public class FFmpegExecUtils implements InitializingBean{ |
| 116 | 116 | .overrideOutputFiles(true) |
| 117 | 117 | .setInput(fileListName) // Or filename |
| 118 | 118 | .addExtraArgs("-safe", "0") |
| 119 | + .addExtraArgs("-threads", userSettings.getThreads() + "") | |
| 119 | 120 | .addOutput(recordFileResultPath) |
| 120 | 121 | .setVideoCodec("copy") |
| 121 | 122 | .setAudioCodec("copy") | ... | ... |
src/main/resources/application-dev.yml