Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instant replay / Replay buffer capturing #47

Open
N72826 opened this issue Oct 12, 2022 · 16 comments
Open

Instant replay / Replay buffer capturing #47

N72826 opened this issue Oct 12, 2022 · 16 comments
Labels
enhancement New feature or request

Comments

@N72826
Copy link

N72826 commented Oct 12, 2022

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.

@sonicv6
Copy link
Contributor

sonicv6 commented Oct 12, 2022

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.

@N72826
Copy link
Author

N72826 commented Oct 12, 2022

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 N72826 closed this as completed Oct 12, 2022
@sonicv6
Copy link
Contributor

sonicv6 commented Oct 12, 2022

Leave the issue open so we remember it haha

@N72826 N72826 reopened this Oct 12, 2022
@N72826
Copy link
Author

N72826 commented Oct 12, 2022

Leave the issue open so we remember it haha

oh shit my bad lol

@lulzsun
Copy link
Owner

lulzsun commented Oct 13, 2022

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 lulzsun added the enhancement New feature or request label Oct 13, 2022
@lulzsun lulzsun changed the title clip last 30 seconds Feature Request: Instant replay / Replay buffer capturing Oct 13, 2022
@lulzsun lulzsun changed the title Feature Request: Instant replay / Replay buffer capturing Instant replay / Replay buffer capturing Oct 22, 2022
@candroid-man
Copy link

candroid-man commented Apr 17, 2023

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)

@eiqnepm
Copy link
Contributor

eiqnepm commented Jul 6, 2023

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.

@Segergren
Copy link
Contributor

@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.

@lulzsun
Copy link
Owner

lulzsun commented Jul 13, 2023

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.

@Nama
Copy link

Nama commented Sep 29, 2023

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

@josc19
Copy link

josc19 commented Oct 6, 2023

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.

@lulzsun
Copy link
Owner

lulzsun commented Oct 6, 2023

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.

@Bmilner88
Copy link

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

@sonicv6
Copy link
Contributor

sonicv6 commented Feb 6, 2024

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.

@sshcrack
Copy link
Contributor

sshcrack commented Apr 25, 2024

@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?

@lulzsun
Copy link
Owner

lulzsun commented Apr 25, 2024

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));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants