Skip to content

Commit

Permalink
Merge branch 'master' into newWebHooks
Browse files Browse the repository at this point in the history
  • Loading branch information
lastpeony committed Mar 10, 2023
2 parents 26afa11 + 79d5130 commit 9f10b5d
Show file tree
Hide file tree
Showing 42 changed files with 22,656 additions and 561 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AMS supports adaptive streaming in both WebRTC and HLS formats. On the other han

## How to enable adaptive bitrate

### 1\. From the dashboard
### From the dashboard

Enable adaptive streaming under App >` Settings >` Adaptive Bitrate and add new streams.
![](@site/static/img/abs.png)
Expand All @@ -44,11 +44,27 @@ The configuration above will create videos at 1080p, 720p, and 360p resolutions

![](@site/static/img/iosmediacaptureresolutions.png)

### 2\. Using configuration file
### Using configuration file

Open the configuration file `{INSTALL\_DIR}/webapps/{APP\_NAME}/WEB-INF/red5-web.properties`**` with your favorite editor.

Now, add this line to the file: `settings.encoderSettingsString=\[{"videoBitrate":800000,"forceEncode":true,"audioBitrate":64000,"height":360},{"videoBitrate":500000,"forceEncode":true,"audioBitrate":32000,"height":240}\]`
Now, add this line to the file: 

```js
settings.encoderSettingsString=[
{
"videoBitrate":800000,
"forceEncode":true,
"audioBitrate":64000,
"height":360},
{
"videoBitrate":500000,
"forceEncode":true,
"audioBitrate":32000,
"height":240
}
]
```

The format of the file is as follows: resolution height, video bitrate per second, and audio bitrate per second. In the example above, we are adding two adaptive bitrates:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Generating Thumbnails

Ant Media Server can generate periodic previews (snapshots) of the incoming streams on the fly. This guide will help you learn configuration parameters for generating and using previews.

In order to activate preview generation, you just need to add at least one adaptive bitrate. You can do that in the dashboard using ```Application >` Your App >` Settings >` Add New Bitrate```
In order to activate preview generation, you just need to add at least one adaptive bitrate. You can do that in the dashboard using ```Application > Your App > Settings > Add New Bitrate```

![](@site/static/img/preview_1.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ When there are some network securities like firewall, then data packet does not

So we use TURN server for this solution.

Ant Media Server does not require TURN server even if there is Symmetric NAT. However it's required if UDP ports are blocked for any reason or Ant Media Server is used as signaling server in P2P communication.

Ant Media Server does not require TURN server even if there is Symmetric NAT. However it's required if UDP ports are blocked for any reason or Ant Media Server is used as signaling server in P2P communication.

### Install TURN server

Expand All @@ -36,35 +35,33 @@ Edit the following file.

just add it to the 2 lines below.

user=username:password

realm=your_public_ip_address
user=username:password

realm=your_public_ip_address
and restart TURN server

```systemctl restart coturn```

* If you use AWS EC2 instance, you need to add extra the below lines

#EC2 private ip address
* If you use AWS EC2 instance, you need to add extra the below lines

relay-ip=your_private_ip
#EC2 private ip address

#EC2 Public/Private ip address
relay-ip=your_private_ip

external-ip=your_public_ip/your_private_ip
#EC2 Public/Private ip address

* Open the following ports on AWS console
external-ip=your_public_ip/your_private_ip
* Open the following ports on AWS console

TCP 443 #TLS listening port
TCP 443 #TLS listening port

TCP 3478-3479 #coturn listening port
TCP 3478-3479 #coturn listening port

TCP 32355-65535 #relay ports range
TCP 32355-65535 #relay ports range

UDP 3478-3479 #coturn listening port
UDP 3478-3479 #coturn listening port

UDP 32355-65535 #relay ports range
UDP 32355-65535 #relay ports range

That 's it.

Expand All @@ -78,7 +75,7 @@ turnutils\_uclient -v -t -T -u username -w password -p 3478 turn\_server\_ip

Open the following link and fill in the blanks then ```Add Server```

[https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/)
[https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/)
![](@site/static/img/turn1.png)

**Then click ```Gather Candidates```. If everything is fine, you will get the output as in the below image.**
Expand All @@ -89,12 +86,11 @@ Open the following link and fill in the blanks then ```Add Server```

Go to the codes of index.html, play.html or player.html and change the pc\_config like;

var pc_config = {
'iceServers' : [ {
'urls' : 'turn:`<turn_server_address>`:`<port_number>`',
'username': "username",
'credential': "password",
} ]
};

In v2.4.4 & above, TURN server can be configured on server side. Please check [**here**](https://resources.antmedia.io/docs/configuring-stun-server#configuring-for-ant-media-244-and-later-versions).
var pc_config = {
'iceServers' : [ {
'urls' : 'turn:`<turn_server_address>`:`<port_number>`',
'username': "username",
'credential': "password",
} ]
};
In v2.4.4 & above, TURN server can be configured on server side. Please check [**here**](https://resources.antmedia.io/docs/configuring-stun-server#configuring-for-ant-media-244-and-later-versions).
Loading

0 comments on commit 9f10b5d

Please sign in to comment.