Video splitting

Updated at:

The video splitting operator splits a video into multiple segments based on fixed duration, scene changes, or dialogue turns. This topic describes how to configure the video splitting operator.

Prerequisites

  • To use the workflow feature, you must first purchase the unstructured data feature for your instance.

  • You have created a workflow. For more information, see Create and manage workflows.

Permissions

In a Basic project, project administrators, developers, analysts, and custom project roles with the dataset-use permission can use all datasets in the project as input and output datasets for the operator.

Supported file formats

The video splitting operator supports the following file formats: mp4, mov, mkv, avi, flv, wmv, webm, mpeg, mpg, ts, m2ts, mts, 3gp, 3g2, asf, rm, rmvb, vob, ogv, dv, f4v, mxf, nut, y4m, m4v, mpv, and mjpeg.

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Development > Data Development.

  2. In the top navigation bar of the Development page, select a project.

  3. In the left-side navigation pane, choose Data Processing > Workflow. In the Workflow list, click the target workflow to open its canvas. From the operator library on the left, drag the video splitting operator to the canvas. In the video splitting panel on the right, configure the following parameters.

    Parameter

    Description

    Step name

    Enter a name for the operator. The name can contain any characters and must be up to 256 characters long.

    Input configuration

    Dataset

    Select the dataset to process. You can select only a hybrid dataset. After you select a dataset, you must also select its version. By default, the first version in ascending order is selected.

    If the operator is connected to an upstream operator, its input dataset is typically the output dataset from the preceding operator.

    Input field

    The storage URL of the video file to process. Select a source field from the input dataset. You can only select fields where the Is URL parameter is set to Yes.

    Filter condition (Optional)

    Use SQL syntax. Enter only the conditions that follow the WHERE clause. You can use global system variables, such as the business date ${bizdate}.

    Operator configuration

    Splitting method

    • Split by fixed duration: Splits the video evenly into multiple segments based on the specified segment duration. The last segment might be shorter than the specified duration.

    • Split by scene: This method uses the PySceneDetect library to automatically detect shot changes in the video, such as abrupt cuts or transitions, and splits the video at scene boundaries. This method is suitable for content with clear shot changes, such as movie clips, meeting recordings, and educational videos.

      If you select this method, you must also configure the detection sensitivity and minimum segment duration.

    • Split by dialogue: This method first extracts the audio from the video and then uses a speech recognition model to detect the start and end times of human speech. It splits the video by dialogue turns and distinguishes between speaking and non-speaking segments. This method is suitable for dialogue-heavy videos such as meetings, interviews, and customer service calls. Background music and ambient noise do not affect the detection.

      If you select this method, you must also configure the model, minimum dialogue segment duration, and output method.

    Segment duration

    If you select split by fixed duration, specify the segment duration in seconds. Enter a positive integer.

    Detection sensitivity

    The threshold for detecting a shot change. A lower value increases sensitivity, resulting in more detected split points. A higher value is more conservative and detects only significant shot changes. The default value is 27.

    For fast-paced videos, use a value from 20 to 25. For typical videos, use the default value of 27. For videos with long takes, use a value from 30 to 40.

    Note

    This parameter is available only when the splitting method is set to split by scene.

    Minimum segment duration

    The minimum duration for each segment after splitting. The unit is seconds, and the default value is 5. Segments shorter than this duration are merged with an adjacent segment to prevent overly short and fragmented clips.

    Note

    This parameter is available only when the splitting method is set to split by scene.

    Model

    Select an enabled model of the Audio (voice activity detection (VAD)) type from Intelligent Application Management > Model Configuration.

    Note
    • This parameter is available only when the splitting method is set to split by dialogue.

    • For information about the pricing factors of system models, see Built-in models for intelligent applications.

    • If you have purchased an advanced license package for custom models, no credits are deducted. Otherwise, you are charged at a rate of 0.2x.

    Minimum dialogue segment duration

    The minimum duration for a single dialogue segment. The unit is seconds, and the default value is 5. Segments shorter than this duration are merged with adjacent segments to create a continuous segment, preventing fragmented clips that lack context.

    Note

    This parameter is available only when the splitting method is set to split by dialogue.

    Output method

    • Speaking segments only: Outputs only the segments that contain speech. This is the default setting and can significantly reduce the number of segments and storage usage.

    • All: Outputs all segments, including those without speech.

    Note

    This parameter is available only when the splitting method is set to split by dialogue.

    Output configuration

    Dataset

    Select a hybrid dataset and version for the output. You can use other versions of the source dataset. By default, the first version in ascending order is selected.

    Segment file directory

    The path prefix is the storage directory of the selected dataset. You can specify a subdirectory for storage. Output segments from each source video are stored in a dedicated subdirectory.

    Load policy

    If the metadata table of the selected output dataset contains a primary key, the default option is to update on primary key conflict. If no primary key exists, the default option is to append data.

    • Append data: Appends new data directly to the target table. A primary key or constraint conflict causes an error.

    • Update on primary key conflict: If a primary key or constraint conflict occurs, the system deletes the existing row with the same primary key and inserts the new row.

    • Overwrite: Deletes all existing data in the target table before writing the new data.

    Field mapping

    The video splitting operator always outputs the following fields:

    • source_video_url: The storage URL of the original video.

    • segment_sequence: The sequence number of the segment.

    • segment_video_path: The storage URL of the video segment.

    • video_id: The unique ID of the video segment file, used for unique identification by downstream operators.

    • start_time: The start time of the segment within the original video, in seconds.

    • end_time: The end time of the segment within the original video, in seconds.

    In real-time and online workflows, the video splitting operator produces multiple video segments from a single input event (a 1:N output pattern). The results are returned in a video_segments array. You can use this array as the iteration source for a ForEach loop operator, allowing downstream operators to process each video segment individually. The default iteration variable for the ForEach loop operator is video_segment.

    By default, the output fields of the operator are mapped to fields with the same names in the output dataset. You can also manually select target fields for custom mapping. You can also map passthrough fields from the source dataset to the target dataset. Use the following options to manage field mapping:

    • Add output field: Click to add a new, empty field mapping row.

    • Batch map: Click to choose between batch manual mapping, same-name mapping, or same-row mapping.

    • Delete mapping: Click the Delete icon to remove the corresponding field mapping row. You cannot delete mappings for the fixed output fields of the operator.

  4. After you complete the configuration, click Save in the top menu bar of the canvas.

    After you configure the operator, you can continue to build the workflow by connecting it to upstream or downstream operators.