Skip to main content

Explanation of the Short-Form Video Auto-Generation Pipeline_1

Introduction​


To automatically generate short-form clips from a TV drama, the video must first be broken down into segments based on when, who, what was said, and what is visible on screen. Part 1 of this series covers the process of creating that source material. Part 2 covers the process of organizing the clips by adding speaker names, event units (sequences), scenes, and queries.

The process in Part 1 can be summarized as follows:

  1. Extracting audio and video
  2. Transcribe the audio as dialogue
  3. Refine the dialogue (search the cast list · second transcription · proofreading · hallucination filter · summarization)
  4. Identifying points where the footage changes (cut segmentation)
  5. Classifying footage by cut (cut classification)

image

The audio and video tracks are handled by separate services. Once the audio track is complete, the video track automatically begins.

There is a single language model: Qwen3.8-27B. One instance is run as a vLLM on each of three GPUs, and these are used together for refining dialogue and cut detection. The frame images used for cut detection are passed via file path, and the inference server reads them directly from its own disk.


1. Extracting Audio and Video​

  • Decode the original source only once to simultaneously generate a single audio file (16 kHz, single channel) and one frame per second (1280×720). Decoding and downsampling are performed on the GPU.
  • The frame file number corresponds directly to the second. Frame 123 represents the video at the 123-second mark. Subsequent steps locate the “video at a specific second” directly by its number.
  • Subsequent steps do not reopen the original file. If the original remains unchanged and the output is already available, skip this step.

2. Transcribing Audio as Dialogue​

  • First, identify the speakers, then group speaking segments into windows of approximately 30 seconds each and transcribe each window using Qwen3-ASR. Attach timestamps to each word, then split the text at speaker transitions and punctuation marks to create individual lines of dialogue.
  • This process is covered in detail in “Voice Analysis and Processing Steps and Results.”
  • The result is a list of lines of dialogue tagged with timestamps, speakers, languages, and dialogue content. At this stage, speakers are still identified only by numbers, such as “Speaker 1” or “Speaker 2.” Assigning character names to these numbers will be covered in Part 2.

3. Refining the Dialogue​

The first transcription often contains errors involving people’s names and words with similar pronunciations. The process of correcting the transcribed text follows the order below.

image

The order cannot be changed because it follows the direction of the data flow. Names extracted from the list serve as hints for the second transcription; the results of the second transcription serve as a reference during proofreading; and the summary only considers lines that have passed through the hallucination filter.

These steps are enabled or disabled depending on the genre. For dramas, all steps are enabled. For documentaries and news, the list search and second dictation are disabled; for sports, the summary is disabled. The sequence remains the same across all genres; the only difference is which steps are enabled and what source material is provided.

3-1. Character List Search

  • Search the web for character lists using the title and year. The model generates four search terms that narrow the scope to Namu Wiki and Wikipedia, retrieves one article for each term, and then extracts only the character lists from those articles.
  • The search is completed much faster than the dictation. Therefore, keep it running alongside the dictation and merge the results just before the second dictation begins. This eliminates any waiting time.
  • If the search fails, proceed without the list.

3-2. Second Dictation

  • Use faster-whisper to transcribe certain segments one more time. Do not alter the initial transcript; use this solely as a second opinion for comparison during proofreading.
  • Do not send segments shorter than 3 seconds, containing fewer than 12 characters, or where Korean makes up less than half of the text. If you send short interjections or foreign language segments, the model will invent words that aren’t there.
  • Provide the names from the list as hints. If the names are correct, the surrounding text will also be more accurate.
  • If this fails, proofread without the second opinion.

3-3. Proofreading

  • Divide the dialogue into 30-line segments and send them to the model simultaneously. Do not provide the model with timestamps or speaker information; only provide line numbers and the dialogue text. Ensure the number of lines and their order are preserved exactly, and reassign the returned lines to their original timestamps and speakers based on their numbers.
  • The proofreading instructions are as follows: The first round of dialogue focuses on content accuracy, while the second round focuses on expressive accuracy. People’s names must follow the list’s notation, and technical terms must follow the glossary.
  • If a batch of 30 lines fails (if the response is corrupted or the line numbers do not match), leave the source text as is for that batch. Since not a single line of subtitles can be omitted, the source text must be preserved even if proofreading fails.

