Skip to content

Instantly share code, notes, and snippets.

@Aidan63
Created March 3, 2024 21:36
Show Gist options
  • Save Aidan63/af79a3983a14212b6343d09c2c6f848f to your computer and use it in GitHub Desktop.
Save Aidan63/af79a3983a14212b6343d09c2c6f848f to your computer and use it in GitHub Desktop.
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 IPv4 IPs, "::" means all IPv6 IPs) -->
<!-- Uncomment the line below to enable IPv6 -->
<!-- <IP>::</IP> -->
<IP>*</IP>
<PrivacyProtection>false</PrivacyProtection>
<!--
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.ovenmediaengine.com:13478</StunServer>
<Modules>
<!--
Currently OME only supports h2 like all browsers do. Therefore, HTTP/2 only works on TLS ports.
-->
<HTTP2>
<Enable>true</Enable>
</HTTP2>
<LLHLS>
<Enable>true</Enable>
</LLHLS>
<!-- P2P works only in WebRTC and is experiment feature -->
<P2P>
<!-- disabled by default -->
<Enable>false</Enable>
<MaxClientPeersPerHostPeer>2</MaxClientPeersPerHostPeer>
</P2P>
</Modules>
<!-- Settings for the ports to bind -->
<Bind>
<!-- Enable this configuration if you want to use API Server -->
<!--
<Managers>
<API>
<Port>8081</Port>
<TLSPort>8082</TLSPort>
<WorkerCount>1</WorkerCount>
</API>
</Managers>
-->
<Providers>
<RTMP>
<Port>1935</Port>
<WorkerCount>1</WorkerCount>
</RTMP>
<WebRTC>
<Signalling>
<Port>3333</Port>
<TLSPort>3334</TLSPort>
<WorkerCount>1</WorkerCount>
</Signalling>
<IceCandidates>
<!-- Uncomment the line below to use IPv6 ICE Candidate -->
<!-- <IceCandidate>[::]:10000-10004/udp</IceCandidate> -->
<IceCandidate>192.168.1.144:10000-10004/udp</IceCandidate>
<!-- Uncomment the line below to use a link local address when specifying an address with IPv6 wildcard (::) -->
<!-- <EnableLinkLocalAddress>true</EnableLinkLocalAddress> -->
<!--
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.
-->
<TcpRelay>*:3478</TcpRelay>
<!-- TcpForce is an option to force the use of TCP rather than UDP in WebRTC streaming. (You can omit ?transport=tcp accordingly.) If <TcpRelay> is not set, playback may fail. -->
<TcpForce>true</TcpForce>
<TcpRelayWorkerCount>1</TcpRelayWorkerCount>
</IceCandidates>
</WebRTC>
</Providers>
<Publishers>
<WebRTC>
<Signalling>
<Port>3333</Port>
<TLSPort>3334</TLSPort>
<WorkerCount>1</WorkerCount>
</Signalling>
<IceCandidates>
<!-- Uncomment the line below to use IPv6 ICE Candidate -->
<!-- <IceCandidate>[::]:10000-10004/udp</IceCandidate> -->
<IceCandidate>192.168.1.144:10000-10004/udp</IceCandidate>
<!-- Uncomment the line below to use a link local address when specifying an address with IPv6 wildcard (::) -->
<!-- <EnableLinkLocalAddress>true</EnableLinkLocalAddress> -->
<!--
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.
-->
<TcpRelay>*:3478</TcpRelay>
<!-- TcpForce is an option to force the use of TCP rather than UDP in WebRTC streaming. (You can omit ?transport=tcp accordingly.) If <TcpRelay> is not set, playback may fail. -->
<TcpForce>true</TcpForce>
<TcpRelayWorkerCount>1</TcpRelayWorkerCount>
</IceCandidates>
</WebRTC>
</Publishers>
</Bind>
<!--
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>
<CrossDomains>
<Url>*.airensoft.com</Url>
<Url>http://*.sub-domain.airensoft.com</Url>
<Url>http?://airensoft.*</Url>
</CrossDomains>
</API>
</Managers>
-->
<!--
Refer https://airensoft.gitbook.io/ovenmediaengine/alert
<Alert>
<Url></Url>
<SecretKey></SecretKey>
<Timeout>3000</Timeout>
<Rules>
<Ingress>
<MinBitrate></MinBitrate>
<MaxBitrate></MaxBitrate>
<MinFramerate></MinFramerate>
<MaxFramerate></MaxFramerate>
<MinWidth></MinWidth>
<MinHeight></MinHeight>
<MaxWidth></MaxWidth>
<MaxHeight></MaxHeight>
<MinSamplerate></MinSamplerate>
<MaxSamplerate></MaxSamplerate>
<LongKeyFrameInterval />
<HasBFrames />
</Ingress>
</Rules>
</Alert>
-->
<VirtualHosts>
<!-- You can use wildcard like this to include multiple XMLs -->
<VirtualHost include="VHost*.xml" />
<VirtualHost>
<Name>default</Name>
<!--Distribution is a value that can be used when grouping the same vhost distributed across multiple servers. This value is output to the events log, so you can use it to aggregate statistics. -->
<Distribution>ovenmediaengine.com</Distribution>
<!-- Settings for multi ip/domain and TLS -->
<Host>
<Names>
<!--
<Name>stream1.airensoft.com</Name>
<Name>stream2.airensoft.com</Name>
<Name>*.sub.airensoft.com</Name>
<Name>192.168.0.144</Name>
-->
<Name>*</Name>
<Name>192.168.1.101</Name>
<Name>*.ovenplayer.com</Name>
</Names>
<TLS>
<CertPath>/opt/ovenmediaengine/bin/origin_conf/server.crt</CertPath>
<KeyPath>/opt/ovenmediaengine/bin/origin_conf/server.key</KeyPath>
<ChainCertPath>/opt/ovenmediaengine/bin/origin_conf/server.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,webrtc,srt</Providers>
<Publishers>webrtc,hls,llhls,dash,lldash</Publishers>
</Enables>
</SignedPolicy>
-->
<!--
<AdmissionWebhooks>
<ControlServerUrl></ControlServerUrl>
<SecretKey></SecretKey>
<Timeout>3000</Timeout>
<Enables>
<Providers>rtmp,webrtc,srt</Providers>
<Publishers>webrtc,hls,llhls,dash,lldash</Publishers>
</Enables>
</AdmissionWebhooks>
-->
<!-- <Origins>
<Properties>
<NoInputFailoverTimeout>3000</NoInputFailoverTimeout>
<UnusedStreamDeletionTimeout>60000</UnusedStreamDeletionTimeout>
</Properties>
<Origin>
<Location>/app/stream</Location>
<Pass>
<Scheme>ovt</Scheme>
<Urls><Url>origin.com:9000/app/stream_720p</Url></Urls>
</Pass>
<ForwardQueryParams>false</ForwardQueryParams>
</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> -->
<!--
<OriginMapStore>
In order to use OriginMap, you must enable OVT Publisher in Origin and OVT Provider in Edge.
<RedisServer>
<Host>192.168.0.160:6379</Host>
<Auth>!@#ovenmediaengine</Auth>
</RedisServer>
This is only needed for the origin server and used to register the ovt address of the stream.
<OriginHostName>ome-dev.airensoft.com</OriginHostName>
</OriginMapStore>
-->
<!-- Default CORS Settings -->
<CrossDomains>
<Url>*</Url>
</CrossDomains>
<!-- 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>
<!--
<Video>
<Name>bypass</Name>
<Bypass>true</Bypass>
</Video>
-->
<Video>
<Name>test</Name>
<Codec>h264</Codec>
<Bitrate>20000000</Bitrate>
<Width>1280</Width>
</Video>
</Encodes>
<!--
You can provide ABR with Playlist. Currently, ABR is supported in LLHLS and WebRTC.
You can play this playlist with
LLHLS : http[s]://<domain>[:port]/<app>/<stream>/<FileName>.m3u8
WebRTC : ws[s]://<domain>[:port]/<app>/<stream>/<FileName>
Note that the keywords "playlist" and "chunklist" MUST NOT be included in FileName.
-->
</OutputProfile>
</OutputProfiles>
<Providers>
<RTMP />
<WebRTC>
<Timeout>30000</Timeout>
<CrossDomains>
<Url>*</Url>
</CrossDomains>
</WebRTC>
<Schedule>
<MediaRootDir>/opt/ovenmediaengine/media</MediaRootDir>
<ScheduleFilesDir>/opt/ovenmediaengine/media</ScheduleFilesDir>
</Schedule>
</Providers>
<Publishers>
<AppWorkerCount>1</AppWorkerCount>
<StreamWorkerCount>8</StreamWorkerCount>
<WebRTC>
<Timeout>30000</Timeout>
<Rtx>false</Rtx>
<Ulpfec>false</Ulpfec>
<JitterBuffer>false</JitterBuffer>
</WebRTC>
</Publishers>
</Application>
</Applications>
</VirtualHost>
</VirtualHosts>
</Server>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment