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

video_metadata(*columns, on_error='raise', container_options=None, read_chunk_size=None, max_cached_blocks=None, read_ahead_blocks=None, concurrency=None)[source]#

Probe lightweight video metadata from a URI/path.

The operator opens the video container through the Java-backed FileSystem bridge and reads header metadata. It does not decode frames.

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

  • 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

ROW<width INT, height INT, fps DOUBLE, duration_ms BIGINT, frame_count BIGINT, time_base DOUBLE, codec_name STRING, video_stream_index INT>. codec_name is the PyAV/FFmpeg codec short name, such as "h264" or "hevc"; it is included for decode compatibility and performance diagnostics. video_stream_index identifies the selected video stream within containers that also carry audio or multiple video streams. The metadata is not expanded into separate columns.

Return type

A scalar UDF producing one struct column

Example::
>>> df = df.with_column("video_meta", video_metadata(col("uri")))

previous

Video

next

pyflink.multimodal.operators.video_split

Show Source

Created using Sphinx 4.5.0.