Skip to content

Instantly share code, notes, and snippets.

@mekya
mekya / install_ssl_to_ant-media-server.sh
Last active January 29, 2018 07:46
Install LetsEncrypty SSL to Ant Media Server
#!/bin/bash
if [ -z "$1" ]; then
echo "Please give domain name as the parameter."
echo "Sample usage:"
echo "$0 example.com "
exit 1
fi
@mekya
mekya / media_server_comparison_table.txt
Last active January 30, 2018 09:00
Comparison Table
| Media | Installing | WebRTC | Market | | First |
| Server | to Ubuntu | Latency | Share | Price* | Release |
|----------------------|-------------|---------|---------|--------|---------|
| Wowza Streaming Eng. | Very Hard | -* | Biggest | $65 | 2007 |
| Red5 Pro | Easy | ~250ms | Medium | $109 | 2016* |
| Ant Media Server | Easy | ~250ms | Low | $39 | 2017 |
@mekya
mekya / AWS_Server_Initialization_Helpers.sh
Last active February 28, 2018 06:48
AWS_Server_Initialization_Helpers.md
#!bin/bash
# Copy below commented out lines to /etc/init.d/antmedia
# jsvc_exec function
#
# INITIALIZED=/usr/local/antmedia/conf/initialized
## if [ ! -f "$INITIALIZED" ]
## then
## echo "sleep 3 ; /usr/local/antmedia/conf/init.sh" | at now
@mekya
mekya / check_streams.sh
Created February 23, 2018 07:49
Check m3u8 files updated regularly
if [ $diff -gt $timeout ]
then
echo "Restarting channel $channelNo" >> /var/log/channel_control
sudo service channel_$channelNo stop
sleep 2
sudo service channel_$channelNo start
else
echo "Channel $channelNo running properly, last update time $diff seconds ago" >> /var/log/channel_control
fi
@mekya
mekya / logback.xml
Created October 11, 2018 10:59
Just a simple sample logback
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="ERROR_FILE">
<File>log/ant-media-server-error.log</File>
<Append>false</Append>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>log/ant-media-server-error.%i.log.gz</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>2</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
@mekya
mekya / webrtc_adaptor.js
Created October 15, 2018 14:45
Initialize WebRTCAdaptor JS
...
var webRTCAdaptor = new WebRTCAdaptor({
websocket_url : websocketURL,
mediaConstraints : mediaConstraints,
peerconnection_config : pc_config,
sdp_constraints : sdpConstraints,
localVideoId : "localVideo",
debug:true,
callback : function(info, description) {
if (info == "initialized") {
@mekya
mekya / listener_hook_url_postman_sample.json
Created November 13, 2018 09:13
Listener hook url postman sample
{
"variables": [],
"info": {
"name": "samples",
"_postman_id": "cbef37ab-d4ae-c349-4845-b4a91d1ab201",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@mekya
mekya / concatenate_mp4.sh
Created November 21, 2018 13:42
Concatenate mp4 files.
#!/bin/bash
# concatenate second file to end of first file
# first file 1.mp4 duration: 10sec
# second file 2.mp4 duration: 20sec
# output file 1.mp4 duration: 30sec
concatenate_files()
{
file1=$1
@mekya
mekya / push_release.sh
Last active January 7, 2019 07:43
Prepare for release
#!/bin/bash
#Usage
#First parameter is the version name either release or snapshot works
#if release version, create and checkout branch, update version, commit, tag and push are done
# ./release 1.6.1
#if snapshot version, update the version, commit and push are done. After that it should be merged with master
#./release 1.6.2-SNAPSHOT
check() {
OUT=$1
@mekya
mekya / concatenate_mp4_s3.sh
Created January 17, 2019 13:12
Instructions for S3 concatenation
#!/bin/bash
# concatenate second file to end of first file
# first file 1.mp4 duration: 10sec
# second file 2.mp4 duration: 20sec
# output file 1.mp4 duration: 30sec
concatenate_files()
{
file1=$1