星期四, 十月 15, 2015

下歌

我家老大喜欢听歌,他自己的 Mix 以我的标准看来也是相当不错的。为满足他的要求:
#!/usr/bin/env bash
sudo dnf install youtube-dl ffmpeg mp3gain #find ffmpeg and mp3gain in rpmfusion
# list the youtube addresses in, say, list.txt
while read link; do
    youtube-dl $link
done <list.txt

for i in *mp4; do
    ffmpeg -i "$i" -vn \
    -acodec libmp3lame -ac 2 -ab 160k -ar 48000 \
           "$i".mp3
done

mp3gain -c -r *mp3
这样视频和单独的音频就都有了。mp3gain normalizes the audios.

没有评论: