Extracting Audio from Video using Python

0 min read

We’ll start by installing ffmpeg and moviepy packages using the following pip command.

pip install ffmpeg moviepy

Next, we’ll import MoviePy:

import moviepy.editor as mp

Next, we’ll load the Video Clip:

video_clip = mp.VideoFileClip(r"video_file.mp4")

MoviePy supports various video formats like:

Now, we’ll extract the audio:


Here, we can choose different audio format as our preference. Some formats as listed below: