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

おすすめ記事