Misc
Miscellaneous functions.
process_video(source_path, target_path, callback, target_fps=1, codec='mp4v')
¶
Process a video frame-by-frame, applying a callback function to each frame and saving the results to a new video. This version includes a progress bar and allows codec selection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_path
|
str
|
Path to the source video file. |
required |
target_path
|
str
|
Path to save the processed video. |
required |
callback
|
Callable[[ndarray, int], ndarray]
|
A function that takes a video frame and its index as input and returns the processed frame. |
required |
codec
|
str
|
Codec used to encode the processed video. Default is "avc1". |
'mp4v'
|