I am running ffmpeg in python as a subprocess. I want to burn the subtitles into a video. Just using ffmpeg (commandline without python in windows) the following works:
ffmpeg.exe" -y -i "input_file" -vf "subtitles= 'input_file_path' :si=0" -acodec copy "output_file_path"
the escape characters are required by ffmpeg for special characters within a filter, However trying to replicate this within a python subprocess has proved problematic, here is one of many failed attempts:
command = ["ffmpeg.exe","-y","-i","input_file_path","-acodec","copy","
-vf","subtitles=",'"'+"input_file_path"+'"',output_file_path]
print(command)
proc = subprocess.Popen(command, stderr=PIPE,stdin=subprocess.PIPE,universal_newlines=True,encoding='utf-8')
I need to get the right combination of Python escape characters and ffmpeg escape characters. Any ideas?