ffmpeg无法在cygwin下找到输出目录

时间:2014-07-28 20:29:31

标签: bash ffmpeg cygwin

我正在使用ffmpeg的windows版本(详情如下),当我尝试使用输出文件NOT在本地目录中转码视频时,它会抱怨错误消息:

/dtop/out.mp4: No such file or directory

我的cygwin坐骑如下 - 我没有找到任何其他没有正确遵循坐骑/链接的应用程序......

[lwobker:/dtop/vertigo]$ mount
C:/Documents and Settings/lwobker/Desktop on /dtop type ntfs (binary)
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)

这是我到目前为止所设想的,让我相信由于某种原因,FFMPEG不喜欢在cygwin中关注挂载点或链接。但如果我能弄明白为什么......我会被诅咒......

如果我这样做,它的工作原理:     ffmpeg -i ./input.mp4 ./out.mp4

如果我这样做,它就是WORKS(权限和挂载/链接检查):     触摸/dtop/out.mp4

但是,如果我提供的文件位置不在当前工作目录或当前工作目录的子目录中,那么它会呕吐:

[lwobker:/dtop/vertigo]$ ffmpeg -i 00001.MTS /dtop/out.mp4
ffmpeg version N-64919-ga613257 Copyright (c) 2000-2014 the FFmpeg developers
<snip>
Input #0, mpegts, from '00001.MTS':
  Duration: 00:01:41.63, start: 1.033367, bitrate: 10221 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
/dtop/out.mp4: No such file or directory
如果我把/cygdrive/c/somefile.mp4作为一个参数,它也会呕吐 - 它也不会找到它。

任何想法都会非常感激。我使用的是我在cygwin中本地编译的FFMPEG版本,但是当我移动机器时我无法正确地重新编译,所以我希望能够解决这个问题,所以我可以使用预先为方便起见,编译了二进制文件......

FFMPEG版本详情:

[lwobker:/dtop/vertigo]$ ffmpeg
ffmpeg version N-64919-ga613257 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 23 2014 00:35:22 with gcc 4.8.3 (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-decklink --enable-zlib
  libavutil      52. 92.101 / 52. 92.101
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.101 / 55. 48.101
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

1 个答案:

答案 0 :(得分:5)

你不能提供Windows本机程序Cygwin路径,他们不明白 那。但是,您可以将包装器脚本放在与ffmpeg.exe相同的文件夹中, 并称之为ffmpeg。喜欢这个

#!/bin/sh
for each
do
  foo=$(cygpath -w -- "$each")
  bar+=("$foo")
done
ffmpeg.exe "${bar[@]}"

然后你离开这个

$ ffmpeg.exe -i 1_Les_Nuits.mp3 /tmp/outfile.m4a
/tmp/outfile.m4a: No such file or directory

到此

$ ffmpeg -i 1_Les_Nuits.mp3 /tmp/outfile.m4a
frame=1 fps=0.1 q=33.0 Lsize=6046kB time=00:06:21.52 bitrate= 129.8kbits/s

另一个选项,如果它适用于您,则只需在处理时使用Windows路径 使用Windows本机程序,例如

ffmpeg.exe -i 'C:\1_Les_Nuits.mp3' 'C:\outfile.m4a'
相关问题