fix this error you always give me Traceback (most recent call last):
  File "D:\coin\ccc\Video2Image\run.py", line 220, in <module>
    if name == "main":
NameError: name 'name' is not defined  here is code import os
import sys
import subprocess
import threading
from multiprocessing import cpu_count
from pathlib import Path
import tkinter as tk
from tkinter import filedialog, scrolledtext
import requests
import webbrowser

def is_video_file(filename):
    video_extensions = ['.mp4', '.avi', '.mov', '.mkv', '.flv',
                        '.wmv', '.mpeg', '.mpg', '.3gp', '.webm', '.ts', '.mts', '.m2ts', '.vob', '.m4v']
    return any(filename.lower().endswith(ext) for ext in video_extensions)

def process_video(video_data):
    video_path, output_format, ffmpeg_path = video_data
    video_path = Path(video_path)
    video_name = video_path.stem  # Get the video filename without extension
    output_dir = video_path.parent / video_name  # Output folder named after the video

    # Create the output directory if it doesn't exist
    output_dir.mkdir(exist_ok=True)

    # Construct the FFmpeg command
    if output_format.lower() == 'jpg':
        image_extension = 'jpg'
        quality_params = ['-qscale:v', '1']  # Highest quality
    elif output_format.lower() == 'png':
        image_extension = 'png'
        quality_params = ['-compression_level', '0']  # No compression
    else:
        return f"Unsupported output format: {output_format}"

    # Output image file pattern
    image_pattern = str(output_dir / f"{video_name}_%06d.{image_extension}")

    # Build the FFmpeg command
    cmd = [ffmpeg_path, '-i', str(video_path), *quality_params, '-vsync', '0', image_pattern]

    try:
        subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
        return f"Finished processing {video_path}"
    except subprocess.CalledProcessError as e:
        return f"Error processing {video_path}: {e}"

def process_videos_in_folder(main_folder, output_format='jpg', ffmpeg_path='ffmpeg'):
    main_folder = Path(main_folder)

    # Collect all video files from the main folder and subfolders
    video_files = []
    for root, dirs, files in os.walk(main_folder):
        for file in files:
            if is_video_file(file):
                video_path = Path(root) / file
                video_files.append(video_path)

    if not video_files:
        return ["No video files found in the directory."]

    num_workers = min(len(video_files), cpu_count())
    args_list = [(video_file, output_format, ffmpeg_path) for video_file in video_files]

    # Process videos sequentially to update GUI in real-time
    results = []
    for args in args_list:
        result = process_video(args)
        results.append(result)

    return results

def get_discord_member_count(invite_code):
    url = f"https://discord.com/api/v9/invites/{invite_code}?with_counts=true&with_expiration=true"
    try:
        response = requests.get(url)
        data = response.json()
        if 'approximate_member_count' in data:
            return data['approximate_member_count']
        else:
            return "N/A"
    except Exception as e:
        return "N/A"

def open_discord_link(event, url):
    webbrowser.open_new(url)

def main():
    # Create the main window
    root = tk.Tk()
    root.title("DeepAscension Video2Image")
    root.geometry("800x700")
    root.resizable(False, False)

    # Set the theme colors
    main_bg_color = "#1a1a2e"  # Dark blue-purple
    secondary_bg_color = "#16213e"  # Even darker blue
    accent_color = "#0f3460"  # Blue accent
    text_color = "#ffffff"  # White text
    button_color = "#e94560"  # Pinkish-red buttons

    root.configure(bg=main_bg_color)

    # Create variables
    selected_directory = tk.StringVar(value=os.getcwd())
    output_format = tk.StringVar(value='jpg')
    ffmpeg_path = tk.StringVar(value='./ffmpeg/ffmpeg')  # Default path to FFmpeg in the script directory

    # Create the GUI elements
    # Directory selection
    dir_label = tk.Label(root, text="Selected Directory:", bg=main_bg_color, fg=text_color, font=("Helvetica", 12))
    dir_label.place(x=20, y=20)

    dir_entry = tk.Entry(root, textvariable=selected_directory, width=50, bg=secondary_bg_color, fg=text_color, insertbackground=text_color)
    dir_entry.place(x=180, y=23)

    select_dir_button = tk.Button(root, text="Browse", command=lambda: browse_directory(selected_directory), bg=button_color, fg=text_color)
    select_dir_button.place(x=650, y=20)

    # Output format selection
    format_label = tk.Label(root, text="Output Format:", bg=main_bg_color, fg=text_color, font=("Helvetica", 12))
    format_label.place(x=20, y=60)

    format_options = ['jpg', 'png']
    format_menu = tk.OptionMenu(root, output_format, *format_options)
    format_menu.configure(bg=secondary_bg_color, fg=text_color, highlightthickness=0, activebackground=button_color, font=("Helvetica", 10))
    format_menu["menu"].configure(bg=secondary_bg_color, fg=text_color)
    format_menu.place(x=180, y=55)

    # FFmpeg path
    ffmpeg_label = tk.Label(root, text="FFmpeg Path:", bg=main_bg_color, fg=text_color, font=("Helvetica", 12))
    ffmpeg_label.place(x=20, y=100)

    ffmpeg_entry = tk.Entry(root, textvariable=ffmpeg_path, width=50, bg=secondary_bg_color, fg=text_color, insertbackground=text_color)
    ffmpeg_entry.place(x=180, y=103)

    # Start Processing Button
    start_button = tk.Button(root, text="Start Processing", bg=button_color, fg=text_color, font=("Helvetica", 12))
    start_button.place(x=350, y=140)
    start_button.config(command=lambda: start_processing(selected_directory.get(), output_format.get(), ffmpeg_path.get(), output_text, start_button))

    # Output Text Area
    output_text = scrolledtext.ScrolledText(root, wrap=tk.WORD, width=95, height=15, bg=secondary_bg_color, fg=text_color, font=("Helvetica", 10), state='disabled')
    output_text.place(x=20, y=190)

    # Discord Invitation and Member Count
    invite_code = 'njSKPUQtFa'
    member_count = get_discord_member_count(invite_code)

    discord_frame = tk.Frame(root, bg=secondary_bg_color, width=760, height=150)
    discord_frame.place(x=20, y=460)

    discord_title = tk.Label(discord_frame, text="Join the Ultimate FaceSwap and AI VFX Hub!", bg=secondary_bg_color, fg=text_color, font=("Helvetica", 14, "bold"))
    discord_title.pack(pady=5)

    discord_message = (
        "The Share Your DFM Live Discord server is the premier destination for FaceSwap and AI VFX enthusiasts.\n"
        "It features the best occlusion DST faceset, top-tier models, and expertly crafted XSeg models. Additionally,\n"
        "it boasts the largest DFM collection on Discord. Whether you're a beginner or a seasoned pro, you'll find\n"
        "invaluable resources and a supportive community here."
    )

    discord_label = tk.Label(discord_frame, text=discord_message, bg=secondary_bg_color, fg=text_color, font=("Helvetica", 10), justify="left")
    discord_label.pack()

    # Discord Link with member count
    discord_link = f"https://discord.gg/{invite_code}"
    discord_text = f"Discord Server: {discord_link}  |  Members Online: {member_count}"
    discord_link_label = tk.Label(discord_frame, text=discord_text, bg=secondary_bg_color, fg="#7289DA", font=("Helvetica", 12, "underline"), cursor="hand2")
    discord_link_label.pack(pady=5)
    discord_link_label.bind("<Button-1>", lambda event: open_discord_link(event, discord_link))

    # Credits
    credits_label = tk.Label(root, text="Made by Cxsmo", bg=main_bg_color, fg=text_color, font=("Helvetica", 10))
    credits_label.place(x=370, y=630)

    root.mainloop()

def browse_directory(selected_directory_var):
    directory = filedialog.askdirectory()
    if directory:
        selected_directory_var.set(directory)

def start_processing(main_folder, output_format, ffmpeg_path, output_text_widget, start_button):
    # Disable the start button while processing
    start_button.config(state='disabled')

    # Run the processing in a separate thread to keep GUI responsive
    processing_thread = threading.Thread(target=processing_task, args=(main_folder, output_format, ffmpeg_path, output_text_widget, start_button))
    processing_thread.start()

def processing_task(main_folder, output_format, ffmpeg_path, output_text_widget, start_button):
    # Update output_text_widget with status
    update_text(output_text_widget, f"Processing videos in {main_folder}...\n")

    # Perform processing
    results = process_videos_in_folder(main_folder, output_format, ffmpeg_path)

    for message in results:
        update_text(output_text_widget, message + "\n")

    update_text(output_text_widget, "All videos have been processed.\n")

    # Re-enable the start button
    enable_start_button(start_button)

def update_text(widget, text):
    def append_text():
        widget.config(state='normal')
        widget.insert(tk.END, text)
        widget.see(tk.END)
        widget.config(state='disabled')
    widget.after(0, append_text)

def enable_start_button(button):
    def enable():
        button.config(state='normal')
    button.after(0, enable)

if name == "main":
    main()