I am trying to build a tool where people can position their subtitles on an HTML5 video and then I will burn the subtitles into the video for them.
I can easily get the position of the subtitles, in whatever format I need, that's easy. However, no combination of values that I feed to ffmpeg are working.
My holy grail is an x and y offest (aka offset 5% from the left, 10% from the bottom, in terms of video height/width).
To achieve this, I would like the subtitles to start in the very bottom-left corner.
ffmpeg -y -i english.mp4 -vf "subtitles=english.srt:force_style='Alignment=1,OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,FontName=Arial,FontSize=24,MarginL=140,MarginV=0'" -c:v libx264 -crf 23 -c:a copy output_video.mp4
Here is something that is approaching working, but it's behaving very strangely. The video is 850x480 but when I do a margin of 140 it goes way past the midway point of the video.
Am I missing something? How can I start the margin in the bottom left, and then apply the margin I want to push it away from the left and away from the bottom? I can do it either as a percentage of the video height/width if that API is supported or just pixels is fine too (but clearly doesn't seem to be working)
You have omitted the right hand side instruction, which maybe confusing things.
try: