I have been experiencing a persistent issue while developing a command in FFMPEG to combine a .mp4 file (composed of a static image & audio from a .mp3) with burnt-in subtitles from a stylized .srt file into a new MP4.
This is the command I have been using:
command = f"""ffmpeg -report -i "{input_video_arg_abs}" -vf "subtitles='{input_srt_arg_abs}':original_size=816x1456:force_style='FontName=Open Sans Italic,FontSize=13,MarginR=10,MarginV=149'" -c:v libx264 -crf 18 -c:a copy -movflags +faststart "{output_video}" """
My script includes the main variable definitions and function calls as shown below:
input_srt = os.path.normpath(os.path.join(input_directory, srt_file))
print(f"SRT file path: {input_srt}")
reformat_srt(input_srt)
final_video_output=os.path.normpath(os.path.join(output_directory, os.path.splitext(mp3_file)[0] + '.mp4'))
time.sleep(0.5)
create_final_video(temp_video_output, input_srt, final_video_output)
Despite appearing to run successfully, the output file generated is 0 Kb. All logs that I could find suggested an error in the way I've written the .srt, but the {input_srt} seems to print out correctly.
Here are the log details: ... [Parsed_subtitles_0 @ 0000028068d97d00] Setting 'filename' to value 'E' [Parsed_subtitles_0 @ 0000028068d97d00] Unable to open E ... Error reinitializing filters! Failed to inject frame into filter network: No such file or directory Error while processing the decoded data for stream #0:0 Conversion failed!
I am currently speculating that "E:" might be causing the problem. This would be correctly interpreted by Windows, but I'm unsure about FFMPEG's interpretation. I'm hoping someone might be able to assist me in solving this issue. I'd be delighted if the solution involves an ingenious trick. Otherwise, my apologies for the rookie question. I appreciate your help in advance.
Best, sKunZel