i have a script which I were using in Google colab, now I want to use it in my windows 10 command prompt. So modify the script so that I can use in my pc . here is my script= # Install necessary packages
!pip install opencv-python-headless ffmpeg-python -q

import os
import cv2
import ffmpeg
from google.colab import drive
import ipywidgets as widgets
from IPython.display import display, clear_output
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle

# Mount Google Drive
drive.mount('/content/drive')

# Function to browse directories in Google Drive
def browse_subfolders(base_folder='/content/drive/My Drive'):
    """Returns a sorted list of subfolder paths within the base folder."""
    folder_set = set()
    for dirname, _, _ in os.walk(base_folder):
        folder_set.add(dirname)
    folder_list = sorted(list(folder_set))
    return folder_list

# Initialize global variables
files_list = []
current_file_index = 0
crop_settings = {}
width_cache = {}
height_cache = {}

# Dropdown for folder selection
drive_folder = '/content/drive/My Drive'
folder_dropdown = widgets.Dropdown(
    options=browse_subfolders(drive_folder),
    description='Select Folder:',
    layout=widgets.Layout(width='100%'),
    style={'description_width': 'initial'}
)

# Sliders for crop settings (percentages)
x_start_slider = widgets.IntSlider(
    value=0,
    min=0,
    max=100,
    step=1,
    description="Start X (%)",
    continuous_update=False,
    layout=widgets.Layout(width='100%')
)
y_start_slider = widgets.IntSlider(
    value=0,
    min=0,
    max=100,
    step=1,
    description="Start Y (%)",
    continuous_update=False,
    layout=widgets.Layout(width='100%')
)
x_end_slider = widgets.IntSlider(
    value=100,
    min=0,
    max=100,
    step=1,
    description="End X (%)",
    continuous_update=False,
    layout=widgets.Layout(width='100%')
)
y_end_slider = widgets.IntSlider(
    value=100,
    min=0,
    max=100,
    step=1,
    description="End Y (%)",
    continuous_update=False,
    layout=widgets.Layout(width='100%')
)

# Buttons for interactions
set_button = widgets.Button(description="Set Crop for Current Video", button_style='success', layout=widgets.Layout(width='100%'))
next_button = widgets.Button(description="Next Video", button_style='info', layout=widgets.Layout(width='100%'))
crop_all_button = widgets.Button(description="Start Cropping All Videos", button_style='danger', layout=widgets.Layout(width='100%'))

# Output widget for displaying video preview and messages
output = widgets.Output()

# Display initial widgets
display(
    folder_dropdown,
    x_start_slider,
    y_start_slider,
    x_end_slider,
    y_end_slider,
    set_button,
    next_button,
    crop_all_button,
    output
)

def set_slider_max_values(video_path):
    """
    Retrieves the width and height of the first frame of the video.
    Caches the values to avoid redundant computations.
    """
    if video_path in width_cache and video_path in height_cache:
        return width_cache[video_path], height_cache[video_path]
    
    cap = cv2.VideoCapture(video_path)
    ret, frame = cap.read()
    cap.release()

    if not ret:
        print(f"Error: Unable to read video {os.path.basename(video_path)}.")
        return None, None  # Indicate failure

    height, width = frame.shape[:2]
    width_cache[video_path] = width
    height_cache[video_path] = height
    return width, height

def update_folder_path(change):
    """Updates the list of video files when a new folder is selected."""
    global drive_folder, files_list, crop_settings, current_file_index, width_cache, height_cache
    drive_folder = change['new']
    files_list = [os.path.join(drive_folder, f) for f in os.listdir(drive_folder) 
                  if f.lower().endswith(('.mp4', '.avi', '.mov', '.mkv'))]
    if not files_list:
        with output:
            clear_output()
            print("No video files found in the selected folder.")
        return
    else:
        with output:
            clear_output()
            print(f"Found {len(files_list)} video file(s) in '{os.path.basename(drive_folder)}'.")

    # Initialize crop settings for each file
    crop_settings = {file: (0, 0, 100, 100) for file in files_list}
    width_cache = {}
    height_cache = {}
    current_file_index = 0
    update_sliders_for_current_file()
    show_preview()

folder_dropdown.observe(update_folder_path, names='value')

def update_sliders_for_current_file():
    """Sets the slider values based on the current video's crop settings."""
    if files_list:
        current_file = files_list[current_file_index]
        start_x, start_y, end_x, end_y = crop_settings[current_file]
        x_start_slider.value = start_x
        y_start_slider.value = start_y
        x_end_slider.value = end_x
        y_end_slider.value = end_y
    else:
        with output:
            clear_output()
            print("No video files available to set sliders.")

