Skip to content

Instantly share code, notes, and snippets.

@Neptune998
Created September 19, 2020 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neptune998/1550b0791e2cccb2d1472c11df088347 to your computer and use it in GitHub Desktop.
Save Neptune998/1550b0791e2cccb2d1472c11df088347 to your computer and use it in GitHub Desktop.
# Libraries import
import moviepy.editor as mp
# It will clip the video
# subclip(starttime, endtime) to clip portion of video
# you can remove the subclip to convert complete video
clip = mp.VideoFileClip(r"sample1.mp4").subclip(10, 100)
# It will write the audio in converted_audio.wav file.
clip.audio.write_audiofile(r"Converted_audio.wav")
print("Finished the convertion into audio...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment