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

Somethin wrong with determining start of second lap #104

Closed Michel-NL closed 7 years ago

Michel-NL commented 7 years ago

Config values: "source_telemetry" : "./packetdata-20161123-212740", "source_video" : "./video/org-test.mp4", "subheading_text" : "Round 1 - Circuit de Spa-Francorchamps", "sync_racestart" : 0.0, "video_skipend" : 3804, "video_skipstart" : 0

Video skipend calculated from the video with ends at 1:03.24 so (I think) should be 3804. https://youtu.be/SDz0kELfkzg video results with -s parameter. Why is the video starting from almost the end of lap 1? I can't determine the correct sync if the cars are not going over the (correct?) finish line, because the video ends before the cars are touching the finish line for lap 2.

Michel-NL commented 7 years ago

I tried version 0.3.2 and when its creating the testvideo it stops playing at 03:00 minutes and jumps to the end screen. You could think who is doing 3 minutes for the first lap :). But we are using the first lap sort of formation lap and that could take more then 3 minutes to complete the first lap. So are the rules for racing on AOR. http://apexonlineracing.com/community/threads/aor-gt3-league-rules-season-6.16441/#post-269557 (2.6 Manual Rolling Start) I searched the code to extend 3 minutes to 4 minutes, but i'm an no programmer so couldn't find it ;-).

SenorPez commented 7 years ago

Okay, I think I can diagnose what's happening here.

First, very neat idea for AOR. I like the manual rolling start! That's really cool. Project CARS "automatic" rolling starts are terrible, and you guys have figured out a great way to get around them... very real world!

However, it's also breaking my built-in logic for the -s option, mostly because I assumed it's at race speed.

How It Works

When video is created with the -s option, it creates a video that, if perfectly synchronized, would start 10 seconds before the first car crosses the finish line and ends 10 seconds after the last car crosses the finish line. (It then glues any static start/finish cards on so you can proof them, too.)

What's Going On

Because of the slower speeds and extra time at the start of the video, the synchronization is off by more than that window of time.

How To Fix It Now

Add a bunch of time to the sync value. Your test video is 25 seconds long and doesn't catch the leader crossing the start/finish line, so add at least 25 seconds to the sync value and recreate. Continue adjusting the value based on the timecode compared to the first lap time.

Note that even though the first lap is slow, as it's a parade lap, it's still perfectly accurate to sync the telemetry feed with the video from that!

Changes I Can Make

I'll see if it's possible to add a second parameter that specifies the "window" time. So if you wanted more than +/- 10 seconds from the field's first lap, you could do that.

Michel-NL commented 7 years ago

Only had to set 1.0 for the sync_racestart. The settings are for now: "sync_racestart" : 1.0, "video_skipend" : 3804.0, "video_skipstart" : 34.0 Video created with the -s parameter: https://youtu.be/faxzkI-00Ts Please have a look at the timings when we cross the finish line. Some strange numbers appear.

BTW what is the meaning of the black box with the white numbers on the top of the video?

Michel-NL commented 7 years ago

This is the full video https://www.youtube.com/watch?v=LZGvFgAi_Ag As you can see the first laps giving wrong timings. Lap 1 -> 2 and lap 2 -> 3. After that the timing looks ok.

SenorPez commented 7 years ago

Sync Tutorial: https://github.com/SenorPez/project-cars-replay-enhancer/wiki/Determining-Telemetry-Synchronization-Value

New Release Candidates coming tonight once I get home!

Michel-NL commented 7 years ago

Great tutorial 👍 Closing this item...its a problem between the chair and the keyboard ;-)