Nx Witness allows you to retrieve RTSP streams from IP cameras using the Server API. Streaming over TCP and UDP is supported, however, TCP is the recommended protocol. RTSP streams are commonly used for securely retrieving video from cameras for analysis (e.g. object detection, face recognition, etc).
For more information, please refer to the How does Nx Witness Server RTSP Streaming Work? article.
How to Make the API Call?
The API call used for retrieving RTSP streams is GET/{deviceId}.
URL Format
rtsp://<server_ip>:<port>/<deviceid>?onvif_replay=true&pos=1235631&resolution=240p
Parameters
deviceid is a required parameter. It can be retrieved from the "id", "physicalId" (i.e. MAC address), or "logicalId" fields. See the What are Camera Identifiers? for instructions on obtaining this value.
When onvif_replay is set to true (as shown in the URL example above), it inserts the ONVIF header extension that contains the absolute timestamp (UTC).
Optional parameters:
- pos — defines position in an archive. By default, it uses the live position.
- resolution — turns on video transcoding to the specified resolution*.
- rotation — rotates a video, in degrees. By default, it uses the default value defined in the device’s settings*.
- codec — defines video codec used for transcoding. By default, it’s H263p*.
- stream — opens a high quality stream if parameter is 0 or low quality stream if parameter is 1.
- speed — defines playback speed. By default, it’s 1.
- multiple_payload_types — generates SDP with two payload types (high and low qualities).
- disable_fast_channel_zapping — disables fast channel zapping. The stream will wait before starting, until the next keyframe from the device is received.
* = Changing these values will increase the load on the server CPU and RAM and should be taken into consideration when selecting the server hardware
What is an RTP header extension?
An RTP header extension contains an NTP timestamp and additional information that is used for replay. It exists to associate an absolute timestamp with each packet, so to allow clients to report a stable and accurate timestamp for each frame played back.
The NTP timestamp corresponds to wallclock time as measured at the original frame grabber before encoding of the stream. The replay mechanism uses the extension ID 0xABAC for the replay extension. RTP header extension is present in the first packet of every access unit (e.g. video frame).
RTP Packets contains the following parameters:
- NTP timestamp — timestamp indicating the absolute UTC time associated with the access unit.
- C field — indicates the synchronization point or “clean point”. With regard to video streams, the start of an intra-coded frame.
- E field — indicates the end of a contiguous section of recording.
- D field — indicates that this access unit follows a discontinuity in transmission.
- T field — indicates that this is the terminal frame on playback of a track
- Mbz — this field is reserved for future use and must be zero.
- Cseq — low-order byte of the Cseq value used in the RTSP PLAY command that was used to initiate transmission.
Comments
0 comments
Article is closed for comments.