本帖最后由 newswan 于 2023-12-23 21:53 编辑
直接执行这个命令可行- ffmpeg.exe -i "1.mkv" -codec copy -map 0 -map -0:1 -map -0:2 -y "2.mkv"
复制代码 但是,选项使用变量就会失败- $opt = " -map -0:1 -map -0:2 "
- ffmpeg.exe -i "1.mkv" -codec copy -map 0 $opt -y "2.mkv"
复制代码 请问,该怎么调用 ffmpeg ?
错误信息是- [AVFormatContext @ 000001e856df9500] Unable to choose an output format for ' -map -0:1 -map -0:2'; use a standard extension for the filename or specify the format manually.
- [out#0 @ 000001e856f2cfc0] Error initializing the muxer for -map -0:1 -map -0:2: Invalid argument
- Error opening output file -map -0:1 -map -0:2.
- Error opening output files: Invalid argument
复制代码 ffmpeg 版本是- ffmpeg version 2023-11-13-git-67a2571a55-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
- built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
- configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
复制代码
|