Vidtreo

Recording Markers

Mark moments of a recording while it happens. Markers travel with the recording, and Intelligence analyzes each marked part on its own.

Recording Markers

A marker is a labeled moment that your app sets while recording: "Second question", "Section 3", "Product demo". VIDTREO stores the markers with the recording and returns them wherever the recording appears. When an Intelligence lens analyzes the recording, the result includes one summary per marker.

Your UI moves on to the next part
    → mark({ id, label }) at the recording's current time
    → The upload sends the markers with the recording
    → The recording returns its markers in the API and webhooks
    → Intelligence analyzes each marked part → result.markers

VIDTREO never interprets a label. Use markers for interview questions, exam sections, the steps of a support call, or the chapters of a lesson.

Markers are optional. A recording without markers behaves exactly as it did before: the same request, the same responses, the same analysis.

The Marker

type RecordingMarker = {
  id: string     // 1–64 characters, unique within the recording
  time: number   // seconds from the start of the recording
  label: string  // 1–500 characters
}
RuleLimit
Markers per recordingUp to 200
id1–64 characters after trimming spaces, unique within the recording
label1–500 characters of plain text after trimming spaces
timeSeconds, 0 or more. A time past the end of the recording is stored as the end

A marker covers the recording from its time until the next marker, or until the end. VIDTREO stores markers sorted by time.

Setting Markers with the SDK

Call mark() while recording. The SDK takes the time from the recording's own clock: seconds since the recording started, with paused time left out. You never compute a timestamp.

import { useState } from 'react';
import { useVidtreoRecorder } from '@vidtreo/recorder-react';

function Interview({ questions }) {
  const { state, actions } = useVidtreoRecorder({ apiKey: 'your-api-key' });
  const [index, setIndex] = useState(0);

  const showQuestion = (next: number) => {
    setIndex(next);
    actions.mark({ id: questions[next].id, label: questions[next].text });
  };

  // Call showQuestion(0) once state.recordingState is 'recording',
  // then showQuestion(index + 1) each time the user clicks Next.
}
import { VidtreoRecorder } from '@vidtreo/recorder';

const recorder = new VidtreoRecorder({ apiKey: 'your-api-key' });
await recorder.initialize();
await recorder.startRecording();

recorder.mark({ id: 'intro', label: 'Introduction' });
// ...later, when your UI moves on
recorder.mark({ id: 'demo', label: 'Product demo' });

await recorder.stopRecording();
const recorder = document.querySelector('vidtreo-recorder');

recorder.mark({ id: 'q2', label: 'Second question' });

In native camera mode the element ignores mark(), because the recording happens in the device's camera app.

The markers are sent with the upload when the recording stops. If you never call mark(), the upload request carries no markers field at all.

With the ready-made components

The stock <VidtreoRecorder> components of React and Vue also expose mark(), through a ref. The Nuxt module uses the Vue component, so it works the same way.

import { useRef } from 'react';
import { VidtreoRecorder, type VidtreoRecorderHandle } from '@vidtreo/recorder-react';

function Interview() {
  const recorderRef = useRef<VidtreoRecorderHandle>(null);

  const showSecondQuestion = () => {
    recorderRef.current?.mark({ id: 'q2', label: 'Second question' });
  };

  return (
    <div>
      <VidtreoRecorder ref={recorderRef} apiKey="your-api-key" />
      <button onClick={showSecondQuestion}>Next question</button>
    </div>
  );
}
<script setup lang="ts">
import { ref } from 'vue';
import { VidtreoRecorder, type VidtreoRecorderExposed } from '@vidtreo/recorder-vue';

const recorderRef = ref<VidtreoRecorderExposed | null>(null);

function showSecondQuestion() {
  recorderRef.value?.mark({ id: 'q2', label: 'Second question' });
}
</script>

<template>
  <VidtreoRecorder ref="recorderRef" :recorder-props="{ apiKey: 'your-api-key' }" />
  <button @click="showSecondQuestion">Next question</button>
</template>
  • The ref marks the recording of whichever recorder the component shows: desktop, mobile embed or mobile overlay. In native camera mode it does nothing.
  • Before the recorder is ready, or when no recording is running, it throws a RecordingMarkerError with code recording.marker-not-recording. isRecordingMarkerError and the ERROR_RECORDING_MARKER_* codes are exported from @vidtreo/recorder-react and @vidtreo/recorder-vue.

mark() requires @vidtreo/recorder 1.14.0 or later, and the matching React, Vue, and Web Component packages. Calling it when no recording is in progress, repeating an id, or adding a 201st marker throws a RecordingMarkerError. See mark() for the error codes.

Setting Markers with the API

If you upload with your own client, send markers in the request that starts the upload. POST /api/v1/audios/uploads accepts the same field.

POST /api/v1/videos/uploads
Authorization: Bearer vt_live_xxxxxxxxxxxxxxxxxxxx
Idempotency-Key: interview-8231
Content-Type: application/json

{
  "filename": "interview.mp4",
  "fileSize": 48213504,
  "mimeType": "video/mp4",
  "duration": 412.6,
  "markers": [
    { "id": "q1", "time": 0, "label": "Tell us about yourself" },
    { "id": "q2", "time": 74.2, "label": "A deal you lost and what you learned" }
  ]
}
  • An invalid marker or a repeated id rejects the request with a validation error.
  • A time past the end of the recording is stored as the end. A marker never makes an upload fail for being late, because the time it was set and the duration of the encoded file come from different clocks.
  • A retry with the same Idempotency-Key must send the same markers. Sending different markers is a conflict.

Reading Markers

Every video and audio response includes markers, an empty array when the recording has none. The recording snapshot in webhooks carries the same field as data.video.markers or data.audio.markers.

"markers": [
  { "id": "q1", "time": 0, "label": "Tell us about yourself" },
  { "id": "q2", "time": 74.2, "label": "A deal you lost and what you learned" }
]

In the VIDTREO Dashboard, the player shows each marker on its timeline, and the Markers tab jumps to each one.

Markers in Intelligence

When an analyzed recording has markers, the lens reads each marked part as a unit and the result adds markers[]: one entry per marker, with a summary of that part and the evidence that supports it.

"markers": [
  {
    "id": "q2",
    "label": "A deal you lost and what you learned",
    "start": 74.2,
    "end": 151.8,
    "summary": "Describes losing a renewal to a cheaper competitor and the pricing review that followed.",
    "evidence": [
      { "id": "S12–S15", "kind": "segment", "start": 76.0, "end": 118.4, "speaker": "A" }
    ]
  }
]

This is what keeps a lens reusable. The questions of a job opening, the sections of an exam, or the steps of a call travel with each recording, so one lens serves all of them. See Results & Webhook for the field reference.

A label is context, never an instruction. The analysis reads it the same way it reads a transcript line and does not follow commands written in it.

On this page