def show_preview(*args):
    """Displays the first frame of the current video with the cropping rectangle."""
    if not files_list:
        with output:
            clear_output()
            print("No video files available to preview.")
        return

    current_file = files_list[current_file_index]
    width, height = set_slider_max_values(current_file)
    
    if width is None or height is None:
        with output:
            clear_output()
            print(f"Cannot preview {os.path.basename(current_file)} due to read error.")
        return

    cap = cv2.VideoCapture(current_file)
    ret, frame = cap.read()
    cap.release()

    if not ret:
        with output:
            clear_output()
            print(f"Error reading video: {os.path.basename(current_file)}")
        return

    frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
    fig, ax = plt.subplots(figsize=(4, 3))  # Reduced figure size for mobile
    ax.imshow(frame_rgb)
    ax.set_title(f"Crop area for: {os.path.basename(current_file)}", fontsize=8)  # Smaller title font
    
    # Calculate pixel values based on slider percentages
    start_x = int(x_start_slider.value / 100 * width)
    start_y = int(y_start_slider.value / 100 * height)
    end_x = int(x_end_slider.value / 100 * width)
    end_y = int(y_end_slider.value / 100 * height)
    
    # Ensure coordinates are within frame bounds
    start_x = max(0, min(start_x, width - 1))
    end_x = max(start_x + 1, min(end_x, width))
    start_y = max(0, min(start_y, height - 1))
    end_y = max(start_y + 1, min(end_y, height))
    
    crop_width = end_x - start_x
    crop_height = end_y - start_y
    
    # Draw the cropping rectangle
    rect = Rectangle((start_x, start_y), crop_width, crop_height,
                     linewidth=2, edgecolor='r', facecolor='none')
    ax.add_patch(rect)
    plt.axis('off')
    plt.tight_layout()  # Adjust layout to fit the smaller figure
    with output:
        clear_output(wait=True)
        # Regenerate the widgets display to maintain visibility
        display(
            folder_dropdown,
            x_start_slider,
            y_start_slider,
            x_end_slider,
            y_end_slider,
            set_button,
            next_button,
            crop_all_button
        )
        display(fig)

def set_crop_for_current_file(b):
    """Saves the current slider values as crop settings for the active video."""
    if not files_list:
        with output:
            clear_output()
            print("No video files available to set crop.")
        return

    current_file = files_list[current_file_index]
    crop_settings[current_file] = (
        x_start_slider.value,
        y_start_slider.value,
        x_end_slider.value,
        y_end_slider.value
    )
    
    with output:
        clear_output()
        print(f"Set crop for '{os.path.basename(current_file)}': "
              f"Start X: {x_start_slider.value}%, Start Y: {y_start_slider.value}%, "
              f"End X: {x_end_slider.value}%, End Y: {y_end_slider.value}%")
    show_preview()

def next_video(b):
    """Navigates to the next video in the list."""
    global current_file_index
    if current_file_index < len(files_list) - 1:
        current_file_index += 1
        update_sliders_for_current_file()
        show_preview()
    else:
        with output:
            clear_output()
            print("You have reached the last video.")

def crop_videos(b):
    """Applies the crop settings to all videos and saves the cropped versions."""
    if not files_list:
        with output:
            clear_output()
            print("No videos to crop.")
        return

    with output:
        clear_output()
        print("Starting the cropping process...")
    
    for idx, input_file in enumerate(files_list, 1):
        file_dir, file_name = os.path.split(input_file)
        file_base, file_ext = os.path.splitext(file_name)
        output_file = os.path.join(file_dir, f"{file_base}_cropped{file_ext}")

        crop_info = crop_settings.get(input_file, (0, 0, 100, 100))
        start_x_percent, start_y_percent, end_x_percent, end_y_percent = crop_info

        width, height = set_slider_max_values(input_file)
        if width is None or height is None:
            with output:
                print(f"Skipping '{file_name}' due to read error.")
            continue

        start_x = int(start_x_percent / 100 * width)
        start_y = int(start_y_percent / 100 * height)
        end_x = int(end_x_percent / 100 * width)
        end_y = int(end_y_percent / 100 * height)

        # Validate crop dimensions
        if end_x <= start_x or end_y <= start_y:
            with output:
                print(f"Invalid crop dimensions for '{file_name}'. Skipping.")
            continue

        crop_width = end_x - start_x
        crop_height = end_y - start_y

        try:
            # Apply cropping using FFmpeg
            (
                ffmpeg
                .input(input_file)
                .crop(x=start_x, y=start_y, width=crop_width, height=crop_height)
                .output(output_file, vcodec='libx264', acodec='aac', audio_bitrate='192k')
                .overwrite_output()
                .run(quiet=True)
            )
            with output:
                print(f"[{idx}/{len(files_list)}] Cropped and saved as: {output_file}")
        except ffmpeg.Error as e:
            with output:
                print(f"Error cropping '{file_name}': {e}. Skipping.")
        except Exception as e:
            with output:
                print(f"Unexpected error for '{file_name}': {e}. Skipping.")
    
    with output:
        print("Cropping process completed.")

# Attach event handlers to buttons
set_button.on_click(set_crop_for_current_file)
next_button.on_click(next_video)
crop_all_button.on_click(crop_videos)

# Automatically update the preview when sliders are adjusted
x_start_slider.observe(show_preview, names='value')
y_start_slider.observe(show_preview, names='value')
x_end_slider.observe(show_preview, names='value')
y_end_slider.observe(show_preview, names='value')