6

I have used the ffmpeg package to create a wmv file from gif (please see below). The title displays for a few seconds, then disappears. Is there a setting I can apply, in order to have the title appearing in the video throughout the duration?

ffmpeg -i Input.gif -s 300x300 -metadata title="Testing" Output.wmv 

Following the suggestion by Maxito, I have modified the code to

ffmpeg -i Input.gif -vf drawtext="text='Text to write is this one,     overlaid':fontsize=20:fontcolor=red:x=100:y=100" Output_Text.wmv

The following error message was received:

[AVFilterGraph @ 0x100115cc0] No such filter: 'drawtext'
Error opening filters!

This is the version of ffmpeg I used on Mac 10.6.8. Is there a need to re-compile?

ffmpeg version 2.5.3
built on Jan 19 2015 13:08:24 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --arch=x86_64 --enable-runtime-cpudetect
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
llogan
  • 121,796
  • 28
  • 232
  • 243
TTZ
  • 823
  • 2
  • 9
  • 19
  • If by display you mean "in vlc" that's a client/playback thing, not an encoding thing, FWIW – rogerdpack May 12 '15 at 14:33
  • Thanks, @rogerdpack. Is there a way to add a text to the video file that will appear in every frame using ffmpeg? – TTZ May 12 '15 at 14:44
  • 2
    possible duplicate of [Text on video ffmpeg](http://stackoverflow.com/questions/17623676/text-on-video-ffmpeg) – Maxito May 12 '15 at 16:08
  • Looks like now that he's got the command right, the question is about the `AVFilterGraph` error. – Jason Sundram Mar 25 '16 at 21:41

2 Answers2

17

The error with AVFilterGraph and drawtext happens when your ffmpeg is compiled without libfreetype.

To generate images with text, you need to compile ffmpeg with libfreetype. The easiest way to do this is with Homebrew.

Assuming homebrew is already installed:

# If ffmpeg is already installed, you need to uninstall it.
brew uninstall ffmpeg

# you may very well want to specify other options (e.g. --with-faac)
brew install ffmpeg --with-freetype
llogan
  • 121,796
  • 28
  • 232
  • 243
Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
0

You can download a ffmpeg binary for OS X if you don't want to compile. It contains support for libfreetype which is required for drawtext filter.

Users of other OS can get binaries via links on the FFmpeg Download page.

llogan
  • 121,796
  • 28
  • 232
  • 243