I am using FFmpeg on andriod and the following is the configuration :

    ffmpeg version 2.8.2 Copyright (c) 2000-2015 the FFmpeg developers built
 with Apple LLVM version 7.0.0 (clang-700.1.76) configuration: --prefix=/usr
/local/Cellar/ffmpeg/2.8.2 --enable-shared --enable-pthreads --enable-gpl
 --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang
 --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-
libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype
 --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable-
libfdk-aac --enable-libopus --enable-libquvi --enable-libx265 --enable-
nonfree --enable-vda
    libavutil 54. 31.100 / 54. 31.100
    libavcodec 56. 60.100 / 56. 60.100
    libavformat 56. 40.101 / 56. 40.101
    libavdevice 56. 4.100 / 56. 4.100
    libavfilter 5. 40.101 / 5. 40.101
    libavresample 2. 1. 0 / 2. 1. 0
    libswscale 3. 1.101 / 3. 1.101
    libswresample 1. 2.101 / 1. 2.101
    libpostproc 53. 3.100 / 53. 3.100
    Hyper fast Audio and Video encoder

I am currently adding a Text and background using the following command :

ffmpeg -y -i input.mp4 -vf "drawbox=enable='between(t,2,6)':y=ih-ih/4:color=black@0.5:width=iw:height=56:t=max",\ "drawtext=enable='between(t,2,6)':fontfile=roboto.ttf:y=h-h/4+10:x=20:text='Test Heading':fontcolor=white:fontsize=16,drawtext=enable='between(t,2,6)':fontfile=roboto.ttf:y=h-h/4+30:x=20:text='Test sub heading':fontcolor=white:fontsize=12" -acodec copy output.mp4

I have tried very hard looking for an option to fade in and fade out the text and the box but can't seem to find a solution. Any help is much appreciated

  • Hmm maybe you can check something like ffmpeg -i input.avi -vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='TEXT':fontcolor=white@0.8:, fade=in:0:80" -y output.avi and also look this question for more info: video.stackexchange.com/questions/14924/… If you find a solution please share even by auto-replying :D – user3450548 Nov 18 '15 at 13:31
  • That does not work, I get a error saying - [Parsed_drawtext_0 @ 0x7fc880436b80] Could not load font "/usr/share/fonts/truetype/freefont/FreeSerif.ttf": cannot open resource [AVFilterGraph @ 0x7fc880422940] Error initializing filter 'drawtext' with args 'fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=TEXT:fontcolor=white@0.8' Error opening filters! – LostPuppy Nov 18 '15 at 18:50
  • man I copied you that as example... I assumed you know know a bit of ffmpeg syntax and also you was able to change that font with one other else that you would like to use.. in your case based on your previous example you can use fontfile=roboto.ttf ;D – user3450548 Nov 18 '15 at 23:33
  • Apologies... I copied the wrong output from the console...I was in a hurry. How stupid of me. I was having errors just using the fade=in:0:80.... and my intention in copying the console output was so you can tell me if I had to recompile ffmpeg with someother configuration. I do know enough to change the font. My apologies – LostPuppy Nov 19 '15 at 18:12
  • This is currently not possible because drawbox filter doesn't support alpha formats. Once it supports it, it should be doable with fade and overlay combination. – Paul B. Mahol Feb 15 '16 at 10:46

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.