C.W.K.
Stream
Lesson 06 of 10 · published

Text Overlay (drawtext)

~12 min · drawtext, subtitles, lower-third

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

가장 까다로운 filter, 가장 많이 쓰는 filter

drawtext 가 video 에 text burn. 필수 parameter: text (또는 textfile), x, y, fontsize, fontcolor, fontfile. fontfile 이 가장 까다 — FFmpeg 이 system font lookup 안 함; 실제 TTF/OTF 가리켜.

재사용할 패턴

  • Lower-third title — 큰 text, white, legibility 위한 black box 뒤.
  • Timecode burn-in%{pts:hms} expression 이 현재 재생 시간 그림.
  • Frame counter%{frame_num}.
  • 시간-windowed textenable='between(t,2,5)'.

macOS 의 font path

흔한 path: /System/Library/Fonts/Helvetica.ttc 또는 /System/Library/Fonts/Supplemental/Arial.ttf. 또는 /opt/homebrew/share/fonts/ 의 specific Homebrew font.

Code

drawtext recipe·bash
# 단순 white text top-left
ffmpeg -i in.mp4 -vf \
  "drawtext=fontfile=/System/Library/Fonts/Supplemental/Arial.ttf:text='Hello':fontcolor=white:fontsize=48:x=20:y=20" \
  -c:a copy out.mp4

# Lower-third 와 배경 box
ffmpeg -i in.mp4 -vf \
  "drawtext=fontfile=/System/Library/Fonts/Supplemental/Arial.ttf:text='Pippa Choi':fontcolor=white:fontsize=64:x=80:y=H-160:box=1:boxcolor=black@0.6:boxborderw=20" \
  -c:a copy lower_third.mp4

# Timecode burn-in
ffmpeg -i in.mp4 -vf \
  "drawtext=fontfile=/System/Library/Fonts/Supplemental/Arial.ttf:text='%{pts\\:hms}':fontcolor=yellow:fontsize=32:x=W-tw-20:y=H-th-20:box=1:boxcolor=black@0.5:boxborderw=10" \
  -c:a copy timecode.mp4
파일에서 multi-line text·bash
# Text 를 파일에 (shell-escape 지옥 회피)
cat > caption.txt <<'EOF'
Line one
Line two
Line three
EOF

ffmpeg -i in.mp4 -vf \
  "drawtext=fontfile=/System/Library/Fonts/Supplemental/Arial.ttf:textfile=caption.txt:fontcolor=white:fontsize=48:x=20:y=20:line_spacing=10" \
  -c:a copy multiline.mp4

External links

Exercise

30초 clip 에 text overlay 셋: (a) 첫 5초 보이는 title, lower-thirds 스타일 black box. (b) 전체 clip bottom-right 에 burnt-in timecode. (c) Top-left 에 작은 'pippa.dev' 워터마크, semi-transparent. Apostrophe 있으면 textfile.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.