-
Notifications
You must be signed in to change notification settings - Fork 0
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
Audio/Video demo is broken #109
Comments
is this related to this sipsorcery-org/sipsorcery#698 |
Yes, indeed! However, neither version of the included library would work for me. Neither on Windows, nor Linux. Building the library from source works if you then package it correctly when exporting the app. The whole package is still in pre-release. In the mean time here is what you can do: Compared to using the "official" way there is barely any difference. The only thing you are loosing is automatic event handling and transcoding, which currently is also broken for most given the library won't work out of the box.
|
SIPSorcery provides unit tests and examples, but I still fail to see why the provided e.g. video streaming examples by SIPSorcery are allowed to fail without a fix or PR from users (I have not check that yet) |
They do! But their current version unfortunately still is a pre-release and the issue seems to be documented. I've also read that it may be a packaging issue. Simply by manually downloading Rh NuGet package and swapping library files around also seems to fix it. Using SIPSorcery's package seemed to be a logical choice, but in hindsight not all the best. Is there high demand to get the Audio/Video Demo fully working? |
@SakulFlee |
Yes, I've updated the issue description, it describes the issue in more details, but here is a shorter form:
Once this is achievable, I would love to have this demo re-added (after all, WebRTC is a communication technology).
If there is high demand, I can only encourage you to play around and try some things out. |
Thx for clarifying. I will try asking around for solution |
This is the closest demo on WebRTC for audio and video. Would like your view on the challenges discussed here |
https://docs.godotengine.org/en/stable/tutorials/animation/playing_videos.html
|
That's a voice/audio only solution. |
I need more time to have the overview. Thx for any feedback U can provide |
That's exactly what I was saying. From what I can tell, this isn't really possible on all platforms and would require other people either compiling a lot (Cross-Platform ...) Libraries before even opening the project, or, we would need to bundle a precompiled binary. What we could do is make a demo out of this, seperate to the main project, and have it with a lot of requirements/limitations. |
For Godot, it is important to demo this is possible in Godot. This helps getting more people excited and contribute. WebRTC video streaming has been high on request. See Godot demo issues. Although it is imperfect, not possible for all platforms, it is still important to show in what way it works in Godot. In time, some one would implement the missing cross platform in Gdextension c++ or rust I can't tell why there is no WebRTC video streaming yet by Godot team It is still good idea, like u said to demo to inspire others. |
Are you willing to spend time on this and porting something like FFMPEG to GDExt.?
Godot, being a game engine, doesn't have a high focus on VoIP/Calling/Video Calling. However, there are multiple issues like I stated. Not just the library issue:
Alternatively: We need a "Video Player Node" for Godot that supports some other format like
Transmitting data over WebRTC is possible and the main goal of this project. If we are just talking about transmitting a video+audio over WebRTC and then displaying it, that's easily done. |
Since Audio was never an issue, we could compromise at implementing VoIP (audio-only). And once there is some development around, either:
We could add Video support. |
Both require bundling of FFMPEG or libraries related to it which I want to avoid it possible. |
@GeorgeS2019 I might have found a solution for the FFMPEG issue, but it had to wait until 2.0.0 is done. Still no solution for webcam though. |
webcam => godot GDMP |
Have you considered embedding some kind of a webview? This would resolve 99% of "feature X is not supported" issues on all platforms, including video streaming and playback, webrtc, GUI scaling, and so on. One could add a node to render a browser surface, sprinkle it with some JS interop, and have a reasonably stable workaround in place. |
I like the idea in concept, however there currently doesn't seem to be any webview implementation for Godot. Porting CEF (Chromium Embedded Framework) to Godot certainly seems possible, but would be a massive overhead just to get this demo working. sharpWebview & webview might be worth a try, though from a quick look it doesn't seem like there is an easy way to make this work with Godot. Especially, Live de- & encoding using something like FFMPEG might be the only way (for now at least).
I don't know anything about GDMP and MediaPipe, but it looks more like a Machine-Learning solution than a pure webcam access. $~> ffmpeg -list_devices true -f dshow -i dummy
(...)
[dshow @ 000001f76251a300] "Integrated Camera" (video)
[dshow @ 000001f76251a300] Alternative name "@device_pnp_\\?\usb#vid_5986&pid_212b&mi_00#7&155234e1&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 000001f76251a300] "OBS Virtual Camera" (none)
[dshow @ 000001f76251a300] Alternative name "@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}"
[dshow @ 000001f76251a300] "Microphone (Realtek(R) Audio)" (audio)
[dshow @ 000001f76251a300] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{46D75241-389F-4203-A402-106E94028BDC}"
[dshow @ 000001f76251a300] "Microphone Array (Realtek(R) Audio)" (audio)
[dshow @ 000001f76251a300] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{1E21DAC9-A62F-482A-AFB8-4D041D03BEA7}"
[dshow @ 000001f76251a300] "Microphone (Steam Streaming Microphone)" (audio)
[dshow @ 000001f76251a300] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{3F4AC327-D414-4856-AB0C-D9BEA83F1B7D}" I can't give an ETA yet, but I will start working on this after v2.0.0 which should be around the corner! :) |
WebRTC is intended to be a real-time P2P communication protocol.
It's mainly used for VoIP (Voice-over-IP, i.e. audio/video calling).
Having support for proper Audio/Video communication via the plugin is a wanted goal.
However, while trying to implement this now for the third time, I've encountered some issues with different parts.
Below, I will describe what exactly the approach and consequent issues were.
Once any of the issues get resolved, we can properly add the Video/Audio demo.
Until then, the Demo will be scrapped.
SIPSorcery's Media libraries
SIPSorcery (maker of the WebRTC library used) actually provide a separate library for Media related things.
Mainly, audio and video streaming & communication.
The issue with their library is that it still is a pre-release and has been for years at this point.
When it works, it works beautifully and is relatively simple to use, but in most cases it doesn't work out of the box.
Mostly, the issue can be traced back to some broken library file, which may or may not be included for your target platform.
Building this library yourself does fix the issue, but you are required to build it for every platform x architecture you are targeting. This is simply out of scope for this project.
Once SIPSorcery properly releases their libraries and fixes issues with the media encoding/decoding, this may be the most viable solution.
Using Godot's VideoStream nodes/classes
Godot itself comes with video playing support via VideoStreamPlayer.
You can read more about it here: Godot: Playing videos.
In theory, this sounds ideal!
A Godot-"native" video support would mean we just have to stream (or transfer) the target video and display it.
However, many issues arose:
Ogg Theora
format and nothing else.Ogg Theora
isn't properly streamable -> you have to basically transfer the whole file first.Ogg Theora
converted file for me. Even after following their guide about using FFMPEG to convert videos.The transfer itself (2.) isn't a big issue. It just means that we have to wait first for the file transfer to be finished, which, depending on the size of the video file, can take a bit.
But Godot basically refusing to open the video file at all is a big problem.
You are also forced to use the
.ogv
(Ogg Theora
) format.Using 3rd party libraries to extract frames
Lastly, I had the idea to split the video into frames and an audio stream (audio actually never was an issue!).
This approach would dissect the video into frames (e.g. 30FPS == 30 frames per second) that would get send to the peer, then displayed as a texture on a rectangle or something like it.
This sounds ideal, since we aren't required to use the
VideoStream
nodes from the above approach and are "just" displaying images and playing back some audio.However, the issue is actually similar to the first approach: Any library I could find that enables us to dissect a video into frames is based on something like
FFMPEG
,GStreamer
,VLC
, etc. and none of those come with it bundled.Meaning, you have to have the said tool installed locally on your machine, thus on every device running the app/game.
Furthermore, it would probably be impossible to have this working on Android or iOS, given that most of those based upon libraries don't build for those platforms.
This approach is working, but you will have to do some encoding manually first:
Steps 4-5 are easy to do and do work.
Step 1-3 are the essential problem.
Like stated above, there currently is no good and proper way to get this working with the current version of Godot (4.2) and state of libraries for C#, given dependencies.
I will use this issue branch to revert some changes being done for each approach (stripping out unnecessary things) and will close this issue for now.
If in the future there is demand for this AND a proper solution can be found (ideally with Godot tools ...), please reopen this issue and let us discuss.
Update:
A few things have changed, this issue is being developed on again.
The tasks are:
Note
Video streaming quality is relataively low due to a packet size limitation with WebRTC.
Potential solutions for this are out-of-scope, but are discussed in the documentation.
The text was updated successfully, but these errors were encountered: