Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.1k stars 1.51k forks source link

Moviepy created way more frames than it should when source is 1280x720 and not 1920x1080 #2031

Open jltchiu opened 10 months ago

jltchiu commented 10 months ago

Hi, I have two video files that I am trying to clip. The clipping commands is as follows

from moviepy.editor import *
clip = VideoFileClip("iris1920.mp4").subclip("86","94")
clip.write_videofile("testtest.mp4",fps=clip.fps, audio_bitrate="1000k", audio_codec='aac', bitrate="8000k", codec='libx264', preset='ultrafast')
from moviepy.editor import *
clip = VideoFileClip("iris1280.mp4").subclip("86","94")
clip.write_videofile("testtest.mp4",fps=clip.fps, audio_bitrate="1000k", audio_codec='aac', bitrate="8000k", codec='libx264', preset='ultrafast')

The two files have different video resolutions, the iris1920 is 1920x1080 while iris1280 is 1280 * 720, but otherwise are the same.

However, in the first command, the write file went smoothly, it has 480 frames needed to write and can be done in a few seconds. In the second command, it has 720000 frames need to write and takes forever.

Does anyone know the reason for the bloated number of frames for the second command? I notice that the output file seems to be always 1920 * 1080, is that why the number of frames becomes so high for the second command?