Skip to content

Commit 2a1ddc2

Browse files
author
Lukas Wingerberg
committed
add -vf arg quoting
1 parent 7a91968 commit 2a1ddc2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

client/grpc-ffmpeg.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,17 @@ def handle_quoted_arguments(command_args):
7575
rffmpeg_command.append(arg)
7676
rffmpeg_command.append(filter_complex_arg)
7777
i += 2 # Skip the next argument as it's part of -filter_complex
78-
78+
elif arg == '-vf' and i + 1 < len(command_args):
79+
vf_arg = command_args[i + 1]
80+
81+
# Quote the filter complex string if it contains spaces, commas, or colons
82+
if ' ' in vf_arg or ',' in vf_arg or ':' in vf_arg:
83+
vf_arg = f'"{vf_arg}"'
84+
85+
# Reassemble the -filter_complex argument
86+
rffmpeg_command.append(arg)
87+
rffmpeg_command.append(vf_arg)
88+
i += 2 # Skip the next argument as it's part of -vf
7989
# Append any other arguments as is
8090
else:
8191
rffmpeg_command.append(arg)

0 commit comments

Comments
 (0)