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

How to have two simultaneous sessions ? #4

Closed
nishachar opened this issue Nov 7, 2017 · 4 comments
Closed

How to have two simultaneous sessions ? #4

nishachar opened this issue Nov 7, 2017 · 4 comments

Comments

@nishachar
Copy link

first of all awesome work !!! Thanks ffor making it public.

My issue is that when i am trying to have two simultaneous sessions, ffmpeg throws error -

From ffmpeg:
'[udp @ 0x14fa9a0] bind failed: Address already in use
/opt/conference/kurento-rtmp/127.0.0.1_55001.sdp: Invalid data found when processing input

Requesting help in resolving this. I already tried changing the audio port in sdp file dynamically like video. It did not help.

@godka
Copy link
Owner

godka commented Nov 7, 2017

thx for your interest,please fine the reply inline :)
Q:how to have two simultaneous sessions?
A:
what is simultaneous sessions?you mean mix two rtp sessions into one session?
the correct process for establishing rtp-rtmp bridge is:

create rtp protocol -> save sdp file -> ffmpeg read sdp file -> transcode to rtmp

in server.js,you will find this code

                        console.log('my session id:', sessionId);
                        var streamPort = 55000 + session_index;
                        session_index++;    //change to next port
                        var streamIp = '127.0.0.1';//Test ip

According to the process,the session-index should be cumulative while another session requests.
if you wanna mix two rtp in one session,try to fix this code.

@nishachar
Copy link
Author

This approach of incrementing the session index by one and assigning it to port is not working. You can test this bug on the test link that u have given. I have however figured out the problem. FFMPEG blocks two ports and not one when you run a sdp file. One is the port mentioned in the sdp and the port immidiately after it. Thats why the next incremented port used un second SDP gave "Address already in use" error. I have fixed the error and attaching the updated server.js with this comment. If you find it ok, please commit it. ( please remove the .txt from the file extention )
Once again, awesome work

server.js.txt

@nishachar
Copy link
Author

And also if i may very humbly suggest you to put up a licence file in your code base.

@godka
Copy link
Owner

godka commented Nov 8, 2017

good job bro,I've commit your code and add apache license.
thx for your interest again!

@godka godka closed this as completed Jan 10, 2018
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

2 participants