ntt.videos package#
Submodules#
ntt.videos.compress module#
ntt.videos.create_clip module#
ntt.videos.dimensions module#
ntt.videos.display module#
- ntt.videos.display.display_frames_as_video(frames: list) None#
- ntt.videos.display.display_video(video)#
ntt.videos.duration module#
ntt.videos.exif module#
Technical metadata extraction for videos.
Two backends with the same interface so they can be used interchangeably:
extract_metadata_opencv– uses cv2.VideoCapture (no subprocess).extract_metadata_ffprobe– uses ffmpeg-python (already a project dependency).
Both functions:
- Accept a video file path.
- Return a dict with consistent keys:
width,height,fps,frame_count,duration_s,codec.
Raise
FileNotFoundErrorif the file does not exist.
- ntt.videos.exif.extract_metadata_ffprobe(video_path: str) dict#
Extract technical metadata from a video using ffprobe (via ffmpeg-python).
- Parameters:
video_path (str) – Path to the video file.
- Returns:
- Keys:
width,height,fps,frame_count, duration_s,codec.
- Keys:
- Return type:
dict
- Raises:
FileNotFoundError – If the file does not exist.
- ntt.videos.exif.extract_metadata_opencv(video_path: str) dict#
Extract technical metadata from a video using OpenCV.
- Parameters:
video_path (str) – Path to the video file.
- Returns:
- Keys:
width,height,fps,frame_count, duration_s,codec.
- Keys:
- Return type:
dict
- Raises:
FileNotFoundError – If the file does not exist.
ntt.videos.get_fourcc module#
- ntt.videos.get_fourcc.get_fourcc(cap: VideoCapture) str#
Return the 4-letter string of the codec the camera is using.
ntt.videos.io module#
- ntt.videos.io.read(video_path: str) list#
- ntt.videos.io.write(video_path: str, frames: list) None#
ntt.videos.peak module#
- ntt.videos.peak.detect_peak_in_video(file_path)#
- ntt.videos.peak.detect_peak_video(input_path, video_name_in, output_path, video_name_out, xa, xb, ya, yb, seuil=200, frame_begin=0, frame_end=-1, nb_frame=-1, afficher_anime=True, afficher_hist=True, write_video=True)#
ntt.videos.shake_video module#
ntt.videos.show module#
- ntt.videos.show.show_video(video_path, window_name='Video')#
Show a video in a window
- Parameters:
video_path (_type_) – _description_
ntt.videos.split_video module#
ntt.videos.stich module#
- ntt.videos.stich.stitch_2_videos(video_path_in, video_name_in1, video_name_in2, video_path_out, video_name_out, time_difference, src_pts1, dest_pts1, src_pts2, dest_pts2)#
stitches video1 and video2 based on the source and destination points
ntt.videos.video_generation module#
- ntt.videos.video_generation.generate_peak_video(file_path, width, height, fps, duration)#
- ntt.videos.video_generation.generate_video_numbers(t=5, fps=25, size=(800, 600), out_path='myvideo.mp4')#
- ntt.videos.video_generation.random_video(width: int = 640, height: int = 480, fps: int = 30, duration: int = 1) list#