Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

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

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 within start_time_ms and end_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. None emits 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 an IMAGE value.

  • 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.open options.

  • 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. 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

A UDTF producing two columns – IMAGE and VIDEO_FRAME_METADATA.

Example::
>>> frames = table.join_lateral(
...     video_explode_frames()(
...         col("uri")).alias("frame", "metadata"))

previous

pyflink.multimodal.operators.video_split

next

pyflink.multimodal.operators.video_extract_frames

Show Source

Created using Sphinx 4.5.0.