Nx Witness allows users to export video using an HTTP-GET method.
In the API Documentation, refer to the Video API section and find HTTP Streaming which you can use to download video archives from a camera.
Since Nx Witness 4.2, the updated method for retrieving video archives uses /media/
instead of /hls/
. The /hls/
method is deprecated and may or may not still work, but it is no longer supported or recommended for use.
Note: The archive with your selected timestamps must exist before you can retrieve it. If it doesn't exist, the archive will not be downloaded.
The camera archive portion that you wish to download is identified by its camera id, start time position and duration. The archive can be downloaded in the following formats: webm, mpegts, mpjpeg (multipart jpeg), mp4, and mkv.
Note: MKV and MP4 videos can be exported without transcoding. Webm videos will require transcoding.
The format of the URL is the following:
http://<server_ip>:<port>/media/<camera_id>.mkv?pos="YYYY-MM-DDTHH:MM:SS"&duration=<seconds>
Refer to this article to learn how to find your camera id.
By default, the stream
parameter is determined automatically by the server based on the destination resolution. To select the stream quality, add &stream=0
to the URL request for high quality, and &stream=1
for low quality.
Example URL request:
http://127.0.0.1:7001/media/5bafc0e9-56be-97f8-5034-45a50cecf3d8.mkv?pos="2017-07-13T00:00:00"&duration=100
Note: The date and time in pos should be specified according to Media Server Local Time. The pos
parameter can also take a string containing time in milliseconds since epoch (Unix time).
http://127.0.0.1:7001/media/5bafc0e9-56be-97f8-5034-45a50cecf3d8.mkv?pos="1499904000000"&duration=100
To get a list of all existing archive pieces for certain cameras with a request (identified by duration and start position), use the following format:
http://<server_ip>:<port>/ec2/recordedTimePeriods?cameraId=<camera_id>
Example:
http://127.0.0.1:7001/ec2/recordedTimePeriods?cameraId=5bafc0e9-56be-97f8-5034-45a50cecf3d8
Comments
0 comments
Article is closed for comments.