批量转换音频文件s48>mp3

安装ffmpeg
[root@control shell]# cat 1-install-ffmpeg.sh
#!/bin/bash
 
#安装epel-release
yum install -y epel-release
#安装nux存储库
#安装 ffmpeg
yum install -y ffmpeg ffmpeg-devel
 
音频转换
[root@control shell]# cat 2-s48tomp3.sh
#!/bin/bash
sourceDir=/root/shell/1200507153153/Files
destinationDir=/root/shell/tmp
logFile=./log.txt
> $logFile
number=0
echo `date` >> $logFile
 
for fileName in `ls ${sourceDir}/*s48 |awk -F [/.] '{print $((NF-1))}'`
do
        ffmpeg -i ${sourceDir}/${fileName}.s48  -ab 256000 -ar 48000 ${destinationDir}/${fileName}.mp3
        echo $fileName >> $logFile
done
echo `date` >> $logFile
 
转换结果查看
posted @ 2020-09-15 11:04  水中鱼2018  阅读(453)  评论(0)    收藏  举报