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"returnsNonefor unreadable inputs.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 – UDF concurrency.
Noneuses 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_nameis the PyAV/FFmpeg codec short name, such as"h264"or"hevc"; it is included for decode compatibility and performance diagnostics.video_stream_indexidentifies 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")))