1234 Mkv Exclusive -
# Check if file exists if not os.path.exists(filepath): return {"error": f"File {filepath} not found"}
# Basic file info format_info = info['format'] print(f"š File: {filepath}") print(f"š Size: {int(format_info['size'])/1024/1024:.2f} MB") print(f"ā±ļø Duration: {float(format_info['duration']):.2f} seconds") print(f"š¬ Bitrate: {int(format_info['bit_rate'])/1000:.0f} kbps")
info = analyze_mkv(filepath)
print(f"ā Remuxed to {output}") # Install dependencies pip install pymediainfo Or use command line tools ffprobe -v quiet -print_format json -show_format -show_streams 1234.mkv mkvmerge -i 1234.mkv mediainfo 1234.mkv GUI Version (using tkinter) import tkinter as tk from tkinter import ttk, filedialog class MKVAnalyzer: def init (self): self.root = tk.Tk() self.root.title("MKV Analyzer - 1234.mkv")
# Extract subtitles if present subprocess.run([ 'ffmpeg', '-i', filepath, '-map', '0:s:0', '-c', 'copy', '1234_subtitles.srt' ]) print("ā Streams extracted from 1234.mkv") def remux_mkv(filepath="1234.mkv", output="1234_remuxed.mkv"): """Remux MKV to optimize or remove streams""" # Remove unwanted streams (example: keep only first video and audio) subprocess.run([ 'ffmpeg', '-i', filepath, '-map', '0:v:0', '-map', '0:a:0', '-c', 'copy', output ]) 1234 mkv
# Subtitle details for i, stream in enumerate(subtitle_streams): print(f"\nš Subtitle Stream {i}:") print(f" Codec: {stream.get('codec_name', 'Unknown')}") print(f" Language: {stream.get('tags', {}).get('language', 'Unknown')}") display_mkv_info("1234.mkv") 2. Stream Extraction Feature def extract_streams(filepath="1234.mkv"): """Extract individual streams from MKV""" streams = analyze_mkv(filepath)
# Get file size file_size = os.path.getsize(filepath) # Check if file exists if not os
# Audio details for i, stream in enumerate(audio_streams): print(f"\nš Audio Stream {i}:") print(f" Codec: {stream.get('codec_name', 'Unknown')}") print(f" Channels: {stream.get('channels', '?')}") print(f" Sample Rate: {stream.get('sample_rate', '?')} Hz")