SenorPez / project-cars-replay-enhancer

Project CARS Replay Enhancer: Combines telemetry data with replay video to improve Project CARS replays.
MIT License
12 stars 1 forks source link

Error with creating new video from existing config #51

Closed Michel-NL closed 8 years ago

Michel-NL commented 8 years ago

Don't know if it is really an error from using an existing config...but it looks terrible

To synchronize telemetry with video, run the Project CARS Replay Enhancer with the -r option. Set the synchronization offset to the value shown on the Timer when the viewed car crosses the start finish line to begin lap 2. Using Track: Mazda Raceway at Laguna Seca [MoviePy] >>>> Building video ../data/video/output/race5.mp4 [MoviePy] Writing audio in race5TEMP_MPY_wvf_snd.mp3 64%|████████████████████████████████████████████████ | 4029/6285 [00:03<00:02, 890.21it/s]Traceback (most recent call last): File "ReplayEnhancer.py", line 741, in ReplayEnhancer.edit_configuration(arguments.configuration) File "ReplayEnhancer.py", line 513, in edit_configuration output.write_videofile(replay.output_video, fps=10, preset='superfast') File "", line 2, in write_videofile File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, _a, _k) File "", line 2, in write_videofile File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 137, in use_clip_fps_by_default return f(clip, _new_a, _new_kw) File "", line 2, in write_videofile File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB return f(clip, _a, _k) File "/usr/local/lib/python3.4/dist-packages/moviepy/video/VideoClip.py", line 331, in write_videofile verbose=verbose) File "", line 2, in write_audiofile File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, _a, _k) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 204, in write_audiofile verbose=verbose, ffmpeg_params=ffmpeg_params) File "", line 2, in ffmpeg_audiowrite File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, _a, _k) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 161, in ffmpeg_audiowrite nbytes= nbytes, fps=fps): File "/usr/local/lib/python3.4/dist-packages/tqdm/_tqdm.py", line 459, in iter for obj in iterable: File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 81, in generator buffersize=chunksize) File "", line 2, in to_soundarray File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, _a, _k) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 127, in to_soundarray snd_array = self.get_frame(tt) File "", line 2, in get_frame File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(_new_a, _new_kw) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 292, in make_frame for c,part in zip(self.clips, played_parts) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 293, in if (part is not False) ] File "", line 2, in get_frame File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(_new_a, _new_kw) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 136, in newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 188, in return self.fl(lambda gf, t: gf(t_func(t)), apply_to, File "", line 2, in get_frame File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(_new_a, _new_kw) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 292, in make_frame for c,part in zip(self.clips, played_parts) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 293, in if (part is not False) ] File "", line 2, in get_frame File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(_new_a, _new_kw) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 292, in make_frame for c,part in zip(self.clips, played_parts) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/AudioClip.py", line 293, in if (part is not False) ] File "", line 2, in get_frame File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(_new_a, _new_kw) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 136, in newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 188, in return self.fl(lambda gf, t: gf(t_func(t)), apply_to, File "", line 2, in get_frame File "/usr/local/lib/python3.4/dist-packages/moviepy/decorators.py", line 89, in wrapper return f(_new_a, _new_kw) File "/usr/local/lib/python3.4/dist-packages/moviepy/Clip.py", line 95, in get_frame return self.make_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/io/AudioFileClip.py", line 71, in self.make_frame = lambda t: reader.get_frame(t) File "/usr/local/lib/python3.4/dist-packages/moviepy/audio/io/readers.py", line 173, in get_frame fr_min, fr_max = frames.min(), frames.max() File "/usr/local/lib/python3.4/dist-packages/numpy/core/_methods.py", line 29, in _amin return umr_minimum(a, axis, None, out, keepdims) ValueError: zero-size array to reduction operation minimum which has no identity michel@ubuntu:~/project-cars-replay-enhancer-0.3-devel$

race5.json.txt

Michel-NL commented 8 years ago

maybe wrong end time problem? Have to check later...now diner and then its race time

Michel-NL commented 8 years ago

Okay confirm that its the video_skipend value. From the copied config it was 3175.

  1. Create a new config from scratch and it is 3104.
  2. Changed the value in the race5.json file to 3104.
  3. run python3 ReplayEnhancer.py -c race5.json....pressing enter on all options, not changing anything And it runs without a problem.

So I think the value video_skipend can not be larger then the actual end value. If so it creates a error. What you are saying at #50 absurdly long number will not work ?

SenorPez commented 8 years ago

It looks worse than it is. Part of the scary side of MoviePy is that there are so many layers of programs running... so when something goes wrong, it kicks out the ENTIRE pile of programs.

I was able to reproduce this error with one of my test data set by setting the video_skipend (which isn't quite correctly named anymore) to a time longer than the actual video duration.

Last fix, then, for 0.3... I already have the duration calculated at this point, so it should now throw the error message if the default (be it from a previous file or otherwise) is longer than the duration of the video.

Good luck racing tonight.

Michel-NL commented 8 years ago

could not finish the race.. one of the dogs had an allergy and needed to the veterinarian.

Going to test it again