You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close

API Tip : How to get the video from DW Spectrum mediaserver

------------------------
Affected Roles: All user
Related DW Spectrum VMS Apps: DW Spectrum Server 
Difficulty: Medium
-------------------------

The DW Spectrum Server API allows developers to pull the streams from DW Spectrum mediaserver in different codec via HTTP. In this guide, we'll show you how to use the API for anytime you want to utilize live or recorded video from a camera or cameras in your DW Spectrum System.

In API documentation, one can find the section called HTTP streaming (demo/demo) The developers can use this API to retrieve any piece of archive stored or live video.

Codec and stream format can be specified in URL parameters. If required and possible, media stream transcoding is performed on-the-fly. Supported stream formats are webm, mpegts, and mpjpeg (motion jpeg).

The URL to request is:

http://{serverIp}:{port}/media/{cameraId}.{format}?resolution={resolution}&pos={dateAndtime}&{sfd,rt,rotation}

Example of url:

http:// 100.32.247.140:7001/media/321360dd-7b01-f4b5-9372-16deb7ea1293.mpjpeg?resolution=240p&pos=2018-05-08T12:10:30:000&sfd&rt

NOTE

  1. If there is no archive on the assigned time, DW Spectrum will jump to the closet time which has archive can be provided.
     
  2. The option - rt,  is to enable the real-time optimization. 
    It might skip some frames if the CPU on the server is not enough for real-time transcoding.

     
  3. The option - sfd,  is called Stand Frame Duration. 
    If the parameter is present, video speed is limited by real time. 
    For example - if you are pulling the MPJPEG, if sfd presented, the archive will be in real-time, if sfd does not present, it will look like fast forwarding.

     
  4. Here's a link to guide to find camera id.
     
  5. DW Spectrum provides the API to let you know the existing archive of each camera.(identified by duration and start position):
    http://{serverIp}:{port}/ec2/recordedTimePeriods?cameraId={cameraId}

     
  6.  Where can I find the DW Spectrum SDK/API?
  • 76
  • 03-Apr-2019
  • 2090 Views