|
@@ -214,8 +214,16 @@ public class FileUtils {
|
|
|
|
|
|
public static void downloadZFHYD(String fileUrl, String filePath, boolean useUa, boolean useProxy, Map<String, String> proxyInfo) throws Exception {
|
|
|
log.info("begin download [{}] to [{}] useUa [{}] useProxy [{}] proxyInfo[{}]", fileUrl, filePath, useUa, useProxy, proxyInfo);
|
|
|
- String command = String.format("ffmpeg -y -i \"%s\" -c copy -bsf:a aac_adtstoasc \"%s\"", fileUrl, filePath);
|
|
|
- Process process = Runtime.getRuntime().exec(command);
|
|
|
+ ProcessBuilder processBuilder = new ProcessBuilder(
|
|
|
+ "ffmpeg",
|
|
|
+ "-y",
|
|
|
+ "-i", fileUrl,
|
|
|
+ "-c", "copy",
|
|
|
+ "-bsf:a", "aac_adtstoasc",
|
|
|
+ filePath
|
|
|
+ );
|
|
|
+ processBuilder.redirectErrorStream(true);
|
|
|
+ Process process = processBuilder.start();
|
|
|
int exitCode = process.waitFor();
|
|
|
if (exitCode == 0) {
|
|
|
log.info("Downloaded successfully [{}] to [{}]", fileUrl, filePath);
|