Documentation for C-Werk 2.0.

Previous page Next page

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

On the page:

Attention!

  • You can get audio from x64 Server only.
  • You can't get audio in MJPEG format.

General information

GET http://IP Address:port/prefix/live/media/{VIDEOSOURCEID}

{VIDEOSOURCEID}a three-component source endpoint ID (see Get list of video cameras and information about them). For instance, "SERVER1/DeviceIpint.3/SourceEndpoint.video:0:0".

Attention!

If no parameters are specified in the request, then the video will be received in the MJPEG format.

ParameterRequiredDescription
formatNo

Parameter values are "mp4", "hls".

Video can be received in the original format (without recompression) via HLS protocols. HLS protocol supports only H.264 format.

The "mp4" player allows to receive the original video in H.264 and H.265 formats. In all other cases the Server recompresses it to MJPEG format. 

Attention!

If video is requested in the format that differs from the original one, then recompression will be performed, therefore, Server load will increase.

w, hNo

wframe width, h—frame height.

Attention!

The mp4 video is transferred without scaling.

If the h and w values are greater than the size of the original video, the video will be received with the original size.

Zooming out of width and height is available only discretely—in 2, 4, 8 times, etc. If specified sizes are not corresponding to 1/2, 1/4 etc. of original video size, the video will be received with size divisible by the original video size close to specified values.

frNo

The FPS value.

Attention!

This parameter is relevant only for MJPEG video.

enable_token_auth No

Get authorized and signed links to video streams.

  • enable_token_auth—enable authorization by token = 1.
  • valid_token_hours—signature validation time (in hours). The maximum value is a week. The default value is 12 hours
valid_token_hoursNo

key_frames

No

1playback only by key frames;

0original frame rate (default)

authTokenNo

Starting with C-Werk 2.0

Connecting via C-Werk Cloud.

For example, https://C-Werk Cloud.com/arpserver/25455_0/webclient/live/media/SERVER/DeviceIpint.1/SourceEndpoint.video:0:1?authToken=...

auth_tokenNo

Starting with C-Werk 2.0

Authorizing when connecting directly to the Server and authorizing by token.

For example, http://127.0.0.1:80/live/media/SERVER/DeviceIpint.1/SourceEndpoint.video:0:0?format=mp4&auth_token=...


Sample request
:

GET http://127.0.0.1:80/live/media/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?w=640&h=480&enable_token_auth=1&valid_token_hours=1

HLS video

HLS protocol video can be received in the original format only. The following parameters are used when receiving HLS protocol video:

ParameterRequiredDescription
keep_aliveNoTime in seconds in which the stream is to be kept alive
hls_timeNoThe segment length in seconds
hls_list_sizeNoThe maximum number of playlist entries. If set to 0, the list file will contain all segments
hls_wrapNoThe number after which the segment filename number wraps. If set to 0, the number will be never wrapped

Sample request:

GET http://127.0.0.1:80/live/media/SERVER1/DeviceIpint.23/SourceEndpoint.video:0:0?format=hls&keep_alive=60

Sample response:

{
    "keep_alive_seconds": 60,
    "keep_alive_url": "/live/media/hls/keep?stream_id=7e9d8c93-80e2-4521-9a54-cb854fe3cd2d",
    "stop_url": "/live/media/hls/stop?stream_id=7e9d8c93-80e2-4521-9a54-cb854fe3cd2d",
    "stream_url": "/hls/7e9d8c93-80e2-4521-9a54-cb854fe3cd2d/playout.m3u8"
}
ParameterDescription
keep_alive_secondsTime in seconds in which the stream is to be kept alive
keep_alive_url The url to keep the stream alive
stop_urlThe url to stop the stream
stream_urlThe url to access the list of segments

Attention!

HLS protocol video becomes available with some delay (about 20 seconds). This is due to a feature of the HLS protocol: after receiving the link, it forms a cache of several video segments, and only after that the video starts playing.

To playback video via HLS protocol, use the stream_url parameter from the response as follows:

ffplay "http://root:root@10.0.12.65:80/hls/c83b48d5-2ab7-49eb-91ef-593f808d4e51/playout.m3u8"

RTSP video

RTSP protocol video is sent in the original format only.

Request to get the structure of the RTSP link: http://login:password@IP Address:Port/live/media/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?format=rtsp

Sample response:

{
    "http": {
        "description": "RTP/RTSP/HTTP/TCP",
        "path": "hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0",
        "port": "8554"
    },
    "rtsp": {
        "description": "RTP/UDP or RTP/RTSP/TCP",
        "path": "hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0",
        "port": "554"
    }
}

Request to get video: GET rtsp://login:password@IP Address:554/hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0

Attention!

In some cases, the RTSP video can be streamed with artifacts. To fix this, change the TCP/IP settings using this reg file.

RTSP stream information:

GET http://IP Address:port/prefix/rtsp/stat

HTTP video

ffplay.exe -v debug "http://login:password@IP Address:8001/live/media/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?w=1600&h=0"

Attention!

HTTP sends video in mjpeg only, the w and h parameters are mandatory.

Tunneling RTSP over HTTP

See Configure tunneling RTSP over HTTP in VLC.

Video is sent over the tunnel in the original format.

Sample request:

ffplay -rtsp_transport http "rtsp://login:password@IP Address:80/rtspproxy/hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0"

GET for VLC: rtsp://login:password@IP Address:80/rtspproxy/hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0

H.264 and H.265 video

To get live video in the original H.264 and H.265 formats, use mp4 format.

Sample request:

ffplay.exe "http://root:root@192.168.25.112:8001/live/media/Server1/DeviceIpint.61/SourceEndpoint.video:0:0?format=mp4"


  • No labels