[Python] How to correctly pass Windows path with spaces to FFmpeg -vf ass filter in Python?

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    ass_path = r'C:\Users\username\Desktop\Title Of Video.ass'
    command = [
    'ffmpeg',
    '-i', mp4_path,
    '-vf', f"ass='{ass_path}'", # Embed the full path in the filter string, with single quotes
    '-c:v', 'libx264',
    '-c:a', 'copy',
    output_path
    ]


    In the error message I'm getting this message: Unable to parse option value "UsersusernameDesktopTitle Of Video.ass" as image size. Somehow in the command it's stripping the \ away and removed the C:

    Does anyone know how to fix this? Thanks.

    Continue reading...

Compartilhe esta Página