[PR #2421] [CLOSED] Video: the encoder reads the clip itself (ENCV - mtmd samples its frames at video_fps and merges them) #4035

Closed
opened 2026-11-07 15:32:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2421
Author: @miaomiaozii
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: video-native


📝 Commits (6)

  • 636ec11 Video: cut a clip into its frames (ffmpeg) for the vision path
  • 0d954a5 Video: read the clip in the encoder (ENCV - mtmd samples its frames at video_fps and merges them; one media place per clip)
  • c4fd8bd Video: the encoder reads the clip itself (docstring in the frontend's part list)
  • 44c90f6 test_server: the #2228 Keyed fake keeps the encoder's keep parameter, as the real Vision.encode does
  • c8e0c83 Responses: the video parts ride the same path as the images
  • caaa8d3 Video: consume the template's video pad placeholder in prepare()

📊 Changes

8 files changed (+575 additions, -74 deletions)

View changed files

📝 docs/DETAILS.md (+17 -1)
📝 serve/frontend.py (+47 -9)
📝 serve/responses.py (+8 -2)
📝 serve/server.py (+110 -24)
📝 serve/test_responses.py (+22 -0)
📝 serve/test_server.py (+12 -8)
➕ serve/test_video.py (+283 -0)
📝 tools/vision/strata_vision.cpp (+76 -30)

📄 Description

The serve reads video video_url parts (OpenAI chat-completions) natively: the vision encoder samples the clip's frames itself (mtmd at video_fps, capped by max_video_frames) and encodes them merged the model's way, so the clip takes one media place in the prompt - its start marker plus the image tokens its frames expand to.

Commits:

  • cut a clip into its frames (ffmpeg) for the vision path
  • read the clip in the encoder (ENCV - mtmd samples its frames at video_fps and merges them; one media place per clip)
  • the encoder reads the clip itself (docstring in the frontend's part list)
  • test_server: the #2228 Keyed fake keeps the encoder's keep parameter, as the real Vision.encode does

Notes:

  • rebased on main (296b59d2); conflicts in prepare() resolved keeping the upstream embeddings.keys/_vision_up()/last_image_at plumbing around the ENCV loop
  • full test suite: 1275 pass
  • e2e on a 6.1s 1920x996 clip: prompt 1349 -> 7813 tokens, reply describes the clip correctly; image path unaffected (1420 tokens)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2421 **Author:** [@miaomiaozii](https://github.com/miaomiaozii) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `video-native` --- ### 📝 Commits (6) - [`636ec11`](https://github.com/Niko1221/Strata/commit/636ec11f64c794237917194c46f9de354e67b6bf) Video: cut a clip into its frames (ffmpeg) for the vision path - [`0d954a5`](https://github.com/Niko1221/Strata/commit/0d954a5c83a552d3f331c4bf5f573ca6b5e2ad6a) Video: read the clip in the encoder (ENCV - mtmd samples its frames at video_fps and merges them; one media place per clip) - [`c4fd8bd`](https://github.com/Niko1221/Strata/commit/c4fd8bdd5cf42ee3d723059bc2b81752a8f45acc) Video: the encoder reads the clip itself (docstring in the frontend's part list) - [`44c90f6`](https://github.com/Niko1221/Strata/commit/44c90f6cd88f780c613a5437027e7bc3f6ff7c2b) test_server: the #2228 Keyed fake keeps the encoder's keep parameter, as the real Vision.encode does - [`c8e0c83`](https://github.com/Niko1221/Strata/commit/c8e0c83972e1fe739fcf8ffa48c446dc46694483) Responses: the video parts ride the same path as the images - [`caaa8d3`](https://github.com/Niko1221/Strata/commit/caaa8d3a52cbcc60cf937715096e29323a606cf5) Video: consume the template's video pad placeholder in prepare() ### 📊 Changes **8 files changed** (+575 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+17 -1) 📝 `serve/frontend.py` (+47 -9) 📝 `serve/responses.py` (+8 -2) 📝 `serve/server.py` (+110 -24) 📝 `serve/test_responses.py` (+22 -0) 📝 `serve/test_server.py` (+12 -8) ➕ `serve/test_video.py` (+283 -0) 📝 `tools/vision/strata_vision.cpp` (+76 -30) </details> ### 📄 Description The serve reads video `video_url` parts (OpenAI chat-completions) natively: the vision encoder samples the clip's frames itself (mtmd at `video_fps`, capped by `max_video_frames`) and encodes them merged the model's way, so the clip takes one media place in the prompt - its start marker plus the image tokens its frames expand to. Commits: - cut a clip into its frames (ffmpeg) for the vision path - read the clip in the encoder (ENCV - mtmd samples its frames at video_fps and merges them; one media place per clip) - the encoder reads the clip itself (docstring in the frontend's part list) - test_server: the #2228 Keyed fake keeps the encoder's keep parameter, as the real Vision.encode does Notes: - rebased on main (296b59d2); conflicts in prepare() resolved keeping the upstream `embeddings.keys`/`_vision_up()`/`last_image_at` plumbing around the ENCV loop - full test suite: 1275 pass - e2e on a 6.1s 1920x996 clip: prompt 1349 -> 7813 tokens, reply describes the clip correctly; image path unaffected (1420 tokens) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4035
No description provided.