How to make text on a video slides diagonally using FFMPEG drawtext filter

Subscribers:
612
Published on ● Video Link: https://www.youtube.com/watch?v=CKXPMF3Izko



Duration: 18:10
240 views
1


Hi, did you know you can make text on a video to slides diagonally. There are 4 types, variants or examples of these slides: first, sliding from top left top right bottom, second, vice versa, from right bottom to top left, third, from top right to left bottom and fourth, last, from left bottom to top right.

Below are the code for each types, variants or example. Note: you can change the number 100 to any movement speed (pixel/s) that you like.

1. Sliding from top left to right bottom
ffmpeg -i input_file -vf drawtext="text=text_to_display:x=mod(t*100\,w):y=(x*h)/w:fontsize=60" output_file_name

2. Sliding from right bottom to top left
ffmpeg -i input_file -vf drawtext="text=text_to_display:x=w-mod(t*100\,w+(19*15)):y(x*h)/w:fontsize=60:shadowx=2:shadowy=2:shadowcolor=red:fontcolor=white" output_file_name

3. Sliding from top right to left bottom
ffmpeg -i "input_file" -vf drawtext="text=text_to_display:x=w-mod(t*100\,w+(19*15)):y=h-(x*h)/w:fontsize=60:shadowx=2:shadowy=2:shadowcolor=red:fontcolor=white" output_file_name

4. Sliding from left bottom to top right
ffmpeg -i "input_file" -vf drawtext="text=text_to_display:x=mod(t*100\,w):y=h(x*h)/w:fontsize=60:shadowx=2:shadowy=2:shadowcolor=red:fontcolor=white" output_file_name




Other Videos By Computertechlighthouse


2023-09-09FFMPEG - How To Changes Overlay Texts' Color, Size, Position Or Content Continuously On Video
2023-09-08HTML POST 2nd request packet footage captured on Pythons' IDLE.
2023-08-17Python - How To Make A Free Video Player That Shows Milisecond Using OpenCV2 And FFPYPLAYER Module
2023-08-11"April 02, 2023: Jakarta's Sky Ablaze in Fiery Sunset"
2023-08-11A miracle happen: A house side by side in Jakarta didn't get burned in big fire
2023-08-10Simple DNS Query Packet Creation And DNS Packet Response Analysis Using Python Socket Part 3
2023-08-10Simple DNS Query Packet Creation And DNS Packet Response Analysis Using Python Socket Part 2
2023-08-10Simple DNS Query Packet Creation And DNS Packet Response Analysis Using Python Socket Part 1
2023-08-08Troubleshoot No connection could be made because the target machine actively refused it
2023-08-02How to run Python scripts as scheduled task on Windows
2023-08-02How to make text on a video slides diagonally using FFMPEG drawtext filter
2023-04-29What is method chainining in Python and how to do it
2023-04-28Effect of ‘b’ character in front of a string literal in Python
2023-04-24Three ways Python can handle Windows file path
2023-04-10Who is Gog and Magog?
2023-03-02asd
2023-01-30Trying ChatGPT second times and find some important uses
2022-12-14Visual question #1
2022-10-04Cara menggunakan google slide
2022-06-28I code Nokia Snake similliar program using Small Basic
2022-05-17Penemuan Indonesia adalah radius taman eden dan tanah havillah



Tags:
ffmpeg
ffmpeg drawtext
video filter
drawtext
text slide
video editing
text moves diagonally
diagonal text movement