Last active
August 19, 2025 00:53
-
-
Save ILPlais/f98069a3e3bf83741ae83d143a5858cb to your computer and use it in GitHub Desktop.
Convert all the FLAC files in MP3 using FFmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Find all .flac files recursively | |
| find . -name "*.flac" -type f | while IFS= read -r f; do | |
| # Generates the name of the corresponding MP3 file | |
| mp3_file="${f%.flac}.mp3" | |
| # Check if the MP3 file already exists | |
| if [[ ! -f "$mp3_file" ]]; then | |
| echo "Conversion: $f -> $mp3_file" | |
| ffmpeg -i "$f" -ID3v2_version 4 "$mp3_file" | |
| eyeD3 -to-v1 "$mp3_file" | |
| else | |
| echo "File already exists, ignored: $mp3_file" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment