ffmpeg 出现问题并查找

ffmpeg 出现问题并查找

我想使用 FFmpeg 将整个音乐库(在当前文件夹中,我也想转换子文件夹)转换为 Opus。转换后的文件应转到 ~/Desktop/Opus 中的文件夹并保留其层次结构。我写了以下命令:

find . -name "*.mp3" -exec ffmpeg -i "./{}" "~/Desktop/Opus/{}.opus" \;

问题是它不起作用。解析嵌入式 FFmpeg 命令似乎存在问题,因为它为每个文件显示如下错误:

ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/Users/Famille_Pintado/brew/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libcaca --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil      56. 14.100 / 56. 14.100
libavcodec     58. 18.100 / 58. 18.100
libavformat    58. 12.100 / 58. 12.100
libavdevice    58.  3.100 / 58.  3.100
libavfilter     7. 16.100 /  7. 16.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  1.100 /  5.  1.100
libswresample   3.  1.100 /  3.  1.100
libpostproc    55.  1.100 / 55.  1.100
[mp3 @ 0x7fa947802600] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '././690885_Zaphkiel.mp3':
Metadata:
TBPM            : 128
encoded_by      : LAME in FL Studio 12
date            : 2016
Duration: 00:04:48.34, start: 0.000000, bitrate: 160 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 160 kb/s
~/Desktop/Opus/./690885_Zaphkiel.mp3.opus: No such file or directory

我究竟做错了什么?

答案1

find [...] -exec将使用找到的文件的(相对)路径。如果您想-exec假设找到的文件位于当前目录中,则需要使用-execdir.

相关内容