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.
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
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
10 respectively. You can change the values according to your choice.
And now if you execute the above script by typing the below command as shown below