import subprocess
import json
import argparse

def get_media_info(file_path):
    command = [
        "ffprobe", 
        "-i", file_path
    ]

    try:
        # result = subprocess.run(command, capture_output=True, text=True, check=True)
        return subprocess.run(command)
    except subprocess.CalledProcessError as e:
        print(f"Error: {e}")
        return None
    
def main():
    parser = argparse.ArgumentParser(description="Check media information using ffprobe.")
    parser.add_argument("file_path", help="Path to the media file")
    args = parser.parse_args()

    media_info = get_media_info(args.file_path) 
    print(media_info)

if __name__ == "__main__":
    main()