[FFmpeg-user] DrawText Not Drawing from top-left (0,0)

Moritz Barsnick barsnick at gmx.net
Fri Jan 20 10:45:05 EET 2017


On Thu, Jan 19, 2017 at 14:31:30 -0800, dinizthiagobr wrote:
> I figured out the first issue, android's rotation metadata was screwing
> everything up, so I cleared all metadata then rotated accordingly to
> original rotation metadata

We might have figured it out, had you shown us the console output from
your command. There's so much useful information in it, honestly!

> cmd.Add("scale=640:640,transpose=1,pad=670:670:15:15:white,drawtext=fontfile="
> + fontFilePath + ":text=" + _caption + ":x=15:y=15:fontsize=30:box=1");
> 
> Now looking to solve the second issue, *I want the top border/pad to be
> bigger than the rest*, couldn`t figure this one yet. :)

Well, what you're doing is padding something originally 640x640, and putting it on
a 670x670 canvas, with an offset of 15, which is exactly in the middle
((670-640)/2 = 15). If you want the top border to be larger, increase
the canvas and the offset, e.g.:
  "scale=640:640,transpose=1,pad=670:680:15:25"
or just put the overlay lower:
  "scale=640:640,transpose=1,pad=670:670:15:25"
It really depends on what you're trying to achieve (exactly).

Moritz


More information about the ffmpeg-user mailing list