Created
January 20, 2021 07:05
-
-
Save lightsongjs/849d84c757e168822b1e81d61c65a01e to your computer and use it in GitHub Desktop.
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
import os | |
import subprocess | |
def removeSpacesandRenameFileFromFileName (oldFile): | |
newFileName = oldFile.replace(' ','_') | |
os.rename(oldFile,newFileName) | |
return newFileName | |
fileList = os.listdir(os.getcwd()) | |
for file in fileList: | |
if file.endswith('.mp4'): | |
newFilename = removeSpacesandRenameFileFromFileName(file) | |
# print(f'ffmpeg -i {newFilename} {newFilename}.wav') | |
subprocess.call(f'ffmpeg -i {newFilename} {newFilename}.wav') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment