Reputation: 1317
I am trying to add text and time stamp on video but not able to print the simple text on it.
String[] complexCommand = {"-f", "3gp", "-i", videoPath, "-s", height + "x" + width, "-r",
"17", "drawtext=fontfile='file://android_asset/font_eight.ttf':fontsize=20:text='test':x=10:y=100",
"-vcodec", "libx264", "-vb", "2000k", "-preset", "fast", "-f", "3gp", dir.getAbsolutePath() + "/out.3gp"};
ffmpeg -f 3gp -i /storage/emulated/0/DCIM/Camera/VID_20171211_105946.3gp -s 1920x1080
-r 17 drawtext='fontfile=file://android_asset/font_eight.ttf:fontsize=20:text=test:x=10:y=100
-vcodec libx264 -vb 2000k -preset fast -f 3gp /storage/emulated/0/Pictures/Video/out.3gp
-- Edited Question ---
Error:
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 0xf5ba0730] impossible to init fontconfig
[AVFilterGraph @ 0xf5b89040] Error initializing filter 'drawtext' with args 'fontfile=file://android_asset/font_eight.ttf:fontsize=32:text=test:fontcolor=white:x=0:y=0'
Error opening filters!
Same command runs on windows with no error, But when I converted it for mobile device and tested getting error of font-path.
Upvotes: 0
Views: 1302
Reputation: 93058
drawtext is a video filter, so it has to be passed as an argument to -vf
or -filter_complex
(used when filtering multiple streams).
So,
per Gyan, Dec 13
-vf drawtext=fontsize=20:text='aaa':x=10:y=100
Upvotes: 1