file_path = 'Caleidoscopio.S01E02.WEBDL.ITA.HD.mkv.mp4' metadata = extract_metadata(file_path) for key, value in metadata.items(): print(f"{key}: {value}")
return metadata
metadata = { 'duration': probe['format']['duration'], 'resolution': f"{video_stream['width']}x{video_stream['height']}", 'video_codec': video_stream['codec_name'], 'audio_codec': audio_stream['codec_name'] if audio_stream else None, } Caleidoscopio.S01E02.WEBDL.ITA.HD.mkv.mp4
def extract_metadata(file_path): probe = ffmpeg.probe(file_path) video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None) audio_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'audio'), None) file_path = 'Caleidoscopio