Skip to main content

09_DB Schema Release

· 6 min read
sbin
SceneMakerAI 팀

Introduction


SceneMaker is releasing the data structure it uses to analyze and store broadcast video data. — Must

include a link to the GitHub

DB schema — The storage formats include structured and unstructured data. The databases used in this project are as follows.

MariaDB (relational)Milvus (VectorDB)
ContentStructured data. AI results in a readable format (subtitles, summaries, people, emotions)Unstructured data. text’s embedding vectors + metadata for search
RoleOriginal Truth (Single Source of Truth)Derived Version for Search

Overall Data Storage Flow


We use MySQL and Milvus as data storage systems, and data is stored according to the flow shown below.

![image](/img/blog/09-db-스키마-공개/img-00.png

)

Relational tables are connected via v_id, centered around t_video.

t_video ─┬─ t_dialogue / t_dialogue_refine (Dialogue)
├─ t_segment / t_segment_refine (6-second screen analysis)
├─ t_chapter (Scene/Sub)
├─ t_scene (Scene by Event)
├─ t_category (Category, Self-Referencing Hierarchy)
└─ t_code (status code)

Let’s take a look at the structure of each database.

1. MariaDB Tables


![image](/img/blog/09-db-스키마-공개/img-01.png

)

t_video — Video (Central Table)

Contains the metadata and final summary for a single video.

ColumnTypeDescription
v_idmediumintPK, Video ID
p_v_idmediumintSeries relationship (e.g., Season 2 → Season 1 reference)
cate_idsmallintFK → t_category
namevarchar(45)Video Title
dirvarchar(200)Video Storage Location
summary / summary_stttextFull Synopsis / STT Stage Summary
casttextCharacters mentioned by STT
status_codesmallintFK → t_code, Processing Status
reg/upd_datetimedatetimeDate and Time of Entry/Update

t_category — Category (self-referencing hierarchy)

p_cate_id points to the parent category, creating a hierarchy such as "Sports → Baseball."

ColumnDescription
cate_id (PK) / cate_nameCategory ID / Name
p_cate_idParent Category

t_dialogue — Dialogue (Subtitles)

STT results. These are chronological dialogue entries where (v_id, idx) is the PK.

ColumnTypeDescription
v_id, idxPK, Video/Dialogue Order
start_time / end_timetime(1)Speech Interval
speaker / speaker_namechar(4) / varcharSpeaker label / Corrected real name
langcharSpeech language
dialoguevarchar(500)Dialogue text

t_dialogue_refine is a revised version with corrected character names; the schema is nearly identical.

t_segment — 6-second video analysis (search unit)

Results of video analysis divided into 6-second segments. This is the smallest unit for search.

ColumnTypeDescription
v_id, seg_idPK
start_time / end_timetime6-second interval
summaryvarchar(1024)Frame content summary
advtinyintWhether advertisement is included
metaJSONStructural attributes by category (Sports = Score/Inning…)
status_code / status_reasonProcessing Status

t_segment_refine is a corrected version with the cast · ocr · sound · action (JSON) field added. (agent-vision output)

t_chapter — Scene / Sub (Hierarchical Summary)

level distinguishes between scenes (2) and subs/acts (1), and parent_chap_id links scenes to subs.

ColumnDescription
v_id, chap_id (PK)
level1=Sub (Act) / 2=Scene
parent_chap_idSub to which the scene belongs
start/end_time, start/end_segTime/Segment Range
title / summaryLabel / Plot (Embedding Target)
cast / keywords / emotionCharacters / Keywords / Emotions
metaExtended JSON

t_scene — Event-level scene

Event-level data by genre (e.g., sports = home runs, strikeouts, etc.). Contains structural attributes in JSON format for search filters.

ColumnDescription
v_id, scene_id (PK)
scene_type / descriptionEvent Type / Description (Embedding Target)
is_replay / is_adReplay/Ad Exclusion Flags
attributesJSON (Sports = Pitcher/Batter/Inning/Score…)

In addition, there are legacy tables such as t_play (baseball-specific, replaced by t_scene) and t_segment_2 (for experimental use).


2. Milvus Collection — sm_1024

A vector collection that embeds search targets (subtitles, screens, scenes, subtitles) from>

relational data. Since this is semantic search, unstructured data was used.

One row = vector + meta copy for search.

FieldTypeDescription
pkVARCHAR(64)PK, "v_id:ref_type:ref_id"
vectorFLOAT_VECTOR(1024)Embedding vector (unique vector value)
v_idINT32Video ID (→ RDB)
ref_typeVARCHAR(16)segment / scene / chapter / dialogue
ref_idINT16seg_id / chap_id / idx in RDB
p_ref_idINT16Parent Scene (Parent Context)
start/end_sec, start/end_timeINT16 / VARCHARTime Range
castVARCHAR(500)Characters
textVARCHAR(2048)Embedded source text
dialogue / segment / sceneJSONOriginal snapshot
  • Index: vector → HNSW / Similarity: COSINE
  • Dynamic Field (enable_dynamic_field=True ): cate_id, emotion, highlight, events, is_ad

3. Linking the Two Repositories

Each vector in Milvus is linked 1:1 to a relational source row via pk = v_id : ref_type : ref_id.

Milvus "42:segment:120" ←→ RDB t_segment (v_id=42, seg_id=120)

ref_type indicates which table it is, while ref_id points to a part of that table’s primary key (seg_id /chap_id /idx).

4. Storage Order

Data is stacked along the pipeline in the following order: (small atom → derived → vector index)

OrderStorageResponsible
1t_video (shell)Registration
2t_dialogue · t_segmentagent-stt · agent-vision
3t_chapter · t_sceneagent-scenario
4t_video.summaryagent-scenario
5Milvus sm_1024 (vector index)agent-scenario

Once all relational storage is complete, the vector indexing is performed last.

Conclusion


The complete DDL and collection definitions are publicly available in the repository. SceneMaker is distributed under the Apache 2.0 license.

This article presents research results conducted with support from the Ministry of Science and ICT and the National IT Industry Promotion Agency under the “2026 Open Source AI and Software Development and Utilization Support Project.”