/

Restreamer API


IP Camera

IP Camera List

Description

List IP Camera / RTSP ingests

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/camera1",
    "context": "live",
    "name": "camera1",
    "level": 0,
    "parameters": {
        "type": "ipcam"
    }
}

action isn't enforced for list since its the default action.

IP Camera Create

Description

Create a stream named camera1out from a connection to an IP Camera at 192.168.1.10:5443 Request

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/camera1",
    "context": "live",
    "name": "camera1",
    "level": 0,
    "parameters": {
        "type": "ipcam",
        "action": "create",
        "scopename": "live",
        "outputname": "camera1out",
        "host": "192.168.1.10",
        "port": 5443
    }
}

IP Camera Create - With Authentication

Description

Create a stream named camera1out from a connection to an IP Camera which supports Basic auth, at 192.168.1.10:5443

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/camera1",
    "context": "live",
    "name": "camera1",
    "level": 0,
    "parameters": {
        "type": "ipcam",
        "action": "create",
        "scopename": "live",
        "outputname": "camera1out",
        "host": "192.168.1.10",
        "port": 5443,
        "authtype": "Basic",
        "userName": "username",
        "password": "password123"
    }
}

IP Camera Kill

Description

Stop restreaming IP camera

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/camera1",
    "context": "live",
    "name": "camera1",
    "level": 0,
    "parameters": {
        "type": "ipcam",
        "action": "kill"
    }
}

RESPONSE

Success:

{
    "message": "Stream killed"
}

MPEG-TS

MPEG-TS List

Description

List MPEG-TS ingests

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "mpegts"
    }
}

action isn't enforced for list since its the default action.

RESPONSE

{
    "message": "Endpoints",
    "endpoints": {}
}

MPEG-TS Create - Multicast

Note - multicast streaming will only work over the same LAN. To test Multicast streaming, run the following from the same LAN as your Red5 Pro server (or on the server itself)

ffmpeg -re -stream_loop -1 -i [media file] -c:v h264 -bsf:v h264_mp4toannexb -profile:v baseline -c:a aac -b:a 128k -ar 44100 -f mpegts udp://239.5.5.5:5555?pkt_size=188

Description

MPEG-TS end-point creation.

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "mpegts",
        "action": "create",
        "cast": "multicast",
        "ip": "239.5.5.5",
        "port": 5555
    }
}

RESPONSE

{
    "message": "Stream created",
    "path": "/live/stream1"
}

MPEG-TS Create - Unicast

To test Unicast streaming, run the following from your desktop:

ffmpeg -re -i [media file] -c:v h264 -bsf:v h264_mp4toannexb -profile:v baseline -c:a aac -b:a 128k -ar 44100 -f mpegts udp://<server ip address>:1234?pkt_size=1316

Description

MPEG-TS end-point creation.

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "mpegts",
        "action": "create",
        "cast": "unicast",
        "ip": "0.0.0.0",
        "port": 1234
    }
}

RESPONSE

{
    "message": "Stream created",
    "path": "/live/stream1"
}

MPEG-TS Kill

Description

Kill only needs the stream name and the required Provision entries

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "mpegts",
        "action": "kill"
    }
}

RESPONSE

Success:

{
    "message": "Stream killed"
}

Failure:

{
    "message": "Stream kill failed"
}

SRT

Supported parameters

  • frameType - The type of encapsulation utilized for the data (audio, video, etc) traversing the network

    • 0 - MPEG-TS
    • 1 - EFP (Elastic Framework Protocol)
  • latency - TsbPd receiver delay (mSec) to absorb burst of missed packet retransmission. The time that should elapse since the moment when the packet was sent and the moment when it’s delivered to the receiver application in the receiving function. This time should be a buffer time large enough to cover the time spent for sending, unexpectedly extended RTT time, and the time needed to retransmit the lost UDP packet.
  • reorder - Maximum possible packet reorder tolerance (number of packets to receive after loss to send lossreport)
  • overhead - Recovery bandwidth overhead above input rate. A Maximum bandwidth ceiling based on % over input stream rate.
  • keyLength - Cryptographic key length in bytes

    • 0 = PBKEYLEN not set, crypto disabled
    • 16 = AES-128
    • 24 = AES-192
    • 32 = AES-256
  • passphrase - Crypto PBKDF2 Passphrase size [0,10..64] (0 = disable); for 128-bit encryption the passphrase must be at least 16 characters

Additional information about the parameters:

SRT Stream Create

Description

Add SRT stream

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "srt",
        "action": "create",
        "ip": "0.0.0.0",
        "port": 8001,
        "frameType": 0,
        "latency": 100,
        "reorder": 16,
        "overhead": 100,
        "keyLength": 16,
        "passphrase": "samplePassphrase"
    }
}

SRT Stream Kill

Description

Stop the SRT stream

REQUEST

  • URI: https://{hostname}/live/restream
  • Method: POST
  • Parameters:
{
    "guid": "live/stream1",
    "context": "live",
    "name": "stream1",
    "level": 0,
    "parameters": {
        "type": "srt",
        "action": "kill"
    }
}