Overlaying text on video with required angle using FFMPEG
<p>I am trying to overlay some text on video using ffmpeg. I am able to overlay text by the bellow command.</p>

<pre><code>ffmpeg -i input1.mp4 -filter_complex "[0:v]transpose=2[anticlockwiserotated];[anticlockwiserotated]drawtext=fontfile=../../public/fonts/Roboto-Regular-webfont.ttf: text='Test Text':x=100: y=50: fontsize=36: fontcolor=white:[textapplied];[textapplied]transpose=1" output_video.mp4
</code></pre>

<p>It is allowing me to overlay horizontally or vertically only.</p>

<p>But I want to append it with some angle like 45 degrees.</p>

<p>For that if I modify the command as</p>

<pre><code>ffmpeg -i input1.mp4 -filter_complex "[0:v]rotate=45*PI/180[anticlockwiserotated];[anticlockwiserotated]drawtext=fontfile=../../public/fonts/Roboto-Regular-webfont.ttf: text='Test Text':x=100: y=50: fontsize=36: fontcolor=white:[textapplied];[textapplied]rotate=315*PI/180" output_video.mp4
</code></pre>

<p>By this I am getting overlay video as:</p>

<p><a href="https://i.stack.imgur.com/nYzto.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nYzto.png" alt="enter image description here"></a></p>

<p>Because in this first I am rotating video to 45 degrees, appending text and bringing it back to original position. So I am loosing borders.</p>

<p>Please suggest me the best way to overlay text with required angle on video.</p>

<p>Thanks in advance.</p>