Video is getting created more than buffer length

Team, Here is the issue details, If we set Buffer_Length to 1000 (1 second) then captured video for 6 seconds If we set 2 Seconds as buffer_ Length then captured video for 7 seconds. How to create a video with the exact buffer_length?

Buffer Length VideoSize
250 milliseconds 21 seconds
500 milliseconds 21 seconds
1000 6 Seconds
2000 7 Seconds
3000 9 Seconds

here is my sample code:
overwolf.media.replays.turnOn({
“highlights” : {
“enable” : true,
“requiredHighlights” : [“kill”]
},
“settings” : {
“gif_as_video”: false,
“max_quota_gb” : 2,
“video” : {
“sub_folder_name” : “C:\Users\91994\Videos\Overwolf”,
“auto_calc_kbps”:true,
“fps” :30,
“width” :1920,
“height” : 1080,
“max_kbps” : 100,
“buffer_length”:2000,
“frame_interval”: 30,
“test_drop_frames_interval”:100,
“notify_dropped_frames_ratio”: 30,
“max_file_size_bytes” : 10000000,
“include_full_size_video” : false,
“override_overwolf_setting”:true,
“disable_when_sht_not_supported” : false ,
“indication_position”: overwolf.streaming.enums.IndicationPosition.BottomLeftCorner,
“indication_type”:overwolf.streaming.enums.IndicationType.DotAndTimer,
“use_app_display_name” : true
}
}
}, function(status) {
self.logLine(self._eventsLog, "Video Capture Callback Status : " + JSON.stringify(status, null, 2) , true);
});

Hi.

Can you please tell me which game is that, what you are trying to achieve here, and what is the issue? basically, when you are setting auto highlights, everything should be taken care of automatically. What exactly is the issue.

I am working with CS:GO and I am setting “buffer_length” is 2000, Instead of the 2 seconds video, I am able to see 7 seconds video. here is the example

If I set 250 milliseconds as buffer_length then captured video size is 21 seconds
If I set 500 milliseconds as buffer_length then captured video size is 21 seconds
If I set 1000 (1 second) as buffer_length then captured video size is 6 Seconds
If I set 2000 (2 seconds) as buffer_length then captured video size is 7 Seconds
If I set 3000 (3 seconds) as buffer_length then captured video size is 9 Seconds

In every auto-highlight, we are recording a little bit before and after the kill.
Why do you want to capture only 2 seconds of video? Can you please show as the video that is problematic (when you don’t set any buffer_length which means he will use the default)?

Regardless, if you like to implement a customized behavior, you can use manual capture (turn off the auto highlights, listen to the event and capture it manulaly ).

As you said, Is it possible to control “little bit before and after the kill” by using auto-heighlight feature.?

Actually, I want to record only the event but not the “little bit before and after the event”. one more question here,
If I set 250 milliseconds as buffer_length then captured video size is 21 seconds. Why it is for 21 seconds video got recorded.?

“Playing” with the buffer size when auto-highlights is enabled is not the right way to do that.
If you want to capture only the kill itself or other custom behavior - you should use manual capture. Then, try to adjust the right pastDuration and futureDuration. If you need more fine-tuning, only then play with the buffer size. (make sure it’s bigger then the pastDuration + futureDuration).

How come I know that as am going to kill/ get killed/victory? Can you provide me sample on this?

Once you turnOn() the manual capture (not start, just turnOn) - there is always a buffer that captures your game under the hood. So you should listen to game events. Once a kill is triggered, you start() the capture, with the right pastDuration and futureDuration.

The pastDuration will be taken from the buffer, and the capture will continue till the futureDuration.

I hope that it’s clear and makes sense.

If I set pastDuration and FutureDuration to 2 seconds and buffer_length to 3/4/5 seconds .Extension capturing as expected.

If I set pastDuration and FutureDuration to 2 seconds and buffer_length to 1 second .Extension capturing full video(i.e Total Game Video). It is an abnormal behavior .May I know, Why?

here is the code

private onNewEvents(e) {
const shouldHighlight = e.events.some(event => {
  if(event.name == 'kill' ){
    overwolf.media.replays.capture(2000, 2000, function(status){ 
      overwolf.extensions.io.writeTextFile(overwolf.extensions.io.enums.StorageSpace.pictures,"Captured", JSON.stringify(status,null,2),
      console.log);
  
     }, function(status){
      overwolf.extensions.io.writeTextFile(overwolf.extensions.io.enums.StorageSpace.pictures,"Captured1", JSON.stringify(status,null,2),
      console.log);
      });
  }
  return event.name === 'kill' 
});

// Video Capturing code....
let self = this;

overwolf.media.replays.turnOn({
          "highlights" : {
          "enable" : false,
          "requiredHighlights" : ["kill"]              
    },
    "settings" : {            
      "gif_as_video": false,
      "max_quota_gb" : 2,           
      "video" : {
      "sub_folder_name" : "C:\Users\91994\Videos\Overwolf",
       "auto_calc_kbps":true,
       "fps" :30,
       "width" :1920,
       "height" : 1080,
       "max_kbps" : 100,
       "buffer_length":1000,
       "frame_interval": 30,
       "test_drop_frames_interval":100,
       "notify_dropped_frames_ratio": 30,
       "max_file_size_bytes" : 10000000,
       "include_full_size_video" : false,          
       "override_overwolf_setting":true,         
       "disable_when_sht_not_supported" : false ,
       "indication_position":  overwolf.streaming.enums.IndicationPosition.BottomLeftCorner,
       "indication_type":overwolf.streaming.enums.IndicationType.DotAndTimer,
       "use_app_display_name" : true
      }
    }
  }, function(status) {
      self.logLine(self._eventsLog, "Video Capture Callback Status : " + JSON.stringify(status, null, 2)   , true);
  });

please help me on this

If I’m not mistaken, it was solved on the slack, so I’m closing the ticket.
If you still need something, please let me know.

Thanks