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_extract_frames#

video_extract_frames(*columns, frame_selector='keyframe', sample_interval_ms=None, max_frames=None, on_error='raise', container_options=None, read_chunk_size=None, max_cached_blocks=None, read_ahead_blocks=None, concurrency=None)[source]#

Extract selected frames as an array on the same output row.

This scalar UDF is useful when downstream logic expects all selected frames from one video together. For streaming one frame per row, prefer video_explode_frames.

Parameters
  • *columns – Optional URI or segment column. When provided, the UDF is applied directly instead of returning a factory.

  • frame_selector – Frame selection mode, "keyframe", "sample", or "all_frames".

  • sample_interval_ms – Sampling interval for frame_selector="sample".

  • max_frames – Optional safety limit for frames retained in memory. None retains all selected frames.

  • on_error – Error handling policy. "raise" propagates failures; "null" returns None for unreadable inputs.

  • 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 – UDF concurrency. None uses the framework default.

Returns

A scalar UDF producing ARRAY<IMAGE>. The selected frames are retained in memory on the same output row.

Example::
>>> df = df.with_column(
...     "keyframes", video_extract_frames(col("uri")))

previous

pyflink.multimodal.operators.video_explode_frames

next

pyflink.multimodal.codec.open_video_container

Show Source

Created using Sphinx 4.5.0.