Nx Media Server allows users to export video using HTTP-GET methods.
In API documentation one can find section called "Direct download" which describes a way to download certain piece of the archive.
Note! The archive piece must exist. I.e. if there's no recording for that time you won't get anything.
Fragment of a camera archive to download is identified by camera id, its start time position and duration. Fragment can be downloaded in mp4, mpjpeg, mpeg-2/ts (.mpegts), webm or Matroska (.mkv) format. In cases of webm or mpjpeg transcoding will be obligatorily performed.
The url to request is:
http(s)://<server_address>/media/<camera_id>.<format>?pos=<start_time>&duration=<seconds>
Note! Here's a link to guide to find camera id.
Start time should be in a form of a string containing time in milliseconds since epoch, or a local time formatted like "YYYY-MM-DDTHH:mm:ss.zzz"
- the format is auto-detected
Example of url:
http://192.168.178.10:7001/media/5bafc0e9-56be-97f8-5034-45a50cecf3d8.mp4?pos="2017-07-13T00:00:00"&duration=100
Note! In this case fragment piece date and time should be specified according to Media Server Local Time.
Example of the same url using a milliseconds since epoch(Unix time) format for the pos parameter value:
http://192.168.178.10:7001/media/5bafc0e9-56be-97f8-5034-45a50cecf3d8.mkv?pos="1499904000000"&duration=100
P.S. One can get list of all existing archive pieces for certain camera with request(identified by duration and start position):
http://<server_ip>:<port>/ec2/recordedTimePeriods?cameraId=<camera_id>
Example:
http://192.168.178.10:7001/ec2/recordedTimePeriods?cameraId=5bafc0e9-56be-97f8-5034-45a50cecf3d8
Questions
If you have any questions related to this topic or you want to share your experience with other community members or our team, please visit and engage in our support community or reach out to your local reseller.
Comments
0 comments
Article is closed for comments.