Python 3 Moviepy Script to Convert Mp4 Video to Mp3 Audio Full Project For Beginners

 

Welcome folks today in this blog post we will be converting video mp4 to audio mp3 in python using moviepy library. All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to install the below library using the pip command as shown below

 

 

pip install moviepy

 

 

After installing this library you need to make an app.py file and copy paste the following code

 

 

app.py

 

 

from moviepy.editor import *

mp4_file = r'E:\VID_20180308_141907.mp4'
mp3_file = r'E:\VID_20180308_141907.mp3'


videoclip = VideoFileClip(mp4_file)

audioclip = videoclip.audio
audioclip.write_audiofile(mp3_file)

audioclip.close()
videoclip.close()

Leave a Reply