Bash 在基于cygwin的shell脚本中使用ffmpeg关联mkv文件时出错
我已经为concate 2.mkv文件编写了基于cygwin的shell脚本,如下所示Bash 在基于cygwin的shell脚本中使用ffmpeg关联mkv文件时出错,bash,shell,ffmpeg,cygwin,Bash,Shell,Ffmpeg,Cygwin,我已经为concate 2.mkv文件编写了基于cygwin的shell脚本,如下所示 #!/bin/sh ffmpeg -f concat -i concat.txt -codec copy out.mkv concat.txt包含要连接的2个mkv文件的路径 file '../temp/1' file '../temp/2' 当我从cygwin终端运行脚本时,我得到以下错误 Rishi@Rishikesh /cygdrive/i/video/Interface_code/Testing_
#!/bin/sh
ffmpeg -f concat -i concat.txt -codec copy out.mkv
concat.txt包含要连接的2个mkv文件的路径
file '../temp/1'
file '../temp/2'
当我从cygwin终端运行脚本时,我得到以下错误
Rishi@Rishikesh /cygdrive/i/video/Interface_code/Testing_function/bin
$ . script.sh
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 30 2014 17:13:24 with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable- avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp -- enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, concat, from 'concat.txt':
Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 1:1 DAR 5:4], 25 fps, 25 tbr, 1k tbn, 50 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
'NULL @ 04780280] Unable to find a suitable output format for 'out.mkv
: Invalid argument
另外,如果我直接从cygwin终端运行这个命令(而不是通过脚本调用它),它将正确运行并创建连接输出.mkv文件在shell脚本文件上应用dos2unix命令解决了我的问题。希望它能帮助他人。请添加您的解决方案作为答案,如果它解决了您的问题,请接受它!