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

Creating final video hangs #49

Closed Michel-NL closed 8 years ago

Michel-NL commented 8 years ago

Don't know if it is my configuration or something else. I did this now 5 times and everytime with the same results that it hangs around step 24507. Have to press CTRL-C to get back to the prompt. What do you think it could be?

michel@ubuntu:~$ cd project-cars-replay-enhancer-0.3-devel/
michel@ubuntu:~/project-cars-replay-enhancer-0.3-devel$ python3 ReplayEnhancer.py race4.json
Creating video.
Using Track: Sonoma Raceway
[MoviePy] >>>> Building video ../data/video/output/race4.mp4
[MoviePy] Writing audio in race4TEMP_MPY_wvf_snd.mp3
[MoviePy] Done.
[MoviePy] Writing video ../data/video/output/race4.mp4
 24%|████████▏                         | 24507/101298 [37:54<1:58:25, 10.81it/s]

^CAborting...
michel@ubuntu:~/project-cars-replay-enhancer-0.3-devel$ python3 ReplayEnhancer.py race4.json
Creating video.
Using Track: Sonoma Raceway
[MoviePy] >>>> Building video ../data/video/output/race4.mp4
[MoviePy] Writing audio in race4TEMP_MPY_wvf_snd.mp3
[MoviePy] Done.
[MoviePy] Writing video ../data/video/output/race4.mp4
 24%|████████▏                         | 24507/101298 [40:41<2:09:03,  9.92it/s]^CAborting...
michel@ubuntu:~/project-cars-replay-enhancer-0.3-devel$
SenorPez commented 8 years ago

This doesn't seem to be an issue with the Replay Enhancer, since at that point it's completely in the MoviePy script (and by extension, FFMPEG, which is the renderer). http://stackoverflow.com/questions/16523746/ffmpeg-hangs-when-run-in-background https://github.com/Zulko/moviepy/issues/13

I've made a pair of checkins (because I did it wrong the first time) that enables logging for FFMPEG. It'll show up wherever your file is being created... so in your case, ../data/video/output/race4.mp4.log. That might provide more info... or if I'm thinking it's getting hung up by not having a log file to print to, solve your issue?

SenorPez commented 8 years ago

Ignore all that.

I found a dataset that causes the issue on my machine. I think it's a hang in the Replay Enhancer. I'm investigating right now!

SenorPez commented 8 years ago

The problem appears to be the font scaling for the "PIT" indicator. While I'm not sure why it's happening only on certain datasets, I'm working on engineering a fix.

Great catch.

Michel-NL commented 8 years ago

ok..great that you found the bug :)

SenorPez commented 8 years ago

@Michel-NL: Checkin made that should solve the issue.

Additionally, I modified the "custom" video parameters. It's a hidden option that allows me to toy with various outputs. It should now be set to render your video through the problem frame (#24507).

Run python3 ReplayEnhancer -u race4.json to use the custom settings. It'll render frames 24000 through 27000. If it's successful, you should see a "PIT" indicator around 17 seconds in... that was the problem child that has now been fixed.

Sorry about this... it was a really sloppy mistake, and based on your text output, wasted a lot of your time. :frowning:

Michel-NL commented 8 years ago

okay I did run the test. All works fine, did see the pit signs scrolling through the players. Now running the complete video.

No problem...My server is doing all the hard work :)

SenorPez commented 8 years ago

Fingers are crossed that everything renders okay. If you're having success, we should be on track for a release.

Also, if you upload them to YouTube, I'd LOVE to see them!

Michel-NL commented 8 years ago

Here it is the first full video :) https://youtu.be/vAu5Zao2zyw

How reliable do you think the red lines are? take a look at around 30 minutes. I drive in second place and if you are looking at the red lines, then number 1 and 3 should be around me.

Michel-NL commented 8 years ago

second video https://youtu.be/T3O0an7WVqU

SenorPez commented 8 years ago

Love it! I've one final tweak to make, and then I'm going to package 0.3 and release it. There's probably a few things that will be in a 0.3.1 (like adding drivers that didn't race in the current race to the Series Standings), but it looks like we're solid.

As for the red lines: They're as accurate as the telemetry provides. There's a field that indicates the percentage of the lap completed. It sometimes goes a little wonky (most noticeable on pit stops), but otherwise is okay.

Keep in mind, too, that the length of the red line is the entire length of the track. So, for example, on a track like Sonoma (2.5 miles), with a 100-pixel red line, each pixel represents nearly 1,000 feet. That's not a huge distance at race speeds.

Michel-NL commented 8 years ago

Okay I understand the red lines. I think its a solid release :+1: