You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But ffmpeg was throwing an error that the width was not divisible by 2. Getting ffmpeg_video_writer to print out the ffmpeg command confirmed that an incorrect command is being sent to ffmpeg:
[MoviePy] Writing video /volumes/sigma/151.mp4
attempting to write video with the following command:
ffmpeg -y -loglevel error -f rawvideo -vcodec rawvideo -s 533x400 -pix_fmt rgb24 -r 59.94 -i - -an -i 151TEMP_MPY_wvf_snd.m4a -acodec copy -vcodec libx264 -preset medium -pix_fmt yuv420p /volumes/sigma/151.mp4
If I explicitly set the size, why is it being sent wrong to ffmpeg?
The text was updated successfully, but these errors were encountered:
As explained in the docstring (but maybe I need to clarify or throw an error), height and width should not be used together, but alone, to preserve automatically the aspect ratio:
clip.resize(width=532) # the height will be automatically computed
clip.resize(height=400) # width will be automatically computed
Note that this sometimes makes clips with uneven sizes, which some formats (like yours) don't like. In this case you can use the effect even_size which will automatically remove the last line or column of pixel to make the dimensions even:
# import moviepy.editor as mpy ...
clip = master_video.resize(height=400).fx( mpy.vfx.even_size)
Trying to save a short clip of a resized video. I explicitly resize the video clip here:
But ffmpeg was throwing an error that the width was not divisible by 2. Getting ffmpeg_video_writer to print out the ffmpeg command confirmed that an incorrect command is being sent to ffmpeg:
If I explicitly set the size, why is it being sent wrong to ffmpeg?
The text was updated successfully, but these errors were encountered: