SDKs

Your pipeline. Our models.

Python and JavaScript examples for local preprocessing, asynchronous model tasks, and hosted video workflows.

Code, API identifiers, and request values retain their original technical language.

Open-source tools / Shot Detection

Start with shot boundaries.

Shot Detection is a standalone Python tool for splitting video into shots with start and end timestamps. Combine it with the Seeknetic SDK to build a shot-level processing workflow.

  1. 01

    Detect shot boundaries

    Run Shot Detection on a video to obtain each shot’s start and end times.

  2. 02

    Encode or tag each shot

    Pass each time range to the SDK’s local preprocessing workflow, then submit an embedding or tagging task.

  3. 03

    Build retrieval

    Store the returned vectors and metadata in your application, keeping source files and timestamps linked to each result.

Shot Detection handles shot boundaries. Model encoding and tagging use the separately installed Seeknetic SDK and require API access, billed at the published API rates.

Install
pip install seeknetic

Install ffmpeg first, and ensure ffmpeg/ffprobe are on PATH.

Quick Start

Installation plus the first text embedding request.

Install from PyPI

bash
pip install seeknetic

Text embedding

Use the synchronous Python client for the first request, then move to async only if you need higher concurrency.

python
import os
from seeknetic import Seeknetic

client = Seeknetic(
    api_key=os.environ["SEEKNETIC_API_KEY"],
)

response = client.video_embedding.encode_text(
    text="a person walking on the beach"
)

print(len(response.embedding))

Local Source Video Workflows

Recommended for local files. Install ffmpeg before using preprocess_and_upload(...).

Your original video stays local. This workflow uploads only the preprocessed tensors. Use service="embedding" only with video_embedding.encode_video.submit_async(...), and service="tagging" only with video_tagging.submit_async_job(...).

Embedding · Step 1 · Preprocess and upload

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

upload = client.preprocess_and_upload(
    video_path="sample.mp4",
    service="embedding",
    request_id="emb-task-0001",
    start_ms=0,
    end_ms=10_000,
)

print(upload.request_id)
print(upload.r2_keys)

Embedding · Step 2 · Submit async job

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

upload = client.preprocess_and_upload(
    video_path="sample.mp4",
    service="embedding",
    request_id="emb-task-0001",
)

job = client.video_embedding.encode_video.submit_async(
    tensor={
        "video_input_key": upload.r2_keys["video_input"],
        "audio_input_key": upload.r2_keys["audio_input"],
    },
    request_id=upload.request_id,
)

print(job.request_id, job.status)

Embedding · Step 3 · Poll result

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

status = client.async_status.retrieve("emb-task-0001")

print(status.status)
print(status.embedding)

Tagging · Step 1 · Preprocess and upload

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

upload = client.preprocess_and_upload(
    video_path="sample.mp4",
    service="tagging",
    request_id="tag-task-0001",
    start_ms=0,
    end_ms=10_000,
)

print(upload.request_id)
print(upload.r2_keys)

Tagging · Step 2 · Submit async job

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

upload = client.preprocess_and_upload(
    video_path="sample.mp4",
    service="tagging",
    request_id="tag-task-0001",
)

job = client.video_tagging.submit_async_job(
    tensor={
        "video_input_key": upload.r2_keys["video_input"],
        "video_kwargs_key": upload.r2_keys["video_kwargs"],
    },
    request_id=upload.request_id,
)

print(job.request_id, job.status)

Tagging · Step 3 · Poll result

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

status = client.async_status.retrieve("tag-task-0001")

print(status.status)
print(status.tags)

Uploaded or Hosted Video Workflows

Submit video_url directly when you do not need local preprocessing.

Embedding · Step 1 · Submit video_url

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

job = client.video_embedding.encode_video.submit_async(
    video_url="https://example.com/video.mp4",
)

print(job.request_id, job.status)

Embedding · Step 2 · Poll result

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

status = client.async_status.retrieve("emb-task-0001")

print(status.status)
print(status.embedding)

Tagging · Step 1 · Submit video_url

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

job = client.video_tagging.submit_async_job(
    video_url="https://example.com/video.mp4",
)

print(job.request_id, job.status)

Tagging · Step 2 · Poll result

python
import os
from seeknetic import Seeknetic

client = Seeknetic(api_key=os.environ["SEEKNETIC_API_KEY"])

status = client.async_status.retrieve("tag-task-0001")

print(status.status)
print(status.tags)

Async Client

The README also documents aiohttp support for higher concurrency.

Install aiohttp extra

bash
pip install seeknetic[aiohttp]

Use AsyncSeeknetic with DefaultAioHttpClient

python
import os
import asyncio
from seeknetic import DefaultAioHttpClient
from seeknetic import AsyncSeeknetic


async def main() -> None:
    async with AsyncSeeknetic(
        api_key=os.environ.get("SEEKNETIC_API_KEY"),
        http_client=DefaultAioHttpClient(),
    ) as client:
        response = await client.video_embedding.encode_text(
            text="a person walking on the beach"
        )
        print(len(response.embedding))


asyncio.run(main())

JavaScript SDK

Official package
Install
npm install seeknetic

Install ffmpeg first, and ensure ffmpeg/ffprobe are on PATH.

Quick Start

Installation plus the README’s minimal text embedding example.

Install from npm

bash
npm install seeknetic

Text embedding

javascript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const response = await client.videoEmbedding.encodeText({
  text: 'a person walking on the beach',
});

console.log(response.embedding.length);

Local Source Video Workflows

Recommended for local files. Install ffmpeg before using preprocessAndUpload(...).

Your original video stays local. This workflow uploads only the preprocessed tensors. service: "embedding" only works with videoEmbedding.encodeVideo.submitAsync(...); service: "tagging" only works with videoTagging.submitAsyncJob(...).

Embedding · Step 1 · Preprocess and upload

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const upload = await client.preprocessAndUpload({
  videoPath: 'sample.mp4',
  service: 'embedding',
  requestId: 'emb-task-0001',
  startMs: 0,
  endMs: 10_000,
});

console.log(upload.request_id);
console.log(upload.r2_keys);

Embedding · Step 2 · Submit async job

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const upload = await client.preprocessAndUpload({
  videoPath: 'sample.mp4',
  service: 'embedding',
  requestId: 'emb-task-0001',
});

const job = await client.videoEmbedding.encodeVideo.submitAsync({
  tensor: {
    video_input_key: upload.r2_keys['video_input'],
    audio_input_key: upload.r2_keys['audio_input'],
  },
  request_id: upload.request_id,
});

console.log(job.request_id, job.status);

Embedding · Step 3 · Poll result

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const status = await client.asyncStatus.retrieve('emb-task-0001');

console.log(status.status);
console.log(status.embedding);

Tagging · Step 1 · Preprocess and upload

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const upload = await client.preprocessAndUpload({
  videoPath: 'sample.mp4',
  service: 'tagging',
  requestId: 'tag-task-0001',
  startMs: 0,
  endMs: 10_000,
});

console.log(upload.request_id);
console.log(upload.r2_keys);

Tagging · Step 2 · Submit async job

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const upload = await client.preprocessAndUpload({
  videoPath: 'sample.mp4',
  service: 'tagging',
  requestId: 'tag-task-0001',
});

const job = await client.videoTagging.submitAsyncJob({
  tensor: {
    video_input_key: upload.r2_keys['video_input'],
    video_kwargs_key: upload.r2_keys['video_kwargs'],
  },
  request_id: upload.request_id,
});

console.log(job.request_id, job.status);

Tagging · Step 3 · Poll result

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const status = await client.asyncStatus.retrieve('tag-task-0001');

console.log(status.status);
console.log(status.tags);

Uploaded or Hosted Video Workflows

Submit video_url directly when you do not need local preprocessing.

Embedding · Step 1 · Submit video_url

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const job = await client.videoEmbedding.encodeVideo.submitAsync({
  video_url: 'https://example.com/video.mp4',
});

console.log(job.request_id, job.status);

Embedding · Step 2 · Poll result

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const status = await client.asyncStatus.retrieve('emb-task-0001');

console.log(status.status);
console.log(status.embedding);

Tagging · Step 1 · Submit video_url

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const job = await client.videoTagging.submitAsyncJob({
  video_url: 'https://example.com/video.mp4',
});

console.log(job.request_id, job.status);

Tagging · Step 2 · Poll result

typescript
import Seeknetic from 'seeknetic';

const client = new Seeknetic({
  apiKey: process.env['SEEKNETIC_API_KEY'],
});

const status = await client.asyncStatus.retrieve('tag-task-0001');

console.log(status.status);
console.log(status.tags);