<p>Gyan solved it: (see comment above)</p>

<p>drawtext cannot alter the video frame size. Your video is most likely portrait but stored as landscape with a rotation tag, and ffmpeg auto-rotates the video for you. Add <strong>-noautorotate</strong> before -i to avoid that.</p>

CC BY-SA 4.0
2018-10-09T14:53:54.333Z
2018-10-09T14:53:54.333Z
Robert Smith
<p>Folks, I am trying to add text to an mp4 file.  Seems easy enough right?  But once the new mp4 file is generated, the new file has half the width of the original file and is higher.  It is almost like it switches the mp4 file from landscape to portrait?  Here is the command I am using:</p>

<pre><code>ffmpeg -i file01.mp4 -vf drawtext="text='Text Here': fontcolor=white: fontsize=24: box=1: boxcolor=black@0.5: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2: enable='between(t,20,30)'" -codec:a copy file01Text01.mp4
</code></pre>

<p>I then attempted to stop drawtext from distorting the video stream but this results in an error:</p>

<pre><code>ffmpeg -i file01.mp4 -vf drawtext="text='Text Here': fontcolor=white: fontsize=24: box=1: boxcolor=black@0.5: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2: enable='between(t,20,30)'" -c copy file01Text01.mp4
</code></pre>

<p>Any help on seeing how I can modify the command so that the video width/height is not changed would be appreciated.  Thank you.</p>

CC BY-SA 4.0
2018-10-09T14:28:27.653Z
drawtext cannot alter the video frame size. Your video is most likely portrait but stored as landscape with a rotation tag, and ffmpeg auto-rotates the video for you. Add `-noautorotate` before `-i` to avoid that.
Gyan
CC BY-SA 4.0
2018-10-09T18:27:15.447Z
Gyan, it worked fine.  By any chance do you know how to change the video to landscape and remove the rotation tag?  I still am having problems when I upload it to youtube.  It again tries to put it in portrait.
Robert Smith
CC BY-SA 4.0
2018-10-09T19:12:43.997Z
Add `-metadata:s:v rotate=0` before the output filename.
Gyan
<ffmpeg>
How to use ffmpeg drawtext without changing the width of a video
Robert Smith
# How to use ffmpeg drawtext without changing the width of a video

(Asked by: username_0 on 2018-10-09)

Folks, I am trying to add text to an mp4 file.  Seems easy enough right?  But once the new mp4 file is generated, the new file has half the width of the original file and is higher.  It is almost like it switches the mp4 file from landscape to portrait?  Here is the command I am using:
ffmpeg -i file01.mp4 -vf drawtext="text='Text Here': fontcolor=white: fontsize=24: box=1: boxcolor=black@0.5: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2: enable='between(t,20,30)'" -codec:a copy file01Text01.mp4

I then attempted to stop drawtext from distorting the video stream but this results in an error:
ffmpeg -i file01.mp4 -vf drawtext="text='Text Here': fontcolor=white: fontsize=24: box=1: boxcolor=black@0.5: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2: enable='between(t,20,30)'" -c copy file01Text01.mp4

Any help on seeing how I can modify the command so that the video width/height is not changed would be appreciated.  Thank you.

**Tags:** ffmpeg

> **Comments:**
> **username_1**: drawtext cannot alter the video frame size. Your video is most likely portrait but stored as landscape with a rotation tag, and ffmpeg auto-rotates the video for you. Add `-noautorotate` before `-i` to avoid that.  
> **username_0**: username_1, it worked fine.  By any chance do you know how to change the video to landscape and remove the rotation tag?  I still am having problems when I upload it to youtube.  It again tries to put it in portrait.  
> **username_1**: Add `-metadata:s:v rotate=0` before the output filename.  

---

## 1 answers

### Answer by username_0 on 2018-10-09. Score: 1

username_1 solved it: (see comment above)

drawtext cannot alter the video frame size. Your video is most likely portrait but stored as landscape with a rotation tag, and ffmpeg auto-rotates the video for you. Add **-noautorotate** before -i to avoid that.


---

