RePlays icon indicating copy to clipboard operation
RePlays copied to clipboard

Instant replay / Replay buffer capturing

Open N72826 opened this issue 2 years ago • 17 comments

Hey I really appreciate you for creating this. MedalTV is functional but I have a feeling their premium is going to drive it into the ground. They already made it so you can't download your uploaded clips without a watermark without paying. They also "temporarily" disabled embedding on discord, which is ridiculous.

Are there any plans to implement a clip feature that allows you to capture the last x seconds?

I see you are using OBS to perform the capturing, and what I am asking for may be extremely difficult because of this. I believe that the way this feature works is through recording all the time and deleting the recorded content that wasn't marked for capture with the chosen hotkey. I am unsure how this would be accomplished but it would truly make this platform a superior alternative to Medal.

N72826 avatar Oct 12 '22 19:10 N72826

This should be possible, I've got a few other things I'd rather do before working on this but someone else might take it up.

sonicv6 avatar Oct 12 '22 20:10 sonicv6

This should be possible, I've got a few other things I'd rather do before working on this but someone else might take it up.

oh nice! I will definitely be watching this project closely. Thank you and everyone else who works on this!

N72826 avatar Oct 12 '22 20:10 N72826

Leave the issue open so we remember it haha

sonicv6 avatar Oct 12 '22 20:10 sonicv6

Leave the issue open so we remember it haha

oh shit my bad lol

N72826 avatar Oct 12 '22 20:10 N72826

OBS does have a replay buffer feature already built in, so yes, this implementation isn't too difficult. It's actually common in these types of applications.

This will probably be implemented eventually, but as sonicv6 said, it may be awhile until it does because of other priorities. But I'll try to keep it in mind.

lulzsun avatar Oct 13 '22 01:10 lulzsun

I downloaded this app because that's what I thought this would do 😆

I would much rather use RePlays to handle Replay Buffer because you have a built-in editor that is super simple. With OBS, I have to get the file, open like DaVinci Resolve or something, edit the video, render it, upload it to PeerTube, share. With RePlays I would like to have a similar experience to Medal.tv, where you just hit F8 to save 1–5 minutes of gameplay, edit the file quickly and upload it immediately. Also, when you implement this, be sure to allow the user to save both files locally (the clipped version and the full file)

candroid-man avatar Apr 17 '23 04:04 candroid-man

This is a really nice app! No account registration and a simple yet effective interface. The app doesn't use too much resources in the background either, I'm looking at you memory hog Medal.

I've just been playing around with it. If all you wanted to do was record whole game sessions, it's great!

Unfortunately for me, I would require push to talk and a reply buffer to use it as my primary recording software. Alas I'm stuck with Medal for now.

I'll watch for any updates on this though.

eiqnepm avatar Jul 06 '23 00:07 eiqnepm

@lulzsun Have you looked into it? If so, are there any part that is extra hard to implement? I tried to look into it about a month ago but my limited DLL/C++ skills were not enough.

Segergren avatar Jul 13 '23 18:07 Segergren

It is in progress and I have got it working in an example here: libobs.NET

However, I have not decided to implement it yet because I currently want to focus on refactoring, specially the recording back-end and the keybinding system (doing this right now as we speak). Once I feel satisfied with the refactoring, I will be ready to implement instant replay.

lulzsun avatar Jul 13 '23 18:07 lulzsun

I really thought that this would be the main reason this app exists and was confused about the lack of options for this XD

Nama avatar Sep 29 '23 21:09 Nama

Currently looking for a shadow play alternative that just works, shadowplay recently started to just randomly fail to load and I have no insight on what happened. I usually document bugs and crashes i run into a game im testing. OBS replay buffer is just silly since it doesn't clear the buffer on save. Medal is just gross im not touching that.

I really hope this feature becomes a thing soon.

josc19 avatar Oct 06 '23 22:10 josc19

This feature is up next on my personal TO-DO list, it's just that recently I have been busy with things unrelated to this project. I'm unable to give a time frame on when I can get around implementing this, but I promise that this is the number one priority feature to complete once I am able to find some time.

There has already been work and tests on buffer capturing using the libobs.NET library that I work on alongside this project, so all it needs is a proper implementation.

lulzsun avatar Oct 06 '23 23:10 lulzsun

Don't know if this is the right place to ask this, but when/if this gets implemented, will the files be Sessions? Or Clips?

I ask because I'm curious if the files will be editable after they are captured

Bmilner88 avatar Feb 06 '24 19:02 Bmilner88

Under the hood there's no major difference but it makes more sense for us to make them sessions precisely so you can edit them.

sonicv6 avatar Feb 06 '24 20:02 sonicv6

@lulzsun is the refactoring done? If so, would you be open to receive a pull request for this feature? Haven't looked at the libobs bindings yet but I think the methods are already implemented right?

sshcrack avatar Apr 25 '24 21:04 sshcrack

Yes, I did finish most of the refactoring, just haven't had the time to do a proper implementation of this feature. Feel free to draft a pull request for this and I may be able to assist if needed.

I did test and implemented the methods required for buffer capturing, there is an example of this provided here if you want to use as a reference:

https://github.com/lulzsun/libobs-sharp/blob/d4e990a5fb1c2df4383191e7eefa827d438d5a2a/libobs-sharp.example/Program.cs#L116-L127

// SETUP NEW BUFFER OUTPUT (OPTIONAL, just demonstrating it here in example that multiple outputs can be run)
IntPtr bufferOutputSettings = obs_data_create();
obs_data_set_string(bufferOutputSettings, "directory", "./");
obs_data_set_string(bufferOutputSettings, "format", "%CCYY-%MM-%DD %hh-%mm-%ss");
obs_data_set_string(bufferOutputSettings, "extension", "mp4");
obs_data_set_int(bufferOutputSettings, "max_time_sec", 15);
obs_data_set_int(bufferOutputSettings, "max_size_mb", 500);
IntPtr bufferOutput = obs_output_create("replay_buffer", "replay_buffer_output", bufferOutputSettings, IntPtr.Zero);
obs_data_release(bufferOutputSettings);

obs_output_set_video_encoder(bufferOutput, videoEncoder);
obs_output_set_audio_encoder(bufferOutput, audioEncoder, (UIntPtr)0);

https://github.com/lulzsun/libobs-sharp/blob/d4e990a5fb1c2df4383191e7eefa827d438d5a2a/libobs-sharp.example/Program.cs#L136-L149

// START BUFFER OUTPUT
bool bufferOutputStartSuccess = obs_output_start(bufferOutput);
Console.WriteLine("buffer output successful start: " + bufferOutputStartSuccess);
if (bufferOutputStartSuccess != true) {
    Console.WriteLine("buffer output error: '" + obs_output_get_last_error(bufferOutput) + "'");
}

// SAVE REPLAY BUFFER
Task.Run(async () => {
    await Task.Delay(5000); // Record for 5 seconds
    calldata_t cd = new();
    var ph = obs_output_get_proc_handler(bufferOutput);
    Console.WriteLine("buffer output successful save: " + proc_handler_call(ph, "save", cd));
});

lulzsun avatar Apr 25 '24 22:04 lulzsun

The PR has been merged, can we close this issue?

sshcrack avatar Jul 29 '24 09:07 sshcrack