data_juicer.ops.mapper.video_undistort_mapper module#
- class data_juicer.ops.mapper.video_undistort_mapper.VideoUndistortMapper(*args, **kwargs)[source]#
Bases:
MapperUndistort raw videos with corresponding camera intrinsics and distortion coefficients.
- __init__(output_video_dir: str = None, undistorted_video_field: str = 'undistorted_video', camera_calibration_field: str = 'camera_calibration', batch_size_each_video: int = 1000, crf: int = 22, *args, **kwargs)[source]#
Initialization method.
- Parameters:
output_video_dir – Output directory to save undistorted videos.
undistorted_video_field – The field name to store the tags. It’s “undistorted_video” in default.
camera_calibration_field – The field name where the camera calibration info is stored.
batch_size_each_video – Number of frames to process and save per temporary TS file batch.
crf – Constant Rate Factor (CRF) for FFmpeg encoding quality.
args – extra args
kwargs – extra args
- concatenate_ts_files(folder, video_name, batch_counts)[source]#
Concatenate batch TS files into final mp4.