3-4. Hallucination Filter

  • Sometimes the transcription model mistakenly transcribes bird sounds or background noise as a foreign language. Only lines in a language other than the primary language are selected as candidates, and the model determines one of three options based on the surrounding context.

    • Genuine foreign-language speech (interviews, song lyrics, commercials): Keep

    • Fake speech generated by noise: Delete

    • Korean where only the language identification is incorrect: Do not delete; just correct the language

  • Deleted lines are not saved and are not included in the summary.

3-5. 1-Minute Summary

  • Divide the dialogue into 1-minute segments, and summarize the plot of each segment in one or two sentences. These summaries form the episode’s plot timeline and serve as the basis for dividing the episode into events in Part 2.
  • Divide the segments into 8 groups; play the groups simultaneously, but play the segments within each group in order. Within a group, advance the previous summary along with the current segment to maintain continuity. Since the first segment in a group has no preceding summary, use the original dialogue from the preceding segments to provide context.
  • Grouping multiple panels together in a single query was faster, but it caused the content of different panels to mix and resulted in empty summaries. Therefore, we limited each query to a single panel and only increased the number of concurrent storylines.
  • At the end, we generate a single summary covering the entire episode.

4. Cut Segmentation​

  • Identify points where the screen changes. No model is used. PySceneDetect identifies cut boundaries where color changes between adjacent screens exceed a certain threshold.

  • After detection, three adjustments are made.

    • Fragments shorter than 1 second are merged with neighboring ones.

    • Fragments longer than 15 seconds are divided evenly. This serves as a safety measure in case gradual transitions (fades, dissolves) are missed.

    • Boundaries are adjusted in 0.1-second increments.

  • Each cut is assigned a number based on the start time rounded up to the nearest second. Since this number matches the frame number extracted in Step 1, the corresponding scene can be located immediately.

  • A single 62-minute episode yielded 1,184 cuts. Each cut averages just over 3 seconds.

image

5. Cut Determination​

  • The model is called once for each cut. This amounts to around 1,200 times per episode. All cuts are loaded at once, and only the number sent simultaneously is limited.
  • Each model contains 1–3 frames from the cut, along with the dialogue overlapping that cut. For cuts under 3 seconds, all frames are included; for longer cuts, 3 frames—beginning, middle, and end—are included.
  • For each cut, the model provides a one-line description and the scene type. There are nine types: dialogue, close-up of a face, action, location overview, graphics, recap, preview of the next episode, commercial, and other.

image

Input and responses are handled as follows.

  • Common information for each episode is provided once at the beginning. The scoring rules, along with the characters and synopsis for each episode, are placed at the beginning—a section used identically for all cuts within that episode. The only elements that vary from cut to cut are the time, dialogue, and screen type that follow.
  • Place text before the visuals. Present the time and dialogue for each panel first, followed by the visuals. When text was placed after the visuals, participants tended to base their answers solely on the final panel.
  • Visuals first, dialogue second. The instructions explicitly stated that participants should not invent details not shown in the visuals while reading the dialogue.
  • Accept only lines labeled with category names. Read responses as the names of the category lines, such as “Description” or “Type.” Even if the type name is mixed into the description sentence, the system will not misread the type.
  • Leave failed cuts blank. The next time the script runs, it will select only the cuts with empty evaluations and re-evaluate them.

Cut evaluations also include “Location” and “Character” fields. These two, along with the speaker’s name and sequence, will be covered in Part 2.


Conclusion​

After completing the process in Part 1, each episode is broken down into three components.

  • Dialogue: One line of dialogue per time stamp, speaker number, and language
  • Plot Timeline: Summaries in one-minute increments and a summary of the entire episode
  • Cut List: Cuts labeled with timestamps, shot types, and one-line descriptions

Two of these elements are still missing for use as short-form content. Speakers are identified only by numbers, and cuts—averaging just over 3 seconds each—are too fragmented. In Part 2, we’ll assign character names to speaker numbers, divide episodes into story arcs, group cuts into scenes within those arcs, and cover the process of selecting clips based on specific queries.

Reference link)

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