facebookresearch/co-tracker

moviepy saving video error

JunMa11 opened this issue · 4 comments

Dear all,

Thanks for sharing the awesome work!

I tried the notebook tutorial on local desktop but got the following errors on this line

vis.visualize(video=video, tracks=pred_tracks, visibility=pred_visibility, filename='teaser')
Moviepy - Building video notebooks/videos/teaser_pred_track.mp4.
Moviepy - Writing video notebooks/videos/teaser_pred_track.mp4

Traceback (most recent call last):
  File "/home/jma/Documents/co-tracker/notebooks/tutorial.py", line 90, in <module>
    vis.visualize(video=video, tracks=pred_tracks, visibility=pred_visibility, filename='teaser')
  File "/home/jma/Documents/co-tracker/cotracker/utils/visualizer.py", line 104, in visualize
    self.save_video(res_video, filename=filename, writer=writer, step=step)
  File "/home/jma/Documents/co-tracker/cotracker/utils/visualizer.py", line 123, in save_video
    clip.write_videofile(save_path, codec="libx264", fps=self.fps, logger=None)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/moviepy/decorators.py", line 54, in requires_duration
    return f(clip, *a, **k)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default
    return f(clip, *new_a, **new_kw)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
    return f(clip, *a, **k)
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/moviepy/video/VideoClip.py", line 300, in write_videofile
    ffmpeg_write_video(self, filename, fps, codec,
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_writer.py", line 213, in ffmpeg_write_video
    with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,
  File "/home/jma/anaconda3/envs/track/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_writer.py", line 88, in __init__
    '-r', '%.02f' % fps,
TypeError: must be real number, not NoneType

Any suggestions are highly appreciated.

decorator downgrade via

pip install --upgrade decorator==4.4.2

worked for me.

Hi @dribnet ,
Thanks for your guidance very much!

decorator downgrade via

pip install --upgrade decorator==4.4.2

worked for me.

I have upgraded pytorch-lightning to 2.0.9. but didn't work

getting this error. But strangely it worked only once in my first run.