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 segmentend_time_msis provided. Passing metadata fromvideo_metadatakeeps this as a metadata-only split and avoids the extra probe.- Parameters
*columns – Optional
uri/VIDEO_STRUCTcolumn, 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_msornum_segmentsis 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_msornum_segmentsis 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.openoptions 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.
0disables block caching.read_ahead_blocks – Optional number of blocks to prefetch after a cache miss.
0disables 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"))