(FFmpeg) Inserire testo in un video

 

Per inserire un testo in un video usando il solito FFmpeg, bisogna avere  il filtro drawtext:

$ ffmpeg -filters | grep drawtext

 

edmond@Debianbox:~$ ffmpeg -filters | grep drawtext
ffmpeg version 0.8.7, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 22 2011 07:59:05 with gcc 4.6.2
  configuration: –prefix=/usr –extra-cflags='-Wall -g ' –cc='ccache cc' –enable-shared –enable-libmp3lame –enable-gpl –enable-nonfree –enable-libdirac –disable-decoder=libdirac –enable-libvorbis –enable-pthreads –enable-libfaac –enable-libxvid –enable-postproc –enable-x11grab –enable-libgsm –enable-libtheora –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libx264 –enable-libspeex –enable-nonfree –disable-stripping –enable-libschroedinger –disable-encoder=libschroedinger –enable-version3 –enable-libopenjpeg –enable-libvpx –enable-librtmp –enable-avfilter –enable-frei0r –enable-libopencv –enable-libfreetype –enable-libvo-aacenc –disable-decoder=amrnb –enable-libvo-amrwbenc –enable-libaacplus –libdir=/usr/lib/i386-linux-gnu –enable-libdc1394 –disable-altivec –disable-armv5te –disable-armv6 –disable-vis –shlibdir=/usr/lib/i386-linux-gnu
  libavutil    51.  9. 1 / 51.  9. 1
  libavcodec   53.  8. 0 / 53.  8. 0
  libavformat  53.  5. 0 / 53.  5. 0
  libavdevice  53.  1. 1 / 53.  1. 1
  libavfilter   2. 23. 0 /  2. 23. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
drawtext         Draw text on top of video frames using libfreetype library.

il comando usato nel video è stato questo:

$ ffmpeg -i input.mp4 -vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='TESTO':fontcolor=white@1.0:fontsize=12:x=00: y=10" -y output.mp4

quella sopra è una buona base di partenza, poi si possono fare anche altre cose con il testo, ma quello sarà un capitolo a parte.

enjoy 😉
 

Autore: Franco Conidi aka edmond

Senior System Integrator, Network Administrator, Sys Admin Linux, Linux User, Consulente Informatico.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *