Install from PyPI
pip install seeknetic 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.
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.
Run Shot Detection on a video to obtain each shot’s start and end times.
Pass each time range to the SDK’s local preprocessing workflow, then submit an embedding or tagging task.
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.
pip install seeknetic Install ffmpeg first, and ensure ffmpeg/ffprobe are on PATH.
Installation plus the first text embedding request.
pip install seeknetic Use the synchronous Python client for the first request, then move to async only if you need higher concurrency.
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)) 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(...).
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) 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) 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) 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) 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) 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) Submit video_url directly when you do not need local preprocessing.
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) 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) 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) 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) The README also documents aiohttp support for higher concurrency.
pip install seeknetic[aiohttp] 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()) npm install seeknetic Install ffmpeg first, and ensure ffmpeg/ffprobe are on PATH.
Installation plus the README’s minimal text embedding example.
npm install seeknetic 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); 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(...).
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); 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); 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); 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); 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); 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); Submit video_url directly when you do not need local preprocessing.
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); 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); 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); 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);