Last active
August 12, 2024 02:23
-
-
Save Sarjuuk/1f05ef2affe49a7e7ca0fad7b01c081d to your computer and use it in GitHub Desktop.
[*NIX] audio file conversion using ffmpeg - deletes after conversion
This file contains 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 . -name "*.wav" | xargs -I % sh -c 'ffmpeg -hide_banner -y -i "%" -acodec libvorbis -f ogg "%_"; rm "%";' && find . -name "*.mp3" | xargs -I % sh -c 'ffmpeg -hide_banner -y -i "%" -acodec libmp3lame -f mp3 "%_"; rm "%";' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using this script left me with all the files renamed with the _ at the end. So I asked ChatGTP for some help. Here's what he/she/it said about the script:
Thought I let you all know what issue I ran in to. I'm not specifically looking for a solution. Since my knowledge on scripts is very limited, I decided to copy the files to my desktop computer and used a .bat file to achieve our goal. Then I copied everything back to the server. This workaround did the job for me.