Search code examples
pythonvideo-editingmoviepy

How to combine 2 videos of different resolution/aspect ratio/frames


What are the things we need to consider while combining two videos

Does Aspect ratio has any importance while combining two videos

Does the no of Frames has any relation while combining the videos

I am trying to combine two videos of different resolutions, frames rate and aspect ratios using Python Movie.Py

final_clip = concatenate_videoclips([video1, video2], method='compose')

When I tried videos with different resolutions the but the resutant video was not what I expected

enter image description here


Solution

  • If two videos have the different resolutions and aspect ratios, concatenating them together with method=compose will put black borders around the smaller one so that it is the same size as the largest one. If you don’t want black borders, then you will need to use resize to resize them so that they are all the same size.

    Here’s some resize examples from the documentation:

    >>> myClip.resize( (460,720) ) # New resolution: (460,720)
    >>> myClip.resize(0.6) # width and heigth multiplied by 0.6
    >>> myClip.resize(width=800) # height computed automatically.
    

    There shouldn’t be any issue when concatenating videos of different frame rates.