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

webrtc-to-rtmp demo can't work #30

Open
mightZhong opened this issue May 20, 2020 · 5 comments
Open

webrtc-to-rtmp demo can't work #30

mightZhong opened this issue May 20, 2020 · 5 comments

Comments

@mightZhong
Copy link

Hi , I tested the webrtc-to-rtmp demo, but it can't work. Following is my test steps

  1. change the IP set in NewRtmpPusher to my nginx-rtmp server, then go build
  2. run the executable file webrtc-to-rtmp and open the webrtc test web in chrome, I can see myself in local and remote stream.
  3. there is no log of "video frame ==========" or "audio frame ===== " print, and no rtmp stream send to my nginx-rtmp server

I wondering if there is something wrong in my steps, any suggestion is appreciated~

@shelomito12
Copy link

Were you able to fix it?

After building the main media-server-go, I executed the command go build in the webrtc-to-rtmp/ directory and got the following:

$ go build
# github.com/notedit/media-server-go-demo/webrtc-to-rtmp
./server.go:124:30: cannot use func literal (type func([]byte, uint)) as type func([]byte, uint64) in argument to videoTrack.OnMediaFrame
./server.go:139:30: cannot use func literal (type func([]byte, uint)) as type func([]byte, uint64) in argument to audioTrack.OnMediaFrame

@marcelhencke
Copy link

@jzvi12 replace uint by uint64 in the server.go file and now it should compile

@marcelhencke
Copy link

In commit: f0bcbc9 in the mediaframemultiplexer.go file the callback logic was disable.
Because in the media-server project (https://github.com/medooze/media-server) not the media-server-go project, some changes where made to media-server/include/media.h file.

Amongst other things the GetData() method gets overloaded in a clever way to optimize performance. But this is to much for the SWIG compiler, which then creates 3 functions, one being a switch for the other two, but returning an interface{} instead of a pointer.

What is to do:

  1. install swig: apt install swig
  2. edit media-server/include/media.h and remove follow line const BYTE* GetData() const { return buffer->GetData();} currently at line 166
  3. edit wrapper/mediaserver.i and add %include "../media-server/include/media.h" before %include "../media-server/include/acumulator.h" currently at line 965
  4. run swig -go -c++ -cgo -intgosize 64 mediaserver.i
  5. edit mediaframemultiplexer.go import fmt and unsafe and enable the code under OnMediaFrame

@notedit
Copy link
Owner

notedit commented Jan 7, 2021

@marcelhencke Do you have some free time to support media-server-go developing? I am a bit busy these days.

@marcelhencke
Copy link

@marcelhencke Do you have some free time to support media-server-go developing? I am a bit busy these days.

I don't have much free time myself.
But since I want to build on this project and I need the GStreamer support, I would be happy to support the project and maintain it's functionality.

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

No branches or pull requests

4 participants