作者: | 来源:互联网 | 2023-09-03 17:24
本文由编程笔记#小编为大家整理,主要介绍了markdown 命令使用ffmpeg查找和转换相关的知识,希望对你有一定的参考价值。
# Command find and convert using ffmpeg
I would like to combine the two following commands to find mp4 files and convert them to mp3 and save them with same name. The two command line:
`
find ./ -name '*.mp4'
ffmpeg -i video.mp4 -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 audio.mp3
`
## With find's -exec functionality:
`
find ./ -name '*.mp4' -exec bash -c 'ffmpeg -i $0 -vn -acodec libmp3lame -ac 2 \
-ab 160k -ar 48000 ${0/mp4/mp3}' {} \;
`
## This should make xyz.mp4 to xyz.mp3.
Thanks, how I can delete the mp4 ? – molwiko Dec 10 '13 at 14:27
`
find ./ -name '*.mp4' -exec rm -f {} \;
`
but check first if everything worked before deleting something. – chaos Dec 10 '13 at 14:32