| import subprocess |
|
|
| TARGET_FILE = "/mnt/jonathanDisk/ivritData/讬讚 讬爪讞拽 讘谉-爪讘讬/2011.06.14 诪讚专砖讬 讗讙讚讛 讘讗专抓 讬砖专讗诇 讜转驻讜爪转诐 - 讗讘讬讙讚讜专 砖谞讗谉.m4a" |
|
|
| def main(): |
| print(f"Interrogating:\n{TARGET_FILE}\n") |
|
|
| |
| print("1. Reading Metadata (The Header)...") |
| try: |
| meta_cmd = [ |
| "ffprobe", "-v", "error", |
| "-show_entries", "format=duration", |
| "-of", "default=noprint_wrappers=1:nokey=1", |
| TARGET_FILE |
| ] |
| meta_seconds = float(subprocess.check_output(meta_cmd).decode().strip()) |
| meta_mins = meta_seconds / 60 |
| print(f" Result: {meta_seconds:.2f} seconds ({meta_mins:.2f} minutes)") |
| except Exception as e: |
| print(f" Failed to read metadata: {e}") |
|
|
| |
| print("\n2. Decoding physical packets (The Truth)...") |
| print(" (Reading all bytes to find the physical cliff. Takes a few seconds...)") |
| try: |
| |
| phys_cmd = f"ffmpeg -v info -i '{TARGET_FILE}' -f null - 2>&1 | tr '\\r' '\\n' | grep 'time=' | tail -n 1" |
| phys_out = subprocess.check_output(phys_cmd, shell=True).decode().strip() |
| |
| |
| print(f" Result: {phys_out}") |
| except Exception as e: |
| print(f" Failed to decode stream: {e}") |
|
|
| if __name__ == "__main__": |
| main() |
|
|