Reputation: 59
I want to split a single input video "input.mp4" into two separate videos "out1.mp4" and "out2.mp4." I also want to burn hard subtitles into each of the output files. The subtitles come from two pre-existing subtitle files "subtitles1.ass" and "subtitles2.ass." I tried just adding -vf "ass=subtitles1.ass" and -vf "ass=subtitles2.ass" before each of the output files. Subtitles from subtitles1.ass were added to out1.mp4 but out2.mp4 had no subtitles. I spent hours reading docs and trying things and realized I probably need a complex filter and mapping so came up with this:
ffmpeg.exe -i "input.mp4" -filter_complex "[0:v]split=2[in1][in2];[in1]ass=subtitles1.ass[out1];[in2]ass=subtitles2.ass[out2]" -map "[out1]" -map 0:a -ss 0:00:00.00 -to 0:01:00.00 "C:\out1.mp4" -map "[out2]" -map 0:a -ss 0:01:00.00 -to 0:02:00.00 "C:\out2.mp4"
... which I think means "Take the input file, split it into two "input pads," send input pad 1 through the subtitle filter with parameter subtitles1.ass and send input pad 2 through the subtitle filter with parameter subtitles2.ass. The two then come out to output pads out1 and out2. I then map out1 (which has the video with burned in subtitles) and also map the audio from the input file, and send the first hour of the video to out1.mp4. I do the same thing for output pad out2 and try to get the second hour of video with subtitles from subtitiles2.ass.
I do get out1.mp4 with the first hour of video and audio and properly burned in subtitles. Unfortunately, out2.mp4 has the correct second hour of video and audio but no subtitles. Am I missing something to get subtitles2.ass burned into out2.mp4?
Upvotes: -1
Views: 38