I’m trying to get draw text on top of my video, but something seems to be off, CasparCG accepts my command stars playing video, but the text never shows up.
My command line:
PLAY 1-12 “video_file” filter drawtext=fontfile=LiberationSans-Regular.ttf:text=“this_is_text”:x=100:y=100:fontsize=48:fontcolor=white loop
I tested this with ffplay and everything works
ffplay -i video_file.avi -vf drawtext=fontfile=C:\Casparcg\server\font\LiberationSans-Regular.ttf:text=“this_is_text”:x=100:y=100:fontsize=48:fontcolor=white
I noticed some issues with fonts:
LiberationSans-Regular seems to be only one working from \Casparcg\server\font, if I try to use other fonts it gives an error: [Parsed_drawtext_0 @ 000002287B3DB320] Could not load font “roboto-regular.ttf”: cannot open resource
Tried using Arial font from \Windows\Fonts, same error
Moved Arial font to \Casparcg\server\font, same error
Server version 2.1.0.3437 dc2e94b Beta 2
If you guys have a suggestion I’ll be happy to try it out.
That’s what this template thing is all about, to add dynamic, live text. That was the basic idea behind CasparCG. That is also why it has that “CG” in the end of the name. That means Character Generator and denotes a device that does live graphics in TV broadcasting.
This is definetely not a workflow we support currently, and I don’t see us actively supporting this anytime soon. If you’re lucky it might work in 2.2 since that version has an upgraded ffmpeg producer. (Download 2.2 from http://builds.casparcg.com/)
Since you are using 2.1 currently, you could also use the built-in text producer. For info about that just write “help producer text producer” into the commandline.
in the latest 2.2 build (http://builds.casparcg.com/ under server/master) you definitely can do this and it works nice.
i have placed the Hack fonts (https://sourcefoundry.org/hack/) in caspars fontdirectory, after that run this command with your file.
PLAY 1-10 valvaka vf “drawtext=fontfile=c\\\\:/caspar/_FONT/Hack-Regular.ttf: text=‘pts\\:%{pts \\: hms} frame\\:%{n} type\\:%{pict_type}’: x=40: y=280: fontsize=60: fontcolor=white: shadowx=2: shadowy=2: alpha=0.7”
Questions like this can also be asked in the help repo at github where it will catch the eyes from the developers who tend to hang over there. https://github.com/CasparCG/help