I have a ffmpeg-python program that puts subtitles into a video, pseudocode below:
for i in range(10000):
video= video.filter(
'drawtext', fontfile=FONT_FILE, text=cur_string, x='(w-text_w)/2', y='(h-text_h)/2',
fontsize=FONT_SIZE, fontcolor=FONT_COLOR, borderw=2, bordercolor=FONT_OUTLINE_COLOR,
enable=f'between(t,{i},{i+1})')
video.output(PATH).run()
The code above gives the following error:
FileNotFoundError: [WinError 206] The filename or extension is too long
My questions are
(1) Is there anyway to check when the ffmpeg command is going to exceed the cmd length limit (8191/28878? not actually sure which one is in effect) in code?
(2) How do I fix this in code?
Thanks for your time