Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
  • PyFlink Multimodal
    • Image
    • Video
    • Utilities
  • PyFlink DataStream
  • PyFlink Common

pyflink.multimodal.operators.video_split#

video_split(*columns, segment_duration_ms=None, num_segments=None, video_duration_ms=None, max_segments=1024, on_error='raise', container_options=None, read_chunk_size=None, max_cached_blocks=None, read_ahead_blocks=None, concurrency=None)[source]#

Split a video URI or segment ref into metadata-only segment refs.

For full-video URI inputs, the operator probes video metadata when no metadata row, duration_ms value, explicit video_duration_ms, or segment end_time_ms is provided. Passing metadata from video_metadata keeps this as a metadata-only split and avoids the extra probe.

Parameters
  • *columns – Optional uri/VIDEO_STRUCT column, plus an optional video metadata row or duration_ms value. When provided, the UDTF is applied directly instead of returning a factory.

  • segment_duration_ms – Fixed segment duration in milliseconds. Use this when each output segment should cover the same time window, such as one segment per second. Exactly one of segment_duration_ms or num_segments is required.

  • num_segments – Target number of approximately equal segments. Use this when each input should produce a bounded number of segments regardless of duration. Exactly one of segment_duration_ms or num_segments is required.

  • video_duration_ms – Optional constant duration fallback in milliseconds.

  • max_segments – Safety limit for emitted segments per input row.

  • on_error – Error handling policy. "raise" propagates failures; "null" drops unreadable inputs.

  • container_options – Optional PyAV av.open options used only when this operator probes metadata itself.

  • read_chunk_size – Optional Java-backed file read chunk size in bytes used only when this operator probes metadata itself. Must not exceed the 16 MiB Java bridge read range limit.

  • max_cached_blocks – Optional per-file cache block count. 0 disables block caching.

  • read_ahead_blocks – Optional number of blocks to prefetch after a cache miss. 0 disables read-ahead.

  • concurrency – Optional UDTF operator parallelism.

Returns

ROW<uri STRING, start_time_ms BIGINT, end_time_ms BIGINT>.

Return type

A UDTF producing one VIDEO_STRUCT column

Example::
>>> segments = table.join_lateral(
...     video_split(segment_duration_ms=1000)(
...         col("uri")).alias("segment"))

previous

pyflink.multimodal.operators.video_metadata

next

pyflink.multimodal.operators.video_explode_frames

Show Source

Created using Sphinx 4.5.0.