-1

I guess command is not working properly here.

I am using this project

-y -i /storage/emulated/0/DCIM/Camera/VID_20190623_153948.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/DejaVuSans.ttf: text='Stack' " /storage/emulated/0/DCIM/Camera/output2.mp4

The result expected is the video which I am giving as input should be processed and it should contain text Stack in it

j.doe
  • 662
  • 4
  • 19

1 Answers1

0

drawText's fontfile should have an absolute path of the font file. Your command says the font file's path is /usr/share/fonts/truetype/DejaVuSans.ttf, I believe that's not the case as you running from android. It should be some file from android storage.

Example:

drawtext=fontfile=/storage/emulated/0/fonts/truetype/DejaVuSans.ttf

if DejaVuSans.ttf file is under /storage/emulated/0/fonts/truetype/ directory in your android device.

minhazur
  • 4,928
  • 3
  • 25
  • 27
  • I don't have any font file on my device is it just issue of font file and whether can i remove it from the command..?? – Chaula Manek Jun 26 '19 at 06:04
  • if I am removing all the properties defined for font then it is showing error initializing filter drawtext with args 'text=Stack' -y -i /storage/emulated/0/DCIM/Camera/VID_20190623_153948.mp4 -vf drawtext=text='Stack' -codec:a copy /storage/emulated/0/DCIM/Camera/output2.mp4 – Chaula Manek Jun 26 '19 at 06:09
  • not sure whether your FFmpeg support drawtext filter. To enable compilation of this filter, you need to configure FFmpeg with `--enable-libfreetype`. To enable default font fallback and the font option you need to configure FFmpeg with `--enable-libfontconfig`. To enable the text_shaping option, you need to configure FFmpeg with `--enable-libfribidi`. – minhazur Jun 26 '19 at 06:29
  • how can configure ffmpeg with --enable-libfreetype,--enable-libfontconfig and --enable-libfribidi in android ..?? – Chaula Manek Jun 26 '19 at 06:35
  • you have to recompile it with that. – minhazur Jun 26 '19 at 06:50
  • but i am unable to find the way in which it can be done please write proper steps for the same that may help me to get through this. – Chaula Manek Jun 26 '19 at 06:54
  • FFmpeg compilation is a bit tricky, I suggest you first try it for your desktop and run some command on desktop. Then try it for android. Here are a few references https://trac.ffmpeg.org/wiki/CompilationGuide/macOS https://medium.com/@karthikcodes1999/cross-compiling-ffmpeg-4-0-for-android-b988326f16f2 https://hackernoon.com/android-ndk-my-experience-with-ffmpeg-93dd7e4b9269 – minhazur Jun 26 '19 at 07:00
  • Let me know, how it goes... it may seem a bit daunting first, but gets easier as it goes. – minhazur Jun 26 '19 at 07:13
  • i am unable to do that please guide me with regards to the project that i have mentioned in above link..!! – Chaula Manek Jun 26 '19 at 09:36
  • Steps you can follow 1. use writing mind's library as source 2. Recompile ffmpeg for android with necessary configs to generate `so` files 3. replace `so` files from writing mind's library with the new ones. 4. Modify writing minds source code as needed. – minhazur Jun 27 '19 at 05:01
  • how can i recompile it in android ..?? – Chaula Manek Jun 27 '19 at 08:41
  • Here are a few references https://trac.ffmpeg.org/wiki/CompilationGuide/macOS https://hackernoon.com/android-ndk-my-experience-with-ffmpeg-93dd7e4b9269 https://medium.com/@karthikcodes1999/cross-compiling-ffmpeg-4-0-for-android-b988326f16f2 – minhazur Jun 27 '19 at 08:54
  • I directly want solution for android and that too working with this writing mind's library. if you have exact idea of how that can be done in android then please help me with this thing – Chaula Manek Jun 27 '19 at 12:15