在windows环境下通过java调用命令行执行ffmpeg视频编辑命令报错,但是直接使用系统命令行执行相同命令能执行成功。请问是哪里出了问题?

环境:
java1.8
mvn:
javacv.version: 1.5.7
javacpp-platform.version: 1.5.7
ffmpeg:5.0-1.5.7
ffmpeg 版本:
6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers

源代码:

@PostMapping("/uploadVideo")
@Transactional(rollbackFor = {RuntimeException.class})
public BaseResult uploadVideo(@RequestPart MultipartFile file) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    log.info("视频压缩开始");
    File   sourceVideo   = videoCompressionUtils.multipartFile2File(file,"C:\\Users\\HUANGMINGHUA\\Desktop\\test");
    String canonicalPath = sourceVideo.getCanonicalPath();
    String concat        = canonicalPath.substring(0, canonicalPath.lastIndexOf("\\") + 1).concat("output.mp4");
    String ffmpeg        = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class);
    ProcessBuilder pb = new ProcessBuilder().inheritIO().command(ffmpeg,"ffmpeg -i " + canonicalPath + " -r 50 -b:v 2000k  -s 1080x1920 " + concat);
    pb.inheritIO().start().waitFor();
    log.info("视频压缩结束,耗时:{}", (System.currentTimeMillis() - startTime));
    return null;
}

控制台报错信息:

ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --prefix=.. --disable-iconv --disable-opencl --disable-sdl2 --disable-bzlib --disable-lzma --disable-linux-perf --disable-xlib --enable-shared --enable-version3 --enable-runtime-cpudetect --enable-zlib --enable-libmp3lame --enable-libspeex --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-openssl --enable-libopenh264 --enable-libvpx --enable-libfreetype --enable-libopus --enable-libxml2 --enable-libsrt --enable-libwebp --enable-cuda --enable-cuvid --enable-nvenc --enable-libmfx --enable-w32threads --enable-indev=dshow --target-os=mingw32 --cc='gcc -m64' --extra-cflags='-DLIBXML_STATIC -I../include/ -I../include/libxml2/' --extra-ldflags=-L../lib/ --extra-libs='-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lgcc_eh -lWs2_32 -lcrypt32 -lpthread -lz -lm -Wl,-Bdynamic -lole32 -luuid'
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
Output #0, mp4, to 'ffmpeg -i C:\Users\HUANGMINGHUA\Desktop\test\be40a86d-fdc5-4190-bf1c-ab1a424f8666.mp4 -r 50 -b:v 2000k  -s 1080x1920 C:\Users\HUANGMINGHUA\Desktop\test\output.mp4':
Output file #0 does not contain any stream

系统命令行执行结果

代码已被折叠,点此展开