/

API Servlet Examples


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 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 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"
}