Python 3 FFMPEG Example to Add Overlay or Logo Image to Video Using FFMPEG-Python Library Full Project For Beginners

Python 3 FFMPEG Example to Add Overlay or Logo Image to Video Using FFMPEG-Python Library Full Project For Beginners

 

Welcome folks today in this blog post we will be adding overlay image  to video using ffmpeg in python. All the full source code of the application is given below.

 

 

Get Started

 

 

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

 

pip install ffmpeg-python

 

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

 

app.py

 

import ffmpeg
main = ffmpeg.input('video1.mkv')
logo = ffmpeg.input('logo.png')
(
    ffmpeg
    .filter([main, logo], 'overlay', 10, 10)
    .output('output.mkv')
    .run()
)

 

 

And in this above script we are adding the logo.png image overlay to the video at x coordinate 10 and y coordinate 10 respectively. You can change the values according to your choice.

See also  Python 3 PyQt5 Horizontal Box Layout of Buttons Using QHBoxLayout Widget GUI Desktop App Full Project For Beginners

 

And now if you execute the above script by typing the below command as shown below

 

python app.py

 

 

Leave a Reply