Skip to main content

Raymii.org Raymii.org Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed

Convert FLV's to MP3

Published: 15-06-2008 | Author: Remy van Elst | Text only version of this article


❗ This post is over sixteen years old. It may no longer be up to date. Opinions may have changed.

If you've got a large folder of .flv files (lets say you've ripped them from youtube) and you want to put them on a music player, you can use this script.

Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below. It means the world to me if you show your appreciation and you'll help pay the server costs:

GitHub Sponsorship

PCBWay referral link (You get $5, I get $20 after you've placed an order)

Digital Ocea referral link ($200 credit for 60 days. Spend $25 after your credit expires and I'll get $25!)

First make a file called convert.sh.

vim convert.sh

Then paste the following in it:

#!/bin/bash
for f in *.flv; do
    echo "Converting $f"
    ffmpeg -i "$f" "${f%.flv}.mp3"
done

Save, and make it executable:

chmod +x ./convert.sh

Now copy all your FLV's in that folder, and then open a terminal there:

./convert.sh

Then, when finished remove all the flv's you copied:

rm ./*.flv

Now you have a folder full of mp3's instead of .flv's.

Tags: bash , flv , loop , mp3 , snippets