-
Notifications
You must be signed in to change notification settings - Fork 639
Frequently Asked Questions
- Please use an Elastic IP address.
- Add A record in your Elastic IP address.
- After that please check DNS records in here -> https://dnschecker.org/
- If everything is fine, follow the SSL Setup Tutorial
JavaScript SDK is available in the Ant Media Server. It can be accessed via http://SERVER_ADDR:5080/LiveApp/js/webrtc_adaptor.js
. Its file location is /usr/local/antmedia/webapps/LiveApp/js/webrtc_adaptor.js
. Its source code is also available in here
YES. Utilizing Docker images is a very common way of deploying Ant Media Server. Check the Installation
We are storing passwords with MD5 encryption in the versions 2.2+. You need to change your passwords to MD5 encryption. You can encrypt your password basically any MD5 encrypter page like: https://www.md5online.org/md5-encrypt.html
Here are the steps:
- Login MongoDB
- Run below commands:
use serverdb
db.getCollection('User').find() //Get User details
db.User.updateOne({"_id": "5e978ef3c9e77c0001228040"}, {$set:{password: "md5Password"}}) //Use User ID in updateOne section and use password with MD5 protection
- Stop the server
service antmedia stop
. - Delete the
server.db
file under/usr/local/antmedia/
- Start the server
service antmedia start
If you're using mongodb
as database, your password will be in serverdb
database and in User
collection.
- Connect to your
mongodb
server withmongo
client. - Type
use serverdb;
- Type
db.User.find()
and it shows you the output like below.{ "_id" : ObjectId("5ea486690f09e71c2462385a"), "className" : "io.antmedia.rest.model.User", "email" : "[email protected]", "password" : "1234567", "userType" : "ADMIN" }
- You can update the password with a command something like below. Change the parameters below according to the your case.
db.User.updateOne( { email:"[email protected]" }, { $set: { "password" : "test123" }})
- Alternatively, you can delete the user with a command something like below. Change the parameters below according to the your case.
db.User.deleteOne( { "email": "[email protected]" } )
- As of version 2.3.2, passwords should be hashed with MD5.
RTMP means Real Time Messaging Protocol. RTMP is mostly depreciated for use as a viewer-facing video streaming protocol. However, RTMP is the most commonly used streaming protocol.
The HLS(HTTP Live Streaming) protocol was developed by Apple. The HLS streaming protocol works by chopping MPEG-TS video content into short chunks. On slow network speed, HLS allows the player to use a lower quality video, thus reducing bandwidth usage. HLS videos can be made highly available by providing multiple servers for the same video, allowing the player to swap seamlessly if one of the servers fails.
To reduce the HLS latency there are some parameters and it can be reduced to 8-10 secs for now.
- Make HLS segment time 2 seconds. You can decrease this value to have lower latency but then players start to poll server more frequently and it is waste of resources.
- Keyframe Interval: Make key frame interval to 2 seconds(This value should be consistent with HLS segment time). Open Broadcaster Software(OBS) sends key frame for every 10 seconds by default.
After you have done these adjustments, your latency will be significantly reduced.
Follow the SSL Setup Tutorial
Check that which port forwardings exist in your system with below command.
sudo iptables -t nat --line-numbers -L
The command above should give an output live below
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
1 REDIRECT tcp -- anywhere anywhere tcp dpt:https redir ports 5443
2 REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 5080
...
Delete the rule by line number. For instance to delete the http -> 5080 forwarding, run the command below
iptables -t nat -D PREROUTING 2
parameter 2 is the line number, if you want to delete https -> 5443, you should use 1 instead of 2
- First of all make sure that A record is entered in your DNS settings and point to your server.
- If you are sure about that, check the ports(443 and 80) are not blocked or are not forwarded to any other port.
- If you forward 80 or 443 ports to 5080 and 5443, then please remove these port forwarding settings as described above.
To solve this problem you must enable SSL. Follow the SSL Setup Tutorial
This issue is generally caused by unopened UDP ports. Please make sure that UDP ports 5000 to 65535 of your server are open.
getUserMedia
is only available in Safari, not other browsers on iOS. Issue is here
Video Codecs: H264, H265 and VP8, Audio Codecs: Opus and AAC are supported by Ant Media Server.
Ant Media Server measures the client's bandwidth and chooses the best quality in the adaptive bitrates according to the bandwidth of the client. For instance if there are three bitrates, 2000Kbps, 1500Kbps, 1000Kbps and Client's bandwidth is 1700Kbps then the video having 1500Kbps will be sent to the client automatically. If client's bandwidth decreases to 1200Kbps or less than 1000Kbps, then the video having 1000Kbps will be sent to the client automatically on the fly.
There are no difference between them fundamentally. Users can have different options and configurations in the same server with using different applications ( such as enabling H.264 in one app and enabling VP8 in the other ).
You can set the bandwidth
property to any value you want to use in WebRTCAdaptor
in JS SDK. This is the maximum bitrate value that WebRTC can use. Its default value is 900 and its unit is kbps
- ~0.5 seconds latency with WebRTC to WebRTC streaming path.
- 0.5-1 seconds latency with RTSP/RTMP to WebRTC streaming path.
- 8-12 seconds latency with RTMP/WebRTC to HLS streaming path.
There is no soft limit. Generally it's recommend to use 2 or 3 bitrates for most of the cases.
The recommended resolutions and bitrates are:
- 240p - 500 Kbps
- 360p - 800 Kbps
- 480p - 1000 Kbps
- 720p - 1500 Kbps
- 1080p - 2000 Kbps
Definitely YES. Ant Media Server provides ultra-low latency and adaptive bitrate at the same time.
Yes, Ant Media Server Enterprise has a native Embedded SDK for arm, x86 and x64.
MP4 files are recorded to the streams folder under the web apps. A soft link could be created for that path using this command: ln -s {target_folder} {link_name}
.
- Edit the following file with a text editor.
vim /usr/local/antmedia/conf/jee-container.xml
- Find the line as follow.
<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
And add the following line before it.
<bean id="valve.access" class="org.apache.catalina.valves.RemoteIpValve" />
- Find another line as follow.
<property name="rotatable" value="true" />
and add the following line before it.
<property name="requestAttributesEnabled" value="true" />
- After adding these lines, restart Ant Media Server with the following terminal command.
systemctl restart antmedia
The last edited version of the file will look like the following.
<bean id="valve.access" class="org.apache.catalina.valves.RemoteIpValve" />
<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
<property name="directory" value="log" />
<property name="prefix" value="${http.host}_access" />
<property name="suffix" value=".log" />
<property name="pattern" value="common" />
<property name="rotatable" value="true" />
<property name="requestAttributesEnabled" value="true" />
Now, You can use the IP filter.
1. Install openssl package.
apt-get update && apt-get install openssl -y
2. Create a self-signed certificate as follows.
ams.crt = your certificate file
ams.key = your key file
openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out ams.crt -keyout ams.key
3. Submit the requested information and press the Enter button.
Country Name (2 letter code) [AU]:UK
State or Province Name (full name) [Some-State]:London
Locality Name (eg, city) []:London
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Ant Media
Organizational Unit Name (eg, section) []:Support
Common Name (e.g. server FQDN or YOUR name) []:domain.com
Email Address []: [email protected]
4. The certificate and private key will be created at the specified location. Then run the enable_ssl.sh
script as below.
/usr/local/antmedia/enable_ssl.sh -f ams.crt -p ams.key -c ams.crt -d ams_server_ip
Note: If you want to use domain address with your local network, you need to add below parameter in /etc/hosts
file.
ams_server_ip domain.com
When you added domain address in your hosts file, you need run enable_ssl.sh
script as below.
/usr/local/antmedia/enable_ssl.sh -f ams.crt -p ams.key -c ams.crt -d domain.com
The most important reason to upload your Intermediate certificate with your SSL certificate is because the browser attempts to verify if your SSL certificate is real.
You are able to provide Intermediate certificates from the certificate provider web page.
The order of the certificate should be as follows.
Root Certificate
Intermediate Certificate
To give an example for Comodo;
cat COMODORSAAddTrustCA.crt COMODORSADomainValidationSecureServerCA.crt AddTrustExternalCARoot.crt > chain.crt
Now, your full chain certificate is chain.crt
java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
You can use a specific HTTP port instead of 5080. You just need to change below parameters:
- Change
http.port
in/AMS-FOLDER/conf/red5.properties
http.port=5080 // You need to change `5080` port what you want
- Change
RequestDispatherFilter
parameter in/AMS-FOLDER/webapps/root/WEB-INF/web.xml
as below:
<servlet>
<servlet-name>RequestDispatherFilter</servlet-name>
<servlet-class>io.antmedia.console.servlet.ProxyServlet</servlet-class>
<init-param>
<param-name>targetUri</param-name>
<param-value>http://localhost:5080/{_path}</param-value> // You need to change `5080` port what you want
</init-param>
<init-param>
<param-name>log</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>forwardip</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
1. Build glibc 2.29
sudo apt install build-essential bison
wget http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz
tar -xf glibc-2.29.tar.gz
cd glibc-2.29/
mkdir build
cd build
../configure --prefix=/opt/glibc-2.29
make
sudo make install
2. Run ant media as a init.d service
sudo systemctl stop antmedia
sudo systemctl disable antmedia
sudo rm /etc/systemd/system/antmedia.service
sudo cp /usr/local/antmedia/antmedia /etc/init.d/
sudo update-rc.d antmedia defaults
sudo update-rc.d antmedia enable
3. Add LD_PRELOAD to the init.d script
sudo nano /etc/init.d/antmedia
# ADD the following line before the line case "$1" in
export LD_PRELOAD="/opt/glibc-2.29/lib/libm.so.6"
4. Save and exit the editor. Run the following commands
sudo systemctl daemon-reload
sudo service antmedia stop
sudo service antmedia start
To backup Ant Media Server without upgrade process follow the below steps. It's sufficient to copy the /usr/local/antmedia/
directory.
- systemctl stop antmedia
- cp -p -R /usr/local/antmedia/ /backup_folder/
- systemctl start antmedia
- systemctl stop antmedia
- cp -p -R /backup_folder/antmedia /usr/local/
- chown -R antmedia.antmedia /usr/local/antmedia/
- systemctl start antmedia
- Introduction
- Quick Start
- Installation
- Publishing Live Streams
- Playing Live Streams
- Conference Call
- Peer to Peer Call
- Adaptive Bitrate(Multi-Bitrate) Streaming
- Data Channel
- Video on Demand Streaming
- Simulcasting to Social Media Channels
- Clustering & Scaling
- Monitor Ant Media Servers with Apache Kafka and Grafana
- WebRTC SDKs
- Security
- Integration with your Project
- Advanced
- WebRTC Load Testing
- TURN Servers
- AWS Wavelength Deployment
- Multi-Tenancy Support
- Monitor Ant Media Server with Datadog
- Clustering in Alibaba
- Playlist
- Kubernetes
- Time based One Time Password
- Kubernetes Autoscaling
- Kubernetes Ingress
- How to Install Ant Media Server on EKS
- Release Tests
- Spaceport Volumetric Video
- WebRTC Viewers Info
- Webhook Authentication for Publishing Streams
- Recording Streams
- How to Update Ant Media Server with Cloudformation
- How to Install Ant Media Server on GKE
- Ant Media Server on Docker Swarm
- Developer Quick Start
- Recording HLS, MP4 and how to recover
- Re-streaming update
- Git Branching
- UML Diagrams