Note: You must contact Hive to have streams allocated to your project before you can use this feature.

This endpoint supports generating audio segments out of a video or audio stream.
By default audio segments are generated at 30 second intervals.

Submit your stream using the key below:

  • Use url for the streaming URL for your media.

EXAMPLES


curl --request POST \
  --url https://api.thehive.ai/api/v2/stream/audio \
  --header 'accept: application/json' \
  --header 'authorization: token <API_KEY>' \
  --form 'url=<STREAMING URL>' \
  --form 'callback_url=https://webhook.site/#!/3f2cca3e-d386-44d8-9548-63275021a443'\
  --form 'segment_time=30'
var request = require("request");

var options = {
  method: 'POST',
  url: 'https://api.thehive.ai/api/v2/stream/audio',
  headers: {
    accept: 'application/json',
    authorization: 'token <API_KEY>'
  },
  form: {url:"<STREAMING URL>",
        callback_url:"https://webhook.site/#!/3f2cca3e-d386-44d8-9548-63275021a443"}
};  

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
import requests
url = 'https://api.thehive.ai/api/v2/stream/audio'
headers = {"authorization": "token <API_KEY>", "accept": "application/json"}
data = {'url': '<STREAMING URL>', 'callback_url': 'https://webhook.site/#!/3f2cca3e-d386-44d8-9548-63275021a443'}
response = session.post("https://api.thehive.ai/api/v2/stream/frame", headers = headers, data = data)

RESULTS


{
    "stream_id": "3faed5c0-2328-11ed-95cc-936b55ae22dc",
    "message": "ok"
}
{
    "return_code": 400,
    "message": "Invalid stream url: https://not_a_real_url"
}
{
    "return_code": 429,
    "message": "You can not have more than 0 streams active"
}
Form Data
string

Use this key to send your media using a publicly accessible streaming url.

string

Callback URL where Hive will post the response to.

number

The length of audio chunks to create out of the stream

string

User specified metadata the will be included in the callback response.

HEADERS
string
required

Project API Token from hive customer dashboard. Prepend with 'token'