0

I have an avi video and I want to display frame number in the video.

Frame rate = 40fps

I'm using this script:

ffmpeg -i maxSSIM_realTime_C_L_560x448.avi -vf "drawtext=fontfile=Arial.ttf: text=%{n}: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099"   -qscale 0 -y maxSSIM_real_time.avi

But I get [Parsed_drawtext_0 @ 0000000000732d00] Cannot find a valid font for the family Sans.

Where can I find fonts in windows 7?

zinon
  • 4,427
  • 14
  • 70
  • 112
  • Possible duplicate of [FFmpeg drawtext - Could not load fontface from file](https://stackoverflow.com/questions/8103808/ffmpeg-drawtext-could-not-load-fontface-from-file) – Shai Nov 20 '18 at 07:04

2 Answers2

4

The fonts on android device are stored at "/system/fonts/Roboto-Regular.ttf". So the command looks like this. This is working for me on android device.

val subtitlecommand = arrayOf( "-y", "-i", videoPath, "-vf", "drawtext=fontfile=/system/fonts/Roboto-Regular.ttf:text='Super User':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=24:fontcolor=white", "-c:a", "copy", appDir )

VIVEK CHOUDHARY
  • 468
  • 5
  • 8
2

Provide the full path to the font file: fontfile='C\:\\Windows\\fonts\\Arial.ttf'

Jolta
  • 2,620
  • 1
  • 29
  • 42
Gyan
  • 85,394
  • 9
  • 169
  • 201