pyflink.multimodal.operators.video_explode_frames#
- video_explode_frames(*columns, frame_selector='all_frames', sample_interval_ms=None, max_frames=None, image_height=None, image_width=None, on_error='raise', container_options=None, read_chunk_size=None, max_cached_blocks=None, read_ahead_blocks=None, concurrency=None)[source]#
Expand selected video frames into one output row per frame.
Use the returned UDTF with
Table.join_lateral/flat_map. URI inputs read the full video; segment refs only emit frames withinstart_time_msandend_time_ms.- Parameters
*columns – Optional URI or segment column. When provided, the UDTF is applied directly instead of returning a factory.
frame_selector – Frame selection mode,
"all_frames"(default),"keyframe", or"sample".sample_interval_ms – Sampling interval for
frame_selector="sample".max_frames – Optional safety limit for emitted frames per input row.
Noneemits all selected frames.image_height – Optional output frame height in pixels. Must be provided together with
image_width. When set, PyAV resizes each decoded frame during materialization before it becomes anIMAGEvalue.image_width – Optional output frame width in pixels. Must be provided together with
image_height.on_error – Error handling policy.
"raise"(default) propagates failures;"skip"emits no rows for inputs that fail before the first frame and preserves rows already emitted before a later decode error.container_options – Optional PyAV
av.openoptions.read_chunk_size – Optional Java-backed file read chunk size in bytes. 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
A UDTF producing two columns –
IMAGEandVIDEO_FRAME_METADATA.
- Example::
>>> frames = table.join_lateral( ... video_explode_frames()( ... col("uri")).alias("frame", "metadata"))