facebookresearch / co-tracker

CoTracker is a model for tracking any point (pixel) on a video.
https://co-tracker.github.io/
Other
2.52k stars 177 forks source link

moviepy saving video error #30

Closed JunMa11 closed 9 months ago

JunMa11 commented 10 months ago

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.

dribnet commented 9 months ago

decorator downgrade via

pip install --upgrade decorator==4.4.2

worked for me.

JunMa11 commented 9 months ago

Hi @dribnet , Thanks for your guidance very much!

Ucarrot319 commented 9 months ago

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

riponazad commented 8 months ago

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