# Non-existent file -> None (ffprobe fails, swallowed)
assert get_media_duration(Path("/nonexistent/file.mp3")) is None
print("probe OK")Media Probing
Probe media files for metadata (duration, …) via ffprobe.
get_media_duration
def get_media_duration(
file_path:Path, # Path to the media file
)->Optional: # Duration in seconds, or None if it cannot be determined
Get the duration of a media file (seconds) via ffprobe.