Open rf1804 opened 6 years ago
@rf1804 Did you found any solution? I have issue
String[] cmd = new String[] { "-y", "-i", path, "-vf", "drawtext=text='Title of this Video':fontfile=/storage/emulated/0/text.ttf: fontcolor=white: fontsize=24: x=(w-tw)/2: y=(h/PHI)+th box=0:", out.getAbsolutePath() };
Try to add ttf file and run it's worked for me.
@kiranboghra I tried your command with below params to add text overlay on video as below String[] cmd2 = new String[] { "-y", "-i", "storage/emulated/0/DCIM/Camera/VID_20180904_215404.mp4", "-vf", "drawtext=text='NeelMevada':fontfile=/storage/emulated/0/DCIM/Camera/Roboto_Bold.ttf: fontcolor=white: fontsize=24: x=(w-tw)/2: y=(h/PHI)+th box=0:", out.getAbsolutePath() };
### Bt it gives me an error as below
ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8 (GCC) configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags= libavutil 55. 17.103 / 55. 17.103 libavcodec 57. 24.102 / 57. 24.102 libavformat 57. 25.100 / 57. 25.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 31.100 / 6. 31.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'storage/emulated/0/DCIM/Camera/VID_20180904_215404.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2018-09-04 16:24:09 com.android.version: 6.0 Duration: 00:00:03.88, start: 0.000000, bitrate: 11587 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1088, 11667 kb/s, SAR 1:1 DAR 30:17, 19.94 fps, 25 tbr, 90k tbn, 180k tbc (default) Metadata: rotate : 90 creation_time : 2018-09-04 16:24:09 handler_name : VideoHandle Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: creation_time : 2018-09-04 16:24:09 handler_name : SoundHandle [Parsed_drawtext_0 @ 0xf5e5e680] [Eval @ 0xfffc54d8] Undefined constant or missing '(' in 'thbox=0' [Parsed_drawtext_0 @ 0xf5e5e680] Failed to configure input pad on Parsed_drawtext_0 Error opening filters!
Kindly do let me know where is wrong i am ??
I have tried the following command and it works for me: -i /storage/emulated/0/Movies/Vid.mp4 -vf drawtext=text='Author':fontfile=/storage/emulated/0/Movies/Avenir-Medium.ttf:fontcolor=white:fontsize=32:x=10:y=H-th-10 -preset ultrafast -async 1 /storage/emulated/0/Movies/output.mp4
the ttf file is must for text watermark
it does not work on android 10 and 10+
I want to add text/watermark on a video Expected
But getting the error
My Code