Livepush Developers

Videos

Get video codec info

GET https://octopus.livepush.io/streams/{stream_id}/videos/{video_id}/codecinfo

Base URL https://octopus.livepush.io — Core Streams & Media APIs

Returns container and per-track codec details for a video: duration, resolution, frame rate and the audio and video codecs in use.

When the stored media info already lists codecs it is returned as-is; otherwise the API probes the file, caches the result on the video, and returns the fresh reading.

Requires a token with the streams.videos.write scope.

Authorization

Send a valid access token in the Authorization header.

  • bearerAuth — Bearer token (JWT)
headers.txt
Authorization: Bearer YOUR_API_TOKEN

Try it

GET https://octopus.livepush.io/streams/{stream_id}/videos/{video_id}/codecinfo — This call only reads data.

Parameters

Path parameters

  • stream_id string required
    Unique identifier of the stream.
    example: st_xxxxxxxxxxxxx
  • video_id string required
    Unique identifier of the video.
    example: vd_xxxxxxxxxxxx

Code samples

request.sh
curl -X GET 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/videos/vd_xxxxxxxxxxxx/codecinfo' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/videos/vd_xxxxxxxxxxxx/codecinfo', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
  },
});

if (!response.ok) {
  throw new Error(`Livepush API error ${response.status}`);
}

const data = await response.json();
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
}

response = requests.get('https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/videos/vd_xxxxxxxxxxxx/codecinfo', headers=headers, timeout=30)
response.raise_for_status()
data = response.json()

Responses

Get video codec info.

application/json

  • hasAudioTrack boolean
  • duration number
  • width integer
  • height integer
  • fps number
  • codecs VideoItemMediaInfoCodec[]
    • type VideoCodecType
      videoaudio
    • codec string
  • tracks object[]
Example 200 response response.json
{
  "hasAudioTrack": false,
  "duration": 0,
  "width": 0,
  "height": 0,
  "fps": 0,
  "codecs": [
    {
      "type": "video",
      "codec": "string"
    }
  ],
  "tracks": [
    {}
  ]
}

No response body.

Not found for this account.