Skip to content

Instantly share code, notes, and snippets.

@DBoyara
Created September 19, 2021 11:50
Show Gist options
  • Select an option

  • Save DBoyara/8915d69fad53062e4ba80f6de6adf8d6 to your computer and use it in GitHub Desktop.

Select an option

Save DBoyara/8915d69fad53062e4ba80f6de6adf8d6 to your computer and use it in GitHub Desktop.
Python mp4 to mp3 with moviepy
import os
from moviepy.editor import VideoFileClip
def main():
video = VideoFileClip(os.path.join("path_to", "movie.mp4"))
video.audio.write_audiofile(os.path.join("path_to", "audio.mp3"))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment