You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preface:
I'm working on a project that captures the Video and Audio inputs from (hopefully) Any game capture device and render it on a window with customizable inputs and outputs for video in and audio in/out. What this does is it allows me to stream whatever console game I'm playing over Discord and have the viewers be able to see and hear the game (as opposed to using OBS or the like to do so, as discord has trouble capturing both audio and video with those, and I don't want to mix the game audio with my microphone audio directly).
The Problem I need help with:
On most capture devices, there will always be a bit of latency between what happens in the game and what gets rendered to the programs window. With some there is also added latency with either the audio or video, causing either to be out of sync with each other. I am using NAudio for the audio streaming and I am able to add a delay to it if needed, but I can't figure out a way to delay the video capture if the audio lags behind (example, I fire a gun in game, the video shows me firing, seconds later the gunshot is heard).
Libraries used:
(unsure if I need some of those libraries or not)
Other Lesser Problems(will make an Issue if needed):
Currently, I can easily render 1920x1080@30fps, which is just fine for my uses. I might add to the ControlsForm a resolution selection combobox, but I need a way of getting the list of possible resolutions from a device.
Creating a new VideoCapture object each time I change a video device causes the application to hang for 30 seconds, and I can see LOTS of threads opening and closing in the console. I think it has to do with using VideoCapture.API.Msmf?
Tl;Dr:
I need a way to add delay to video capture to sync with delayed audio. (and wasn't sure if this should be an issue or discussion)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Preface:
I'm working on a project that captures the Video and Audio inputs from (hopefully) Any game capture device and render it on a window with customizable inputs and outputs for video in and audio in/out. What this does is it allows me to stream whatever console game I'm playing over Discord and have the viewers be able to see and hear the game (as opposed to using OBS or the like to do so, as discord has trouble capturing both audio and video with those, and I don't want to mix the game audio with my microphone audio directly).
The Problem I need help with:
On most capture devices, there will always be a bit of latency between what happens in the game and what gets rendered to the programs window. With some there is also added latency with either the audio or video, causing either to be out of sync with each other. I am using NAudio for the audio streaming and I am able to add a delay to it if needed, but I can't figure out a way to delay the video capture if the audio lags behind (example, I fire a gun in game, the video shows me firing, seconds later the gunshot is heard).
Code Source:
https://github.com/ZornTaov/GameCaptureForDiscord/
Render Code: https://github.com/ZornTaov/GameCaptureForDiscord/blob/master/VideoCaptureForm.cs#L115
Video Device Setup Code: https://github.com/ZornTaov/GameCaptureForDiscord/blob/master/ControlsForm.cs#L193-L220
Libraries used:
![image](https://user-images.githubusercontent.com/2144351/126452956-9bdd85c1-0506-4f9c-9c56-ac543fc464f7.png)
![image](https://user-images.githubusercontent.com/2144351/126452992-3cfa6f55-7bf0-4d2a-a70e-689538a1eade.png)
(unsure if I need some of those libraries or not)
Other Lesser Problems(will make an Issue if needed):
Currently, I can easily render 1920x1080@30fps, which is just fine for my uses. I might add to the ControlsForm a resolution selection combobox, but I need a way of getting the list of possible resolutions from a device.
Creating a new VideoCapture object each time I change a video device causes the application to hang for 30 seconds, and I can see LOTS of threads opening and closing in the console. I think it has to do with using VideoCapture.API.Msmf?
Tl;Dr:
I need a way to add delay to video capture to sync with delayed audio. (and wasn't sure if this should be an issue or discussion)
Beta Was this translation helpful? Give feedback.
All reactions