I'm tring to add an audio file to a video file. When it has finished, I use the 'write_videofile()' function in moviepy. I use a string to save the filename, but when my code runs, here comes an exception:TypeError:must be real number, not NoneType
here is my code:
...
from moviepy.editor import *
...
class Recorder():
def __init__(self):
self.currentTime = time.localtime()
self.outputName = "videos/{}.mp4".format(time.strftime("%Y%m%d-%H%M%S",self.currentTime))
self.videoName = "videos/{}.avi".format(time.strftime("%Y%m%d-%H%M%S",self.currentTime))
...
def merge(self):
...
print(type(self.outputName)) # this outputs "<class 'str'>"
video.write_videofile(self.outputName) # TypeError:must be real number, not NoneType
...
...