Streaming iDFace
Streaming RTSP
The iDFace access controller is capable of streaming video from its camera via the RTSP protocol. Once the feature is enabled, to access the stream it is necessary to configure an RTSP client (such as VLC Media Player or Windows Media Player) to access the device at the /main_stream endpoint. It is important to note that the feature comes, by default, disabled and without credentials. To enable it, follow the configuration instructions that will be shown below.
URL for service access
If no username and password are registered, you can use the URL pattern shown below to access iDFace camera video streaming:
rtsp://device.ip.network.address:port/main_stream
If username and password are registered, the URL pattern is:
rtsp://username:password@device.ip.network.address:port/main_stream
Streaming RTSP parameter settings
Attention: all configuration changes listed below will only take effect after restarting the device
If the user wants to use the video streaming from the camera, it is necessary to enable it in the GUI, WEB interface or via API. The parameter that allows enabling (1) or disabling (0) is the rtsp_enabled of the onvif module.
Request example
This request enables video transmission via RTSP.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"rtsp_enabled": "1"
}
}
)
});
Port configuration
It is also possible to configure the port used for transmission. The default port used is "554". To change it, use the rtsp_port parameter of the onvif module.
Request example
This request changes the port of video transmission via RTSP.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"rtsp_port": "556"
}
}
)
});
Credential configuration
Likewise, it is possible to register a username and password so that the transmission is only enabled after providing the correct username and password. For this you must use the rtsp_username and rtsp_password parameters of the onvif module. By default, no username and password are registered in these parameters.
Request example
This request enters a username and password to activate video transmission via RTSP.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"rtsp_username": "admin",
"rtsp_password": "admin",
}
}
)
});
Camera setup
In addition, you can change the camera used to transmit video. The default camera is RGB, but over API request it is possible to change it to the infrared (IR) camera as well. The parameter responsible for this configuration is the rtsp_rgb of the onvif module, and there are two valid entries for it: "0" (IR) or "1" (RGB).
Request example
This request changes the camera from the video stream to the IR camera.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"rtsp_rgb": "0"
}
}
)
});
Codec setup
In addition, you can change the video codec used to transmit video. The default codec is MJPEG, but over API request it is possible to change it to H.264 codec. The parameter responsible for this configuration is the rtsp_codec of the onvif module, and there are two valid entries for it: "mjpeg" (MJPEG) or "h264" (H.264).
Request example
This request changes the codec video to the H.264 codec.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"rtsp_codec": "h264"
}
}
)
});
Streaming ONVIF
The iDFace Access Controller is also able to transmit the video stream from your camera through the ONVIF (Open Network Video Interface Forum) standard, recognized and used worldwide by several manufacturers of surveillance cameras and recorders.
Streaming ONVIF parameter settings
Attention: all configuration changes listed below will only take effect after restarting the device
First of all, note that ONVIF standard transmissions are performed using the RTSP protocol on its background, so remember to configure RTSP properly and enable it to ensure that the ONVIF transmission works without any error. ONVIF transmission will only work if the RTSP is active and operating correctly.
Also, it is important to know that ONVIF uses its default credentials, i.e. the value of "admin" for both login and password.
If the user wants to enable the ONVIF feature, it is necessary to enable it in the GUI, WEB interface or via API. The parameter that allows enabling (1) or disabling (0) is the onvif_enabled of the onvif module.
Request example
This request enables video transmission via ONVIF.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"onvif_enabled": "1"
}
}
)
});
Port configuration
It is also possible to configure the port used for transmission. The default port used is "8000". To change it, use the onvif_port parameter of the onvif module.
Request example
This request changes the port of video transmission via ONVIF.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"onvif_port": "8001"
}
}
)
});
Viewing Parameterizations
The iDFace access controller is also capable of transmitting video from its camera in 360x640 resolution, with the possibility of mirroring the image being transmitted.
Screen transmission parameter settings
In addition, it is possible to change the orientation of the video stream to either original or flipped. The parameter responsible for this setting is rtsp_flipped of the onvif module, and there are two valid entries for it: "0" for original or "1" for flipped.
Watermark and Logo
It is possible to enable or disable the watermark and the logo independently with the settings rtsp_watermark and rtsp_watermark_logo_enabled (module video_stream) respectively, to upload a new custom logo and enable it or not with the setting rtsp_watermark_custom_logo_enabled.
The recomended aspect ratio for the logo images is 5:1. The image must have a maximum size of 1MB. Height and Width must be less than 1000 pixels.
There are two ways of uploading the image containing the custom logo:
- Through web: the user selects a file from their computer (Settings -> Video Streaming)
- Through the GUI: the user inserts a USB flash drive into the device and selects the file through its GUI (Menu -> Facial Settings -> Cameras -> Video Streaming)
Request Example
This request switches to the flipped screen.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"onvif": {
"rtsp_flipped": "1"
}
}
)
});
Streaming logo
Allows managing a custom PNG logo overlaid on the video stream.
Available on versions V6, V7 and V8.
GET /get_streaming_logo.fcgi
Returns the current custom streaming logo as a PNG image. Returns an error if no custom logo has been set.
Parameters
- This call has no parameters.
Response
- PNG image of the streaming logo.
Request example
$.ajax({
url: "/get_streaming_logo.fcgi?session=" + session,
type: 'GET'
});
POST /set_streaming_logo.fcgi
Uploads a custom PNG logo to overlay on the video stream.
Parameters
- PNG image in binary format, sent as the request body (
application/octet-stream).
Response
- This call has no return.
Request example
$.ajax({
url: "/set_streaming_logo.fcgi?session=" + session,
type: 'POST',
contentType: 'application/octet-stream',
data: [bytes of PNG image]
});
POST /remove_streaming_logo.fcgi
Removes the custom streaming logo.
Parameters
- This call has no parameters.
Response
- This call has no return.
Request example
$.ajax({
url: "/remove_streaming_logo.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json'
});
Custom video
Allows uploading and managing a custom MP4 video to be played on the device's screen instead of the identification streaming.
Available on versions V7 and V8.
POST /send_video.fcgi
Uploads a custom MP4 video file to the device in chunks. The file must be sent in sequential blocks using current and total query parameters. Maximum total file size is 20 MB per chunk sequence.
Parameters
Passed as query string parameters:
- current (int): Required. Index of the current chunk being sent (starting at
1). - total (int): Required. Total number of chunks in the upload.
Body: raw MP4 binary data for the current chunk (application/octet-stream).
Response
- This call has no return.
Request example
$.ajax({
url: "/send_video.fcgi?current=1&total=2&session=" + session,
type: 'POST',
contentType: 'application/octet-stream',
data: [bytes of MP4 chunk]
});
POST /set_custom_video.fcgi
Configures whether the uploaded custom video should be active, and optionally assigns it a display name. The video uploaded via /send_video.fcgi is converted to the device's playback format in the background.
Parameters
- custom_video_enabled (int): Required.
1to enable the custom video,0to disable it. - video_name (string): Optional. Display name for the video.
Response
- This call has no return.
Request example
$.ajax({
url: "/set_custom_video.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
custom_video_enabled: 1,
video_name: "welcome.mp4"
})
});
POST /remove_custom_video.fcgi
Removes the custom video and reverts the device to its default display behavior.
Parameters
- This call has no parameters.
Response
- This call has no return.
Request example
$.ajax({
url: "/remove_custom_video.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json'
});
Stream bitrate settings
It is possible to change the maximum bitrate of the video stream. The parameter responsible for this setting is max_bitrate of the video_stream module and valid entries are all integers between 600 and 6000, inclusive.
Request Example
This request changes the maximum bitrate to 1000 Kb/s.
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"video_stream": {
"max_bitrate": "1000"
}
}
)
});