moviepy
moviepy copied to clipboard
ffmpeg does not allow None as fps argument
Expected Behavior
I combine mp4 and mp3 and get that error
Actual Behavior
File "C:\X\venv\Lib\site-packages\moviepy\video\VideoClip.py", line 300, in write_videofile ffmpeg_write_video(self, filename, fps, codec, File "C:\X\venv\Lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 212, in ffmpeg_write_video with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\X\venv\Lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 86, in init '-r', '%.02f' % fps, ~~~~~~~~^~~~~ TypeError: must be real number, not NoneType
Steps to Reproduce the Problem
I am not familiar with the fps fancy stuff but i found out that the none is not allowed for ffmpeg as fps Thatfore i added the code in the function ffmpeg_write_video
if fps==None:
fps=24
After that it worked
Specifications
- Python Version: 3.12.2
- MoviePy Version: 1.0.3
- Platform Name: Windows 64