Created
July 17, 2022 15:00
-
-
Save 97997/7356ec3de28cd69a9d47789073ee09d7 to your computer and use it in GitHub Desktop.
#script takes working directory mp4 files (and others) (only tested with mp4) and uses ffmpeg to convert to variable bitrate mp3 files
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
#script takes working directory mp4 files (and others) (only tested with mp4) and uses ffmpeg to convert to variable bitrate mp3 files | |
workingDirectory = 'C:\\directory_with_the_mp4_files\\' | |
files = [] | |
import os | |
for individualFile in os.listdir(workingDirectory): | |
totalpath = workingDirectory + individualFile | |
if individualFile.endswith(('.mp4', '.wmv', '.avi', '.mkv')): | |
files.append(totalpath) | |
for item in files: | |
os.system("ffmpeg -i \"" + item + "\" -q:a 0 -map a \"" + item.rsplit('.', 1)[0] + '\".mp3') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment