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 Provider support #29

Closed
swinsey opened this issue Jun 12, 2019 · 57 comments
Closed

WebRTC Provider support #29

swinsey opened this issue Jun 12, 2019 · 57 comments

Comments

@swinsey
Copy link

swinsey commented Jun 12, 2019

only rtmp input, can u support webrtc provider?

@getroot
Copy link
Member

getroot commented Jun 12, 2019

Yes, we plan to support WebRTC Input. However, RTMP and MPEGTS/UDP have a high priority because we aim to improve the existing broadcasting system. Because we have a number of important feature additions, the WebRTC Input feature will probably be available in late 2019 or early 2020.

@swinsey
Copy link
Author

swinsey commented Jun 13, 2019

look forward to support WebRTC input, thanks!

@getroot
Copy link
Member

getroot commented Jun 13, 2019

Thank you for your kind comments.

@getroot getroot closed this as completed Jun 13, 2019
@theswedishdeveloper
Copy link

Hello, Jumping into the conversation.

How its going with the WebRTC Input? You said that the feature will be available in early 2020. I hope that it will be available soon as possible since it would made the total latency better.

Best Regards
Benjamin

@getroot
Copy link
Member

getroot commented Jun 23, 2020

Hello.

Plans to develop our WebRTC input have been postponed.
That's because our customers value RTSP and MPEG-TS (with HEVC) more importantly.

RTSP and MPEG-TS are on the verge of completion. I think this will further reduce your latency. (Note that both RTSP and WEBRTC use RTP as a data channel, so there will be no difference in latency.)

But for us, WebRTC input is still one of the very high priority tasks.

@command-tab
Copy link
Contributor

I am also very interested in a WebRTC Provider because this will allow users of my application to choose whether they want to use an entirely browser-based stream (like screen capture or webcam over WebRTC) or something more advanced like OBS Studio (layering multiple media sources and sending over RTMP). While the latter scenario is already possible, if OME had WebRTC Provider support, I would not need any additional media routing or tooling to support the former.

Thanks!

@getroot getroot reopened this Mar 15, 2021
@getroot
Copy link
Member

getroot commented Mar 15, 2021

I am currently developing the WebRTC Provider, so I reopened this task. Currently, H.264 is input and it is confirmed that it works normally, and VP8/OPUS should be supported additionally, and only a few additional tasks are required. It will be released in 0.11.2.

@getroot
Copy link
Member

getroot commented Mar 15, 2021

It's not complete yet, but you can test out WebRTC Input at the URL below. (Currently, only H.264 video is transmitted.)

https://demo.ovenplayer.com/demo_input.html

image

WebRTC Input URL works according to the following rules.

ws[s]://<host>:<port>/<app name>/<stream name>?direction=send[&transport=tcp]

<> requires you to enter the information.
[] Can be omitted.

!! Since the browser's GetUserMedia API is only available on the TLS site, you can only test it on the demo.ovenplayer.com site provided by https. Therefore, OME must also set TLS and provide the wss URL. If you are having trouble setting up TLS in OME, please allow Insecure content for demo.ovenplayer.com in Chrome's site settings as follows:

image

The setting in OME currently only needs to be set in Bind. The rules are the same as WebRTC Publisher. The settings below are examples of the settings I use while developing.

<Bind>
	<Providers>
		<RTMP>
			<Port>1935</Port>
		</RTMP>
		<MPEGTS>
			<Port>4000-4004,4005/udp</Port>
		</MPEGTS>
		<WebRTC>
			<Signalling>
				<Port>3333</Port>
			</Signalling>
			<IceCandidates>
				<TcpRelay>192.168.0.200:3478</TcpRelay>
				<IceCandidate>192.168.0.200:10006/udp</IceCandidate>
			</IceCandidates>
		</WebRTC>
	</Providers>

	<Publishers>
		<OVT>
			<Port>9000</Port>
		</OVT>
		<HLS>
			<Port>8080</Port>
		</HLS>
		<DASH>
			<Port>8080</Port>
		</DASH>
		<WebRTC>
			<Signalling>
				<Port>3333</Port>
			</Signalling>
			<IceCandidates>
				<TcpRelay>192.168.0.200:3478</TcpRelay>
				<IceCandidate>192.168.0.200:10006/udp</IceCandidate>
			</IceCandidates>
		</WebRTC>
	</Publishers>
</Bind>

@getroot getroot pinned this issue Mar 15, 2021
@alexthedamager
Copy link

Does this mean that we could use OBS-WebRTC to stream to OME? The WHIP protocol is very interesting and I think an important step towards moving away from RTMP. Allowing high bitrate stream publishing (far greater than the 2mbps limit in browsers) from OBS-WebRTC to OME would open up a world of possibilites 👍

@getroot
Copy link
Member

getroot commented Mar 16, 2021

@llspalex

WHIP is very interesting for me too. However, in order to apply the signaling defined in WHIP to OME, I feel that the WHIP spec needs to be extended a little more. (E.g. setting up TURN for TCP transport) I'll keep watching this. Since everything is ready to apply WHIP, it will not be difficult for us to apply it in the future.

I would like to look at SRT as the next provider. WebRTC Provider can meet the need to send streams directly from the browser without a separate program or plug-in, and I think SRT will be effective in transmitting high-definition video while replacing RTMP as you mentioned.

@mpisat
Copy link

mpisat commented Mar 16, 2021

I'm using nginx to provide WSS via reverse proxy to OME docker instance. I tested WebRTC and logs say:

[2021-03-16 05:41:50.241] W [SckPoolRtcSigna:11] HttpServer | http_server.cpp:218 | No module could be found to handle this connection request : [ws://xx.karsiyaka.com/app/murat/?direction=send&transport=tcp]
[2021-03-16 05:41:50.242] I [SckPoolRtcSigna:11] Socket.Server | server_socket.cpp:129 | [#9] [0x562ba80a3380] Client(<ClientSocket: 0x7f3cc400c060, #98, state: Closed, TCP, 165.xx.50.93:37352>) is disconnected

can we add ws:// support even though it won't work for webrtc publishing?

@getroot
Copy link
Member

getroot commented Mar 16, 2021

@mpisat
How about this?
ws://xx.karsiyaka.com/app/murat?direction=send&transport=tcp

@mpisat
Copy link

mpisat commented Mar 16, 2021

@mpisat
How about this?
ws://xx.karsiyaka.com/app/murat?direction=send&transport=tcp

browser don't allow insecure connection then.
Uncaught DOMException: The operation is insecure.

if I use 3334 port, which is handled by Nginx reverse proxy and LetsEncrypt SSL, it thinks I'm sending video to ws:// on port 3333, which I am, and then it doesn't let me publish video by webrtc.

ps: I can play videos on WebRTC by using TCP 3334 on Nginx reverse proxy with SSL and websockets support.

@getroot
Copy link
Member

getroot commented Mar 16, 2021

@mpisat

I mean when your nginx proxy makes a request to OME, it asks ws://host/app/stream/?direction=send and /? Instead, only? Should exist. If a querystring comes in as /?, it may not be recognized at this time.(I will check it again)

Let the player (WebRTC Producer) request 3334/TLS, and if nginx modifies the URL format when making a request to ome, I think it will work. (/? -> ?)

@mpisat
Copy link

mpisat commented Mar 16, 2021

@mpisat

I mean when your nginx proxy makes a request to OME, it asks ws://host/app/stream/?direction=send and /? Instead, only? Should exist. If a querystring comes in as /?, it may not be recognized at this time.(I will check it again)

Let the player (WebRTC Producer) request 3334/TLS, and if nginx modifies the URL format when making a request to ome, I think it will work. (/? -> ?)

I forward all requests without change anything. If there is an easy way to make it work with Docker, without nginx reverse proxy for wss, I can try? Manually compiling the project on a VPS takes several hours and it requires a lot of ram just to compile. Docker is so easy :)

#nginx config
server {

listen [::]:3334 ssl ipv6only=on; # managed by Certbot
listen 3334 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xx.karsiyaka.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xx.karsiyaka.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

location / {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $host;

  proxy_pass http://xx.karsiyaka.com:3333;

  proxy_ssl_certificate     /etc/letsencrypt/live/xx.karsiyaka.com/fullchain.pem;
  proxy_ssl_certificate_key /etc/letsencrypt/live/xx.karsiyaka.com/privkey.pem;

  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
}

}

@getroot
Copy link
Member

getroot commented Mar 16, 2021

image

In my environment I confirmed that it works well even if there is "/?" token in URL. That wasn't the problem.

I don't have a certificate on my local server, so I allowed insecure content for demo.ovenplayer.com in chrome.

Are you using the latest master version? If you want to keep testing WebRTC Input, please provide Server.xml and the URL you set in WebRTC Input.

Our server automatically creates an image of the master branch and uploads it to the docker hub.

https://hub.docker.com/r/airensoft/ovenmediaengine/tags?page=1&ordering=last_updated

@getroot
Copy link
Member

getroot commented Mar 16, 2021

Update

Now, you need to add WebRTC to the provider setting of the application.

Here is the full Server.xml I use for testing.

<?xml version="1.0" encoding="UTF-8" ?>

<Server version="8">
	<Name>OvenMediaEngine</Name>
	<Type>origin</Type>
	<IP>*</IP>

	<StunServer>stun.l.google.com:19302</StunServer>
	
<Bind>
	<Providers>
		<RTMP>
			<Port>1935</Port>
		</RTMP>
		<MPEGTS>
			<Port>4000-4004,4005/udp</Port>
		</MPEGTS>
		<WebRTC>
			<Signalling>
				<Port>3333</Port>
			</Signalling>
			<IceCandidates>
				<TcpRelay>192.168.0.200:3478</TcpRelay>
				<IceCandidate>192.168.0.200:10006/udp</IceCandidate>
			</IceCandidates>
		</WebRTC>
	</Providers>

	<Publishers>
		<OVT>
			<Port>9000</Port>
		</OVT>
		<HLS>
			<Port>8080</Port>
		</HLS>
		<DASH>
			<Port>8080</Port>
		</DASH>
		<WebRTC>
			<Signalling>
				<Port>3333</Port>
			</Signalling>
			<IceCandidates>
				<TcpRelay>192.168.0.200:3478</TcpRelay>
				<IceCandidate>192.168.0.200:10006/udp</IceCandidate>
			</IceCandidates>
		</WebRTC>
	</Publishers>
</Bind>
	<VirtualHosts>
		<VirtualHost>
			<Name>default</Name>
			<Host>
				<Names>
					<Name>*</Name>
				</Names>
			</Host>
			<Applications>
				<Application>
					<Name>app</Name>
					<Type>live</Type>
					<OutputProfiles>
						<OutputProfile>
							<Name>bypass_stream</Name>
							<OutputStreamName>${OriginStreamName}</OutputStreamName>
							<Encodes>
								<Audio>
									<Bypass>true</Bypass>
								</Audio>
								<Video>
									<Bypass>true</Bypass>
								</Video>
								<Audio>
									<Codec>opus</Codec>
									<Bitrate>128000</Bitrate>
									<Samplerate>48000</Samplerate>
									<Channel>2</Channel>
								</Audio>
							</Encodes>
						</OutputProfile>
					</OutputProfiles>
					<Providers>
						<OVT />
						<RTMP />
						<MPEGTS>
							<StreamMap>
								<Stream>
									<Name>stream</Name>
									<Port>4000</Port>
								</Stream>
								<Stream>
									<Name>stream_${Port}</Name>
									<Port>4003-4004</Port>
								</Stream>
								<Stream>
									<Name>stream_4005</Name>
									<Port>4005</Port>
								</Stream>
							</StreamMap>
						</MPEGTS>
						<RTSPPull />
						<WebRTC>
							<Timeout>30000</Timeout>
						</WebRTC>
					</Providers>
					<Publishers>
						<OVT />
						<WebRTC>
							<Timeout>30000</Timeout>
							<Rtx>true</Rtx>
							<Ulpfec>true</Ulpfec>
						</WebRTC>
						<HLS>
							<SegmentDuration>5</SegmentDuration>
							<SegmentCount>3</SegmentCount>
							<CrossDomains>
								<Url>*</Url>
							</CrossDomains>
						</HLS>
						<DASH>
							<SegmentDuration>5</SegmentDuration>
							<SegmentCount>3</SegmentCount>
							<CrossDomains>
								<Url>*</Url>
							</CrossDomains>
						</DASH>
						<LLDASH>
							<SegmentDuration>5</SegmentDuration>
							<CrossDomains>
								<Url>*</Url>
							</CrossDomains>
						</LLDASH>
					</Publishers>
				</Application>
			</Applications>
		</VirtualHost>
	</VirtualHosts>
</Server>

@mpisat
Copy link

mpisat commented Mar 16, 2021

@getroot
I use latest version in docker.
#docker pull airensoft/ovenmediaengine:latest

I guess I need to modify Server.xml in docker files overlay files then?

@getroot
Copy link
Member

getroot commented Mar 16, 2021

@mpisat

Use the :dev tag. That's the image of the master branch.
docker pull airensoft/ovenmediaengine:dev

Yes, you can overwrite Server.xml or create a volume as in the url below and use it.

https://github.com/AirenSoft/OvenMediaEngine#getting-started

@getroot
Copy link
Member

getroot commented Mar 16, 2021

I am really amazing.

image

As seen in the above capture, when playing WebRTC Input, there is only 3~4 frames latency (Browser -> OME -> Browser). WebRTC supports OPUS so there is no need for audio encoding, so it is unlikely that there will be a big difference even if audio is added.

@mpisat
Copy link

mpisat commented Mar 16, 2021

@getroot
I use dev tag now, used your Server.xml.
Because nginx reverse proxy to ws port on 3333, OME thinks the WebRTC publisher is trying to send video to WS. I will try allowing insecure content Chrome and test again.

[2021-03-16 07:55:19.961] W [SckPoolRtcSigna:10] HttpServer | http_server.cpp:218 | No module could be found to handle this connection request : [ws://do.karsiyaka.com/app/murat/?direction=send&transport=tcp]

I just tested with allowing insecure content
ws://do.karsiyaka.com:3333/app/murat/?direction=send&transport=tcp
It says
WebSocket connection to 'ws://do.karsiyaka.com:3333/app/murat/?direction=send&transport=tcp' failed:

Server URL is unmasked now.

@mpisat
Copy link

mpisat commented Mar 16, 2021

My docker command to use your Server.xml (as provided as is)

docker run -d --restart always
--env OME_ICE_CANDIDATES=do.karsiyaka.com:10006-10010/udp
-p 1935:1935
-p 3333:3333
-p 8080:8080
-p 9000:9000
-p 4000-4005:4000-4005/udp
-p 10006-10010:10006-10010/udp
-v ome-origin-conf:/opt/ovenmediaengine/Server.xml
--name ovenmediaengine
airensoft/ovenmediaengine:dev

@getroot
Copy link
Member

getroot commented Mar 16, 2021

@mpisat
OME doesn't care if it's ws or wss. That's just the browser's security policy. So it should work the old way too. Also, the ws[s] URL is just signaling, not sending the video directly to it.

The log message "No module could be found~" indicates that the request did not reach the WebRTC Provider. You need to make sure that WebRTC Porvider (the module receiving input is not Publisher) is turned on in the Bind settings.

If you want to use transport=tcp you need to forwarding port 3478/tcp as well. If not, remove transport=tcp from the url.

@getroot
Copy link
Member

getroot commented Mar 22, 2021

[2] The crash is also reproduced by me. Thank you. I'll solve this soon.

@getroot
Copy link
Member

getroot commented Mar 22, 2021

@saggiyogesh I solved the crash problem. All crashes were due to one cause. Once again thank you for your test. Now please check if your problem is solved.

@saggiyogesh
Copy link

@getroot Sorry for confusing you with the webrtc keywords. I'm a novice to all this.
Attached Server.xml

<?xml version="1.0" encoding="UTF-8"?>

<Server version="8">
        <Name>OvenMediaEngine</Name>
        <!-- Host type (origin/edge) -->
        <Type>origin</Type>
        <!-- Specify IP address to bind (* means all IPs) -->
        <IP>*</IP>

        <!-- 
        To get the public IP address(mapped address of stun) of the local server. 
        This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment. 
        If this is successful, you can use ${PublicIP} in your settings.
        -->
        <StunServer>stun.l.google.com:19302</StunServer>

        <!-- Settings for the ports to bind -->
        <Bind>
                <!-- Enable this configuration if you want to use API Server -->
                <!--
                <Managers>
                        <API>
                                <Port>48081</Port>
                                <WorkerCount>1</WorkerCount>
                        </API>
                </Managers>
                -->

                <Providers>
                        <RTMP>
                                <Port>1935</Port>
                                <!-- <WorkerCount>1</WorkerCount> -->
                        </RTMP>
                        <MPEGTS>
                                <!--
                                        Listen on port 4000~4005
                                        This is just a demonstration to show that you can configure the port in several ways
                                -->
                                <Port>4000-4004,4005/udp</Port>
                        </MPEGTS>
                        <WebRTC>
                                <Signalling>
                                        <Port>3333</Port>
                                        <!-- If you want to use TLS, specify the TLS port -->
                                        <!-- <TLSPort>3334</TLSPort> -->
                                        <!-- <WorkerCount>4</WorkerCount> -->
                                </Signalling>

                                <IceCandidates>
                                        <!-- 
                                                If you want to stream WebRTC over TCP, specify IP:Port for TURN server.
                                                This uses the TURN protocol, which delivers the stream from the built-in TURN server to the player's TURN client over TCP. 
                                                For detailed information, refer https://airensoft.gitbook.io/ovenmediaengine/v/0.11.1/streaming/webrtc-publishing#webrtc-over-tcp
                                        -->
                                        <TcpRelay>x.x.x.x:3478</TcpRelay>
                                        <IceCandidate>x.x.x.x:10000-10005/udp</IceCandidate>

                                        <!--
                                                Sets the number of worker threads to use in TcpRelay

                                                <TcpRelayWorkerCount>4</TcpRelayWorkerCount>
                                        -->
                                </IceCandidates>
                        </WebRTC>
                </Providers>

                <Publishers>
                        <OVT>
                                <Port>9000</Port>
                                <!-- <WorkerCount>1</WorkerCount> -->
                        </OVT>
                        <HLS>
                                <Port>80</Port>
                                <!-- If you want to use TLS, specify the TLS port -->
                                <!-- <TLSPort>443</TLSPort> -->
                                <!-- <WorkerCount>4</WorkerCount> -->
                        </HLS>
                        <DASH>
                                <Port>80</Port>
                                <!-- If you want to use TLS, specify the TLS port -->
                                <!-- <TLSPort>443</TLSPort> -->
                                <!-- <WorkerCount>4</WorkerCount> -->
                        </DASH>
                        <WebRTC>
                                <Signalling>
                                        <Port>3333</Port>
                                        <!-- If you want to use TLS, specify the TLS port -->
                                        <!-- <TLSPort>3334</TLSPort> -->
                                        <!-- <WorkerCount>4</WorkerCount> -->
                                </Signalling>

                                <IceCandidates>
                                        <!-- 
                                                If you want to stream WebRTC over TCP, specify IP:Port for TURN server.
                                                This uses the TURN protocol, which delivers the stream from the built-in TURN server to the player's TURN client over TCP. 
                                                For detailed information, refer https://airensoft.gitbook.io/ovenmediaengine/v/0.11.1/streaming/webrtc-publishing#webrtc-over-tcp
                                        -->
                                        <TcpRelay>x.x.x.x:3478</TcpRelay>
                                        <IceCandidate>x.x.x.x:10000-10005/udp</IceCandidate>

                                        <!--
                                                Sets the number of worker threads to use in TcpRelay

                                                <TcpRelayWorkerCount>4</TcpRelayWorkerCount>
                                        -->
                                </IceCandidates>
                        </WebRTC>
                </Publishers>
        </Bind>

        <!-- P2P works only in WebRTC -->
        <!--
        <P2P>
                <MaxClientPeersPerHostPeer>2</MaxClientPeersPerHostPeer>
        </P2P>
        -->

        <!--
                Enable this configuration if you want to use API Server

                <AccessToken> is a token for authentication, and when you invoke the API, you must put "Basic base64encode(<AccessToken>)" in the "Authorization" header of HTTP request.
                For example, if you set <AccessToken> to "ome-access-token", you must set "Basic b21lLWFjY2Vzcy10b2tlbg==" in the "Authorization" header.
        -->
        <!--
        <Managers>
                <Host>
                        <Names>
                                <Name>*</Name>
                        </Names>
                        <TLS>
                                <CertPath>path/to/file.crt</CertPath>
                                <KeyPath>path/to/file.key</KeyPath>
                                <ChainCertPath>path/to/file.crt</ChainCertPath>
                        </TLS>
                </Host>
                <API>
                        <AccessToken>ome-access-token</AccessToken>
                </API>
        </Managers>
        -->

        <VirtualHosts>
                <!-- You can use wildcard like this to include multiple XMLs -->
                <VirtualHost include="VHost*.xml" />
                <VirtualHost>
                        <Name>default</Name>

                        <!-- Settings for multi ip/domain and TLS -->
                        <Host>
                                <Names>
                                        <!-- Host names
                                                <Name>stream1.airensoft.com</Name>
                                                <Name>stream2.airensoft.com</Name>
                                                <Name>*.sub.airensoft.com</Name>
                                                <Name>192.168.0.1</Name>
                                        -->
                                        <Name>*</Name>
                                </Names>
                                <!--
                                <TLS>
                                        <CertPath>path/to/file.crt</CertPath>
                                        <KeyPath>path/to/file.key</KeyPath>
                                        <ChainCertPath>path/to/file.crt</ChainCertPath>
                                </TLS>
                                -->
                        </Host>

                        <!-- Refer https://airensoft.gitbook.io/ovenmediaengine/signedpolicy
                        <SignedPolicy>
                                <PolicyQueryKeyName>policy</PolicyQueryKeyName>
                                <SignatureQueryKeyName>signature</SignatureQueryKeyName>
                                <SecretKey>aKq#1kj</SecretKey>
                                <Enables>
                                        <Providers>rtmp</Providers>
                                        <Publishers>webrtc,hls,dash,lldash</Publishers>
                                </Enables>
                        </SignedPolicy>
                        -->

                        <!--
                        <Origins>

                                <Origin>
                                        <Location>/app/stream</Location>
                                        <Pass>
                                                <Scheme>ovt</Scheme>
                                                <Urls><Url>origin.com:9000/app/stream_720p</Url></Urls>
                                        </Pass>
                                </Origin>
                                <Origin>
                                        <Location>/app/</Location>
                                        <Pass>
                                                <Scheme>ovt</Scheme>
                                                <Urls><Url>origin.com:9000/app/</Url></Urls>
                                        </Pass>
                                </Origin>
                                <Origin>
                                        <Location>/edge/</Location>
                                        <Pass>
                                                <Scheme>ovt</Scheme>
                                                <Urls><Url>origin.com:9000/app/</Url></Urls>
                                        </Pass>
                                </Origin>
                        </Origins>
                        -->
                        <!-- Settings for applications -->
                        <Applications>
                                <Application>
                                        <Name>app</Name>
                                        <!-- Application type (live/vod) -->
                                        <Type>live</Type>
                                        <OutputProfiles>
                                                <OutputProfile>
                                                        <Name>bypass_stream</Name>
                                                        <OutputStreamName>${OriginStreamName}</OutputStreamName>
                                                        <Encodes>
                                                                <Audio>
                                                                        <Bypass>true</Bypass>
                                                                </Audio>
                                                                <Video>
                                                                        <Bypass>true</Bypass>
                                                                </Video>
                                                                <!-- <Audio>
                                                                        <Codec>opus</Codec>
                                                                        <Bitrate>128000</Bitrate>
                                                                        <Samplerate>48000</Samplerate>
                                                                        <Channel>2</Channel>
                                                                </Audio>

                                                                <Video>
                                                                        <Codec>vp8</Codec>
                                                                        <Bitrate>1024000</Bitrate>
                                                                        <Framerate>30</Framerate>
                                                                        <Width>1280</Width>
                                                                        <Height>720</Height>
                                                                </Video>                                                    -->

                                                        </Encodes>
                                                </OutputProfile>
                                        </OutputProfiles>
                                        <Providers>
                                                <OVT />
                                                <RTMP />
                                                <MPEGTS>
                                                        <StreamMap>
                                                                <!--
                                                                        Set the stream name of the client connected to the port to "stream_${Port}"
                                                                        For example, if a client connets to port 4000, OME creates a "stream_4000" stream
                                                                -->
                                                                <Stream>
                                                                        <Name>stream_${Port}</Name>
                                                                        <Port>4000,4001-4004</Port>
                                                                </Stream>
                                                                <Stream>
                                                                        <Name>stream_4005</Name>
                                                                        <Port>4005</Port>
                                                                </Stream>
                                                        </StreamMap>
                                                </MPEGTS>
                                                <RTSPPull />
                                                <WebRTC>
                                                        <Timeout>30000</Timeout>
                                                </WebRTC>
                                        </Providers>
                                        <Publishers>
                                                <SessionLoadBalancingThreadCount>8</SessionLoadBalancingThreadCount>
                                                <OVT />
                                                <WebRTC>
                                                        <Timeout>30000</Timeout>
                                                        <Rtx>true</Rtx>
                                                        <Ulpfec>true</Ulpfec>
                                                </WebRTC>
                                                <HLS>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <SegmentCount>3</SegmentCount>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </HLS>
                                                <DASH>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <SegmentCount>3</SegmentCount>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </DASH>
                                                <LLDASH>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </LLDASH>
                                        </Publishers>
                                </Application>
                        </Applications>
                </VirtualHost>
        </VirtualHosts>
</Server>

BTW, did you checked Case 3
#29 (comment)

@saggiyogesh
Copy link

saggiyogesh commented Mar 22, 2021

@getroot

@saggiyogesh I solved the crash problem. All crashes were due to one cause. Once again thank you for your test. Now please check if your problem is solved.

The crash issue is fixed now.
But WebRTC Publisher (http://demo.ovenplayer.com) is not able to connect. Pls, check the screenshot below.
image

OME logs

[2021-03-22 08:01:00.663] E [SckPoolRtcSigna:13] Orchestrator | orchestrator.cpp:478  | Could not find Origin for the stream: [#default#app/test]

[2021-03-22 08:01:00.663] E [SckPoolRtcSigna:13] WebRTC Publisher | webrtc_publisher.cpp:382  | Cannot find stream (#default#app/test)

[2021-03-22 08:01:00.663] E [SckPoolRtcSigna:13] Signalling | rtc_signalling_server.cpp:275  | Cannot find stream [#default#app/test]

[2021-03-22 08:01:00.664] I [SckPoolRtcSigna:13] Socket.Server | server_socket.cpp:129  | [#9] [0x56393956f630] Client(<ClientSocket: 0x7f4cd0017d70, #77, state: Closed, TCP, 103.41.25.174:46081>) is disconnected

Server.xml

<?xml version="1.0" encoding="UTF-8"?>

<Server version="8">
        <Name>OvenMediaEngine</Name>
        <!-- Host type (origin/edge) -->
        <Type>origin</Type>
        <!-- Specify IP address to bind (* means all IPs) -->
        <IP>*</IP>

        <!-- 
        To get the public IP address(mapped address of stun) of the local server. 
        This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment. 
        If this is successful, you can use ${PublicIP} in your settings.
        -->
        <StunServer>stun.l.google.com:19302</StunServer>

        <!-- Settings for the ports to bind -->
        <Bind>
                <!-- Enable this configuration if you want to use API Server -->
                <!--
                <Managers>
                        <API>
                                <Port>48081</Port>
                                <WorkerCount>1</WorkerCount>
                        </API>
                </Managers>
                -->

                <Providers>
                        <RTMP>
                                <Port>1935</Port>
                                <!-- <WorkerCount>1</WorkerCount> -->
                        </RTMP>
                        <MPEGTS>
                                <!--
                                        Listen on port 4000~4005
                                        This is just a demonstration to show that you can configure the port in several ways
                                -->
                                <Port>4000-4004,4005/udp</Port>
                        </MPEGTS>
                        <WebRTC>
                                <Signalling>
                                        <Port>3333</Port>
                                        <!-- If you want to use TLS, specify the TLS port -->
                                        <!-- <TLSPort>3334</TLSPort> -->
                                        <!-- <WorkerCount>4</WorkerCount> -->
                                </Signalling>

                                <IceCandidates>
                                        <!-- 
                                                If you want to stream WebRTC over TCP, specify IP:Port for TURN server.
                                                This uses the TURN protocol, which delivers the stream from the built-in TURN server to the player's TURN client over TCP. 
                                                For detailed information, refer https://airensoft.gitbook.io/ovenmediaengine/v/0.11.1/streaming/webrtc-publishing#webrtc-over-tcp
                                        -->
                                        <TcpRelay>x.x.x.x:3478</TcpRelay>
                                        <IceCandidate>x.x.x.x:10000-10005/udp</IceCandidate>

                                        <!--
                                                Sets the number of worker threads to use in TcpRelay

                                                <TcpRelayWorkerCount>4</TcpRelayWorkerCount>
                                        -->
                                </IceCandidates>
                        </WebRTC>
                </Providers>

                <Publishers>
                        <OVT>
                                <Port>9000</Port>
                                <!-- <WorkerCount>1</WorkerCount> -->
                        </OVT>
                        <HLS>
                                <Port>80</Port>
                                <!-- If you want to use TLS, specify the TLS port -->
                                <!-- <TLSPort>443</TLSPort> -->
                                <!-- <WorkerCount>4</WorkerCount> -->
                        </HLS>
                        <DASH>
                                <Port>80</Port>
                                <!-- If you want to use TLS, specify the TLS port -->
                                <!-- <TLSPort>443</TLSPort> -->
                                <!-- <WorkerCount>4</WorkerCount> -->
                        </DASH>
                        <WebRTC>
                                <Signalling>
                                        <Port>3333</Port>
                                        <!-- If you want to use TLS, specify the TLS port -->
                                        <!-- <TLSPort>3334</TLSPort> -->
                                        <!-- <WorkerCount>4</WorkerCount> -->
                                </Signalling>

                                <IceCandidates>
                                        <!-- 
                                                If you want to stream WebRTC over TCP, specify IP:Port for TURN server.
                                                This uses the TURN protocol, which delivers the stream from the built-in TURN server to the player's TURN client over TCP. 
                                                For detailed information, refer https://airensoft.gitbook.io/ovenmediaengine/v/0.11.1/streaming/webrtc-publishing#webrtc-over-tcp
                                        -->
                                        <TcpRelay>x.x.x.x:3478</TcpRelay>
                                        <IceCandidate>x.x.x.x:10000-10005/udp</IceCandidate>

                                        <!--
                                                Sets the number of worker threads to use in TcpRelay

                                                <TcpRelayWorkerCount>4</TcpRelayWorkerCount>
                                        -->
                                </IceCandidates>
                        </WebRTC>
                </Publishers>
        </Bind>

        <!-- P2P works only in WebRTC -->
        <!--
        <P2P>
                <MaxClientPeersPerHostPeer>2</MaxClientPeersPerHostPeer>
        </P2P>
        -->

        <!--
                Enable this configuration if you want to use API Server

                <AccessToken> is a token for authentication, and when you invoke the API, you must put "Basic base64encode(<AccessToken>)" in the "Authorization" header of HTTP request.
                For example, if you set <AccessToken> to "ome-access-token", you must set "Basic b21lLWFjY2Vzcy10b2tlbg==" in the "Authorization" header.
        -->
        <!--
        <Managers>
                <Host>
                        <Names>
                                <Name>*</Name>
                        </Names>
                        <TLS>
                                <CertPath>path/to/file.crt</CertPath>
                                <KeyPath>path/to/file.key</KeyPath>
                                <ChainCertPath>path/to/file.crt</ChainCertPath>
                        </TLS>
                </Host>
                <API>
                        <AccessToken>ome-access-token</AccessToken>
                </API>
        </Managers>
        -->

        <VirtualHosts>
                <!-- You can use wildcard like this to include multiple XMLs -->
                <VirtualHost include="VHost*.xml" />
                <VirtualHost>
                        <Name>default</Name>

                        <!-- Settings for multi ip/domain and TLS -->
                        <Host>
                                <Names>
                                        <!-- Host names
                                                <Name>stream1.airensoft.com</Name>
                                                <Name>stream2.airensoft.com</Name>
                                                <Name>*.sub.airensoft.com</Name>
                                                <Name>192.168.0.1</Name>
                                        -->
                                        <Name>*</Name>
                                </Names>
                                <!--
                                <TLS>
                                        <CertPath>path/to/file.crt</CertPath>
                                        <KeyPath>path/to/file.key</KeyPath>
                                        <ChainCertPath>path/to/file.crt</ChainCertPath>
                                </TLS>
                                -->
                        </Host>

                        <!-- Refer https://airensoft.gitbook.io/ovenmediaengine/signedpolicy
                        <SignedPolicy>
                                <PolicyQueryKeyName>policy</PolicyQueryKeyName>
                                <SignatureQueryKeyName>signature</SignatureQueryKeyName>
                                <SecretKey>aKq#1kj</SecretKey>
                                <Enables>
                                        <Providers>rtmp</Providers>
                                        <Publishers>webrtc,hls,dash,lldash</Publishers>
                                </Enables>
                        </SignedPolicy>
                        -->

                        <!--
                        <Origins>

                                <Origin>
                                        <Location>/app/stream</Location>
                                        <Pass>
                                                <Scheme>ovt</Scheme>
                                                <Urls><Url>origin.com:9000/app/stream_720p</Url></Urls>
                                        </Pass>
                                </Origin>
                                <Origin>
                                        <Location>/app/</Location>
                                        <Pass>
                                                <Scheme>ovt</Scheme>
                                                <Urls><Url>origin.com:9000/app/</Url></Urls>
                                        </Pass>
                                </Origin>
                                <Origin>
                                        <Location>/edge/</Location>
                                        <Pass>
                                                <Scheme>ovt</Scheme>
                                                <Urls><Url>origin.com:9000/app/</Url></Urls>
                                        </Pass>
                                </Origin>
                        </Origins>
                        -->
                        <!-- Settings for applications -->
                        <Applications>
                                <Application>
                                        <Name>app</Name>
                                        <!-- Application type (live/vod) -->
                                        <Type>live</Type>
                                        <OutputProfiles>
                                                <OutputProfile>
                                                        <Name>bypass_stream</Name>
                                                        <OutputStreamName>${OriginStreamName}</OutputStreamName>
                                                        <Encodes>
                                                                <Audio>
                                                                        <Bypass>true</Bypass>
                                                                </Audio>
                                                                <Video>
                                                                        <Bypass>true</Bypass>
                                                                </Video>
                                                                <!-- <Audio>
                                                                        <Codec>opus</Codec>
                                                                        <Bitrate>128000</Bitrate>
                                                                        <Samplerate>48000</Samplerate>
                                                                        <Channel>2</Channel>
                                                                </Audio>

                                                                <Video>
                                                                        <Codec>vp8</Codec>
                                                                        <Bitrate>1024000</Bitrate>
                                                                        <Framerate>30</Framerate>
                                                                        <Width>1280</Width>
                                                                        <Height>720</Height>
                                                                </Video>                                                    -->

                                                        </Encodes>
                                                </OutputProfile>
                                        </OutputProfiles>
                                        <Providers>
                                                <OVT />
                                                <RTMP />
                                                <MPEGTS>
                                                        <StreamMap>
                                                                <!--
                                                                        Set the stream name of the client connected to the port to "stream_${Port}"
                                                                        For example, if a client connets to port 4000, OME creates a "stream_4000" stream
                                                                -->
                                                                <Stream>
                                                                        <Name>stream_${Port}</Name>
                                                                        <Port>4000,4001-4004</Port>
                                                                </Stream>
                                                                <Stream>
                                                                        <Name>stream_4005</Name>
                                                                        <Port>4005</Port>
                                                                </Stream>
                                                        </StreamMap>
                                                </MPEGTS>
                                                <RTSPPull />
                                                <WebRTC>
                                                        <Timeout>30000</Timeout>
                                                </WebRTC>
                                        </Providers>
                                        <Publishers>
                                                <SessionLoadBalancingThreadCount>8</SessionLoadBalancingThreadCount>
                                                <OVT />
                                                <WebRTC>
                                                        <Timeout>30000</Timeout>
                                                        <Rtx>true</Rtx>
                                                        <Ulpfec>true</Ulpfec>
                                                </WebRTC>
                                                <HLS>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <SegmentCount>3</SegmentCount>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </HLS>
                                                <DASH>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <SegmentCount>3</SegmentCount>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </DASH>
                                                <LLDASH>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </LLDASH>
                                        </Publishers>
                                </Application>
                        </Applications>
                </VirtualHost>
        </VirtualHosts>
</Server>

@getroot
Copy link
Member

getroot commented Mar 22, 2021

@saggiyogesh

[2021-03-22 08:01:00.663] E [SckPoolRtcSigna:13] WebRTC Publisher | webrtc_publisher.cpp:382 | Cannot find stream (#default#app/test)

It means there is no test stream in app application. Did you create an app/test stream? (webrtc input or rtmp input) When writing an issue, uploading the entire ovenmediaengine.log file will help me analyze it. Otherwise, I have no choice but to predict.

@saggiyogesh
Copy link

@saggiyogesh

[2021-03-22 08:01:00.663] E [SckPoolRtcSigna:13] WebRTC Publisher | webrtc_publisher.cpp:382 | Cannot find stream (#default#app/test)

It means there is no test stream in app application. Did you create an app/test stream? (webrtc input or rtmp input)

Earlier test stream was started from WebRTC Provider: (demo.ovenplayer.com/demo_input.html)

Now attached logs with stream stream12.
ome.log

@getroot
Copy link
Member

getroot commented Mar 22, 2021

@saggiyogesh

[2021-03-22 08:19:44.950] I [DelayQueue:15] WebRTC Provider | webrtc_provider.cpp:348 | IcePort is disconnected. : (#default#app/stream12) reason(5)
[2021-03-22 08:19:44.950] W [DelayQueue:15] Ice | ice_port.cpp:369 | Client [?]:0(session id: 101) has expired

This means that data is not being transmitted through the data channel (3478 for TCP, 10005-10010 for UDP). The stream was deleted because there is no stream coming into the data channel, and the stream could not be found by trying to play it after it was deleted.

If you are sending over tcp, check if you can communicate with the player on port 3478/tcp. Did you forward port 3478 when running the docker command?

And upload the whole ovenmediaengine.log without editing. (If you need to delete IP address, please delete only that part.) Otherwise, it will be difficult for me to analyze the issue. (I have to predict everything else.)

@getroot
Copy link
Member

getroot commented Mar 22, 2021

@saggiyogesh
The same can happen if you comment out the TcpRelay (without opening the port) and try to send with transport=tcp. This is not a bug. Data cannot be transmitted because the TCP port is not open. If you close TcpRelay you should not use transport=tcp.

@saggiyogesh
Copy link

@getroot
Please check logs & screenshots.

WebRTC Input (demo.ovenplayer.com/demo_input.html)
image

ovenmediaengine.log

What I observed is that WebRTC Input get disconnected after few minutes.

@getroot
Copy link
Member

getroot commented Mar 23, 2021

@saggiyogesh

Your log shows that the player could not send data to the server's 10000/udp port. So after 30 seconds timeout, the stream was automatically deleted.

What command did you use when running Docker? Is the firewall open?

@saggiyogesh
Copy link

@getroot finally its working. :)
WebRTC input is quite amazing, its near realtime much better than RTMP input. You guys rock..

However in player, stream video gets freeze and pixelated. I think that's due to higher input resolution / size.

Thanks..

@getroot
Copy link
Member

getroot commented Mar 24, 2021

@saggiyogesh
That's great! What was the solution that finally solved your problem? Please share for all of us.

@saggiyogesh
Copy link

@getroot Just added WebRTC configurations in Bind & Application Provider.

@saggiyogesh
Copy link

saggiyogesh commented Mar 24, 2021

@getroot wanted to check if the WebRTC Provider is in the Beta or development phase? I'm planning to use this in production.

@getroot
Copy link
Member

getroot commented Mar 24, 2021

@saggiyogesh SignedPolicy is not applied, but most of the basic functionality is complete. But we want to do more tests. Therefore, the current state can be seen as close to Beta.

@saggiyogesh
Copy link

Cool Thanks for the update.
I'll try on my prod instance. Need to know whether OME will work behind nginx as it requires a couple of ports to be opened.
Nginx (as Kubernetes ingress) is handling SSL termination and WAF in my case.

@ievgeniilarin
Copy link

I've just tried it with an EC2 instance and it is mind-blowing!

webrtc

@alexthedamager
Copy link

@getroot WHIP is already possible with Janus and Medooze - I think it would be incredible if OvenMediaEngine would also support it and would help WHIP gain momentum. I know you said that you wanted to wait until the protocol is extended a bit more, but is there any chance we'll see WHIP support in OME any time soon? I would love to contribute or help bring WHIP support to OME, but I'm not quite sure where to begin...

@pateckii
Copy link

pateckii commented Apr 25, 2021

Is it possible to add option to capture display and audio source as well on your demo webrtc website? I am using Voicemeeter so I can change an audio output of any app to a separate device. I would like to stream display or a window and then choose different audio device, but whenever I choose display capture the audio selector is hidden. I tried to modify javascript code on my computer but I am noob at js and I can't get it to work.

@getroot
Copy link
Member

getroot commented Apr 26, 2021

@llspalex OME creates OfferSDP on the Server, but WHIP differs in that the client creates OfferSDP. This means that it requires quite a bit of development. WHIP is registered in my backlog. However, there are still a lot of tasks with higher priority than that. :-)

@alexthedamager
Copy link

@getroot Thank you for the info - good to know! 😁

@getroot
Copy link
Member

getroot commented Apr 26, 2021

@pateckii The DEMO site for WebRTC transmission is still under development. We'll check out the features you suggested. @SangwonOh

@pateckii
Copy link

I red that its possible to do with addTrack function to combine both display capture and audio source.

@mpisat
Copy link

mpisat commented Apr 29, 2021

I managed to get it working. I've used :dev version
then I edited config file inside docker container

$ docker exec -it containerid /bin/bash
$ cd origin_conf

$ cat > Server.xml

This is the modified Server.xml I've used

<?xml version="1.0" encoding="UTF-8" ?>

<Server version="8">
        <Name>OvenMediaEngine</Name>
        <!-- Host type (origin/edge) -->
        <Type>origin</Type>
        <!-- Specify IP address to bind (* means all IPs) -->
        <IP>*</IP>

        <!--
        To get the public IP address(mapped address of stun) of the local server.
        This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment.
        If this is successful, you can use ${PublicIP} in your settings.
        -->
        <StunServer>stun.l.google.com:19302</StunServer>

        <!-- Settings for the ports to bind -->
        <Bind>
                <Providers>
                        <RTMP>
                                <Port>${env:OME_RTMP_PROV_PORT:1935}</Port>
                        </RTMP>
                        <MPEGTS>
                                <!--
                                        Listen on port 4000,4001,4004,4005
                                        This is just a demonstration to show that you can configure the port in several ways
                                -->
                                <Port>${env:OME_MPEGTS_PROV_PORT:4000-4003,4004,4005/udp}</Port>
                        </MPEGTS>
                        <WebRTC>
                                <Signalling>
                                        <Port>${env:OME_SIGNALLING_PORT:3333}</Port>
                                        <!-- If you want to use TLS, specify the TLS port -->
                                        <!-- <TLSPort>3334</TLSPort> -->
                                </Signalling>
                                <IceCandidates>
                                        <!--
                                                If you want to stream WebRTC over TCP, specify IP:Port for TURN server.
                                                This uses the TURN protocol, which delivers the stream from the built-in TURN server to the player's TURN client over TCP.
                                                For detailed information, refer https://airensoft.gitbook.io/ovenmediaengine/v/0.11.1/streaming/webrtc-publishing#webrtc-over-tcp
                                        -->
                                        <TcpRelay>${env:OME_TCP_RELAY_ADDRESS:*:3478}</TcpRelay>
                                        <IceCandidate>${env:OME_ICE_CANDIDATES:*:10006-10010/udp}</IceCandidate>
                                </IceCandidates>
                        </WebRTC>
                </Providers>

                <Publishers>
                        <!-- The OVT is protocol for ORIGIN-EDGE -->
                        <OVT>
                                <Port>${env:OME_ORIGIN_PORT:9000}</Port>
                        </OVT>
                        <HLS>
                                <Port>${env:OME_HLS_STREAM_PORT:8080}</Port>
                                <!-- If you want to use TLS, specify the TLS port -->
                                <!-- <TLSPort>443</TLSPort> -->
                        </HLS>
                        <DASH>
                                <Port>${env:OME_DASH_STREAM_PORT:8080}</Port>
                                <!-- If you want to use TLS, specify the TLS port -->
                                <!-- <TLSPort>443</TLSPort> -->
                        </DASH>
                        <WebRTC>
                                <Signalling>
                                        <Port>${env:OME_SIGNALLING_PORT:3333}</Port>
                                        <!-- If you want to use TLS, specify the TLS port -->
                                        <!-- <TLSPort>3334</TLSPort> -->
                                </Signalling>
                                <IceCandidates>
                                        <!--
                                                If you want to stream WebRTC over TCP, specify IP:Port for TURN server.
                                                This uses the TURN protocol, which delivers the stream from the built-in TURN server to the player's TURN client over TCP.
                                                For detailed information, refer https://airensoft.gitbook.io/ovenmediaengine/v/0.11.1/streaming/webrtc-publishing#webrtc-over-tcp
                                        -->
                                        <TcpRelay>${env:OME_TCP_RELAY_ADDRESS:*:3478}</TcpRelay>
                                        <IceCandidate>${env:OME_ICE_CANDIDATES:*:10006-10010/udp}</IceCandidate>
                                </IceCandidates>
                        </WebRTC>
                </Publishers>
        </Bind>

        <VirtualHosts>
                <!--
                        You can include multiple XML files by doing the following:
                        <VirtualHost include="sites-enabled/*.xml" />
                -->
                <VirtualHost include="VHost*.xml" />
                <VirtualHost>
                        <Name>default</Name>

                        <!-- Settings for multi ip/domain and TLS -->
                        <Host>
                                <Names>
                                        <!-- Host names
                                                <Name>stream1.airensoft.com</Name>
                                                <Name>stream2.airensoft.com</Name>
                                                <Name>*.sub.airensoft.com</Name>
                                                <Name>192.168.0.1</Name>
                                        -->
                                        <Name>*</Name>
                                </Names>
                                <!--
                                <TLS>
                                        <CertPath>path/to/file.crt</CertPath>
                                        <KeyPath>path/to/file.key</KeyPath>
                                        <ChainCertPath>path/to/file.crt</ChainCertPath>
                                </TLS>
                                -->
                        </Host>

                        <!-- Settings for applications -->
                        <Applications>
                                <Application>
                                        <Name>app</Name>
                                        <!-- Application type (live/vod) -->
                                        <Type>live</Type>
                                        <OutputProfiles>
                                                <OutputProfile>
                                                        <Name>bypass_stream</Name>
                                                        <OutputStreamName>${OriginStreamName}</OutputStreamName>
                                                        <Encodes>
                                                                <Audio>
                                                                        <Bypass>true</Bypass>
                                                                </Audio>
                                                                <Video>
                                                                        <Bypass>true</Bypass>
                                                                </Video>
                                                                <Audio>
                                                                        <Codec>opus</Codec>
                                                                        <Bitrate>128000</Bitrate>
                                                                        <Samplerate>48000</Samplerate>
                                                                        <Channel>2</Channel>
                                                                </Audio>
                                                        </Encodes>
                                                </OutputProfile>
                                        </OutputProfiles>
                                        <Providers>
                                                <OVT />
                                                <RTMP />
                                                <RTSPPull />
                                                <MPEGTS>
                                                        <StreamMap>
                                                                <!--
                                                                        Set the stream name of the client connected to the port to "stream_${Port}"
                                                                        For example, if a client connets to port 4000, OME creates a "stream_4000" stream
                                                                -->
                                                                <Stream>
                                                                        <Name>stream_${Port}</Name>
                                                                        <Port>4000,4001-4004</Port>
                                                                </Stream>
                                                                <Stream>
                                                                        <Name>stream_4005</Name>
                                                                        <Port>4005</Port>
                                                                </Stream>
                                                        </StreamMap>
                                                </MPEGTS>
						<WebRTC>
							<Timeout>30000</Timeout>
						</WebRTC>
                                        </Providers>
                                        <Publishers>
                                                <SessionLoadBalancingThreadCount>8</SessionLoadBalancingThreadCount>
                                                <OVT />
						<WebRTC>
							<Timeout>30000</Timeout>
							<Rtx>true</Rtx>
							<Ulpfec>true</Ulpfec>
						</WebRTC>
                                                <HLS>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <SegmentCount>3</SegmentCount>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </HLS>
                                                <DASH>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <SegmentCount>3</SegmentCount>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </DASH>
                                                <LLDASH>
                                                        <SegmentDuration>5</SegmentDuration>
                                                        <CrossDomains>
                                                                <Url>*</Url>
                                                        </CrossDomains>
                                                </LLDASH>
                                        </Publishers>
                                </Application>
                        </Applications>
                </VirtualHost>
        </VirtualHosts>
</Server>
# CTRL + D

$ exit

$ docker restart containerID #this is important.

@getroot
Copy link
Member

getroot commented Apr 30, 2021

Today I applied this feature to the default configuration. If you find another issue, please open a new issue.
Thank you for all of your contributions.

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

9 participants