Closed Neha0595 closed 5 years ago
drawtext
depends on libfreetype
and is only enabled in packages that include libfreetype
external library.
So, you need to install one of video
, full
or full-gpl
packages using instructions in 2.3 Packages, in order to use drawtext
.
Thanks @tanersener it works now.
Description I want to add text to image file using ffmpeg, I use the following command: RNFFmpeg.execute(
-i ${fileUrl} -filter:v drawtext=text=Neha:fontcolor=black:fontSize=20:x=0:y=30: ${output}
,'').then(this.showLastCommandOutput());Expected behavior It Should give the file with text on image
Current behavior But react-native-ffmpeg raises "No such filter" error when using drawtext filter.
Error Last command output: ffmpeg version v4.2-dev-480 Copyright (c) 2000-2018 the FFmpeg developers built with Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn) configuration: --cross-prefix=arm-linux-androideabi- --sysroot=/files/android-sdk/ndk-bundle/toolchains/mobile-ffmpeg-api-21-arm/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=armv7-a --cpu=armv7-a --target-os=android --disable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-lto --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-iconv --disable-sdl2 --enable-zlib --enable-mediacodec libavutil 56. 25.100 / 56. 25.100 libavcodec 58. 42.104 / 58. 42.104 libavformat 58. 25.100 / 58. 25.100 libavdevice 58. 6.101 / 58. 6.101 libavfilter 7. 46.101 / 7. 46.101 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 Input #0, png_pipe, from '/data/user/0/in.foxy/cache/foxyLogo.png': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, rgba(pc), 252x74, 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (png (native) -> png (native)) Press [q] to stop, [?] for help frame= 0 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A [AVFilterGraph @ 0xb130c6c0] No such filter: 'drawtext' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 Conversion failed!
Other I also tried the ways that listed on issues list of documentation which is: " If your commands include unnecessary quotes or space characters, your command will fail with No such filter: ' ' errors. Please check your command and remove them" Remove extrta quotes from it:
I tried following version of commands:
-i ${fileUrl} -filter:v drawtext=text='Neha':fontcolor=black:fontSize=20:x=0:y=30: ${output}
, ' ', ) 2: RNFFmpeg.execute(-i ${fileUrl} -vf drawtext=text=Neha:fontcolor=black:fontSize=20:x=0:y=30: ${output}
, ' ', )they all work locally when I using ffmpeg on console, but it not woked here at all