poseinterface.io.video_to_poseinterface#

poseinterface.io.video_to_poseinterface(input_video, output_video_dir, *, sub_id, ses_id, cam_id)[source]#

Reencode and rename a video to poseinterface format.

Copies the input video to output_video_dir with the filename sub-<sub_id>_ses-<ses_id>_cam-<cam_id>.mp4. If the video is not already encoded as H.264 + yuv420p in an .mp4 container, it is re-encoded with ffmpeg before saving.

Parameters:
  • input_video (Path | str) – Path to the video to convert.

  • output_video_dir (Path | str) – Directory where the converted video will be written (created automatically if it does not exist).

  • sub_id (str) – Subject ID used to build the output filename.

  • ses_id (str) – Session ID used to build the output filename.

  • cam_id (str) – Camera ID used to build the output filename.

Returns:

Path to the saved .mp4 file.

Return type:

Path

Raises:

RuntimeError – If ffmpeg is not available on the system PATH.