Turn On method doesn't work correct if application executes after game launched

Issue Description:
In our application we need to turn on replay mode, but it doesn’t work correct if application were launched after the game launch. We use simple code constructions for implementation:

let streamSettings = {
“video”: {
“auto_detect”: true,
“sub_folder_name”: ‘video’,
“fps”: this.videoFps,
“width”: this.videoWidth,
“height”: this.videoHeight,
“auto_calc_kbps”: true,
“buffer_length”: 18000,
“max_kbps”: 20000,
‘frame_interval’: 1,
“test_drop_frames_interval”: 1,
“notify_dropped_frames_ratio”: 2,
“max_file_size_bytes”: 1000000000,
“include_full_size_video”: true,
“override_overwolf_setting”: true,
“disable_when_sht_not_supported”: false,
},
“gif_as_video”: true,
“max_quota_gb”: 10,};

console.log( Initializing stream settings: ${JSON.stringify(streamSettings)} );

overwolf.media.replays.turnOn({
“settings”: streamSettings,
“highlights”: {
“enable” : false,
“requireHighlights” : “kill”
}
}, (res) =>{

console.log(turnOn callback: ${JSON.stringify(res)});
if (!res.success && res.error != “Not in a game.”) {

console.log(Error when trying to Turn on capturing: ${JSON.stringify(res, counter)});
this.enableCapture(counter+1);

}
return;
});

Usualy this error appears if we trying to run application when game is already started, but according to users’ feedback it can happen even if plugin was launched first. This issue causes a lot of unpredictable errors, bc sometimes it can starts replay mode just after a game event and captue it correctly, but often this case means no correct replays will be recorded.

Maybe it depends on pc perfomance, but we find this error quite important in any case.

Steps to reproduce:

  • Launch game
  • Launch plugin

Impact for my app: critical

Do you currently have a workaround? No

10.08.2020 12:06 - incorrect start (I closed the game in 15 seconds but in a correct case turning on takes 4 second)
10.08.2020 12:08 - correct start

Log.zip (133.7 KB)

@Vlad.Villevald I can see that you continued the discussion on this issue on this slack thread:
https://overwolfdevs.slack.com/archives/G011GEEG8GL/p1597054104102100

So meanwhile, I mark this ticket as closed (I don’t lock it). We can reopen it as necessary.
BTW - it’s always better (and easier) to manage these kinds of issues here and not in slack, unless there is some private info that you don’t want to share here with the public, etc. But I don’t think that this is the case.

@Vlad.Villevald To summarize the slack thread: the logs show some game freeze or rendering issue when the app launches AFTER the game.

We want to eliminate that the GEP is the cause.

Can you please disable the GEP plugin (by changing the name of the dll) for your latest installed version?

This is an example of v153.3.5.
You should make sure to change it to your latest version installed:

%localappdata%\Overwolf\Extensions\ggfmakpbllghoepnmfelddbminamnbmfelbahfdp\153.3.5\plugins\GEPPlugin64.dll

Anyway, attach here the logs, please.

Waiting for your update.

Log.zip (945.0 KB)

Here is the logs archive. You can look for:
background.html.log (15:31-15:39) vs background.html.8.log (14:54 - 15:24)
Or:
background.html.7.log (14:27-14:48) vs background.html.6.log (14:07 - 14.26)

“vs” means “In the first case I launched game before OW start and in the another i reversed that”
So that you can see that in “unmarked” and 7-th log turnOn callback wrote in 2 seconds after previous log, but in 8-th and 6-th log that takes much more time, because turnOn method executes only after match start. So I can say that GEP plugin renaming does not solve our issue

Renamed file: …\AppData\Local\Overwolf\Extensions\ggfmakpbllghoepnmfelddbminamnbmfelbahfdp\155.0.4\plugins_GEPPlugin64.dll

@Vlad.Villevald When you launch OW after the game has started, it takes some time for the OW engine to identify the game and to start rendering: sometimes 1-3 minutes. Especially in Dota-2.

From the attached logs we can see that it’s working after some delay:

20-08-26 14:54:22,823 (INFO) </dist/background/background.js> (:565) - Reading settings file: "{\"Binds\":[{\"Name\":\"Start Recording\",\"Key\":220}],\"ResHeight\":1080,\"ResWidth\":1920,\"Fps\":60,\"Mic\":false}\r\n"
2020-08-26 14:54:22,825 (INFO) </dist/background/background.js> (:853) - Audio settings: {"success":true,"status":"success"}
2020-08-26 14:54:22,826 (INFO) </dist/background/background.js> (:855) - Initializing stream settings: {"video":{"auto_detect":true,"sub_folder_name":"video","fps":60,"width":1920,"height":1080,"auto_calc_kbps":true,"buffer_length":18000,"max_kbps":20000,"frame_interval":1,"test_drop_frames_interval":1,"notify_dropped_frames_ratio":2,"max_file_size_bytes":1000000000,"include_full_size_video":true,"override_overwolf_setting":true,"disable_when_sht_not_supported":false},"gif_as_video":true,"max_quota_gb":10}
2020-08-26 14:56:18,177 (INFO) </dist/background/background.js> (:863) - turnOn callback: {"success":true,"status":"success","error":"","description":"","metadata":"","mediaFolder":"C:\\Users\\¬лад\\Videos\\Overwolf\\Flexer\\Dota 2\\Dota 2_08-26-2020_14-54-22-873","osVersion":"10.0.17763.1","osBuild":"1809"}

