paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.74k stars 354 forks source link

Streamer example not working #836

Closed Azario16 closed 1 year ago

Azario16 commented 1 year ago

Hello! I'm getting an error with the streamer example

I start signaling-server-nodejs or signaling-server-python I open the address http://127.0.0.1:8080/ in the browser I run libdatachannel\out\build\x64-Debug\examples\streamer\streamer.exe

In the browser I press the 'Start' button and the streamer.exe application fails

Debug Error!

Program: ...atachannel\out\build\x64-Debug\examples\streamer\streamer.exe

abort() has been called

(Press Retry to debug the application)

Output in streamer.exe window

The local ID is: server
URL is ws://127.0.0.1:8000/server
Waiting for signaling to be connected...
WebSocket connected, signaling ready
Enter to exit
Gathering State: in-progress
State: connecting
Gathering State: complete
Video from PL5lSBWvVt opened
Audio from PL5lSBWvVt opened
Sending video sample with size: 0 to PL5lSBWvVt
State: connected
Assertion failed: newProduct.messages && !newProduct.messages->empty(), file C:\ospanel\domains\libdatachannel\src\mediahandlerelement.cpp, line 164
Message from PL5lSBWvVt received: Pong 0
Message from PL5lSBWvVt received: Pong 1003
Message from PL5lSBWvVt received: Pong 2005

With all this, the libdatachannel\out\build\x64-Debug\examples\media-sender example works for me and displays video from my camera in the browser

paullouisageneau commented 1 year ago

The streamer example expects the samples to be found in ../../../examples/streamer/samples/opus/ and ../../../examples/streamer/samples/h264/ by default, which allows running in from a build directory like build/examples/streamer.

Since your build directory is deeper, you need to either adapt the paths (using the -a and -b command line options) or copy the samples.

Azario16 commented 1 year ago

Changed the path, now it works, thanks!