Can you please clarify :

  1. If you launch OW before the game launch - is everything working as expected? Do you get events right, the capture is using, etc.? But when you launch the game and than OW - what happens than?
  2. If it’s reproducible - please give me the exact steps to reproduce. And instruction on how to install your app…
    3.if it’s reproducible - try it again, but now give it 3 min to “Adjust.” Thank try to capture. Tell me if it worked for you. Thanks!

Log.zip (1.2 MB)

Here’s the logs with clear example, you can read background.html.log in Sample app (this is my local dev build), or just see the attached screenshot

1. Yes, if you launch OW before the game launch it works well, everything happens as expected, but if you launch game before, code execution stops as I explained below

It took 8 minutes before turn On executes, because I did nothing for 8 minutes and then started match.

My explanation on this case:
If you launch game when OW is not started yet, code execution stops right before turnOn method wherever you set it in your code. I marked my thought about where this point of “interruption” is on the second screenshot

2
Steps to reproduce:

  1. Launch the game you want to play
  2. Lanch OW client
  3. Do nothing for a while
  4. Read logs, here should be nothing after “</dist/background/background.js> (:938) - Audio settings: {“success”:true,“status”:“success”}” line, but regulary here must appear “</dist/background/background.js> (:959) - turnOn callback…” after only 4-15 seconds
  5. Start your match and turnOn line appears

This is realy important issue because this case make us hope on user’s peformance, if their PC is “weak” it may take much time to turn on capture mode and some events may not be recorded.

To reproduce this issue you only need to install plugin, not Flexer video editor or mobile app required, but if you want to test it with all other environment, we have editor installer able to download from flexer.gg website, captured videos should appear in Gameplay menu

I will check your reply tomorrow and update. thanks.

working on that. Will give you an update today. thanks for your patience.

Hi. I tried to reproduce it again, with my demo app, without any success.
I didn’t use Dota 2 (downloading it now), but I would expect that it will also happen in other games if it’s an infrastructure issue.

I run the game before OW, and then i tried to use the turnOn. And I got success.

Can you please attach me to your app that you are testing with? I want to make sure that we are not missing something here. I need to reproduce it. I will simulate your same conditions (your test app + Dota 2).

Please update.

Hi!
This is our app which you can use for test:
http://download.overwolf.com/install/Download?PartnerId=3993
You can test it not only with dota2, it works the same way with R6 siege of PUBG as far as I know

And here i have one more log with my comments inside
background.html.log (4.4 KB)

1 Like

I will try to test it today. If not, on Sunday.

Thanks.

How’s your test going?

@Vlad.Villevald, sorry for the delay. I waited for a client release that I thought might affect on this issue. I will update the MID day again. Thanks again for all the patience.

1 Like

Just an update: no changes, still not finished to test it. unfortunately. I will try to finish it ASAP, hopefully, tomorrow. I will update again tomorrow. Thanks.

Updating: checked-in dota2. No success in reproducing. Check again today with other games as well. I Will update soon.

Log.zip (1.6 MB)
Here we have another logs with this issue i did right now. I started DOTA at 13:12 and did nothing for 20 minutes untill 13:33 I started the match. You can see Sample app (my test build) background.html.log logs for this, so I don’t know why you cannot reproduce the issue

These are the steps that I did:

  1. exit OW.
  2. launch Dota2. Start a match.
  3. launch OW.
  4. Open the dev tools for our simulator app (note that I manually added the right capture permissions to this app before).
  5. define variable with the capture settings:
    "video": {
        "override_overwolf_setting" : false, 
        "fps" :30,
        "width" :1920,
        "height" : 1080
    }
};
  1. Call turnOn:
overwolf.media.replays.turnOn({
    "settings": streamSetting,
    "highlights": {
        "enable" : true, 
        "requiredHighlights" : ["death","assist","kill"] // events to capture
    }
}, console.log);

Result: the highlights captured successfully (death, for example).

I did the same with manual capture using the reply API:
exit OW, launch game, launch OW, open dev console, turnOn, start capture and stop capture - also succusfully captured the Videos.

Note that for the test I disabled all the othert capture apps that installed on my client.

Can you try this case with our extension, please? I still have error and we need to know what is the reason

@Vlad.Villevald sure. I will try it today and let you know.

@Vlad.Villevald I’ve tried it using your app. TL;DR it worked as expected both with auto-highlights enabled or disabled (manual capture using start and stop).

  • Per your request, I used the latest OPK that you attached in your team slack channel.
  • I opened the dev console of your background page.
  • I called turnOff (as you already called turnOn), and then I got turnOn with your settings as defined above (I removed some params like fps that used local params) and I got the captured videos.
let streamSettings = {"video": {"auto_detect": true,"sub_folder_name": "video","auto_calc_kbps": true,"buffer_length": 18000,"max_kbps": 20000,"frame_interval": 1,"test_drop_frames_interval": 1,
"notify_dropped_frames_ratio": 2,"max_file_size_bytes": 1000000000,"include_full_size_video": true,"override_overwolf_setting": true,"disable_when_sht_not_supported": false},"gif_as_video": true,"max_quota_gb": 10};
  • Then I called turnOn():
overwolf.media.replays.turnOn({"settings": streamSettings,"highlights":{"enable":false,"requireHighlights":"death"}},console.log)
  • And startCapture/stop:
overwolf.media.replays.startCapture(100,console.log)

And it’s worked as expected. Like I mentioned before, It worked also with auto-highlights enabled.

Please try this scenario and let me know. For now - try to load OW before the game starts. If it works, we will test what happens when you run OW after the game is launched.

@itayG FYI.