Hello,
I am trying to test adding timestamp to a recorded video using ffmpeg6 using
the following:
ffmpeg6 -i recording.mp4 -vf
drawtext="fontsize=60:fontcolor=yellow:text='%{localtime}':x=(w-text_w):y=(h-text_h)"
timestamped-recording.mp4
on
uname -a
NetBSD test.Home 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024
mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
However, I get the below result instead:
[AVFilterGraph @ 0x7eb5fb57f580] No such filter: 'drawtext'
[vost#0:0/libx264 @ 0x7eb5fb53a500] Error initializing a simple filtergraph
Error opening output file timestamped-recording.mp4.
Which points toward an issue with the drawtext filter. I have checked and my
version of ffmpeg6 is compiled with the --enable-libfreetype flag by default,
which is required for the drawtext filter:
https://ayosec.github.io/ffmpeg-filters-docs/3.3.9/Filters/Video/drawtext.html
My compiled options:
ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10.5.0 (nb3 20231008)
configuration: --enable-avfilter --enable-postproc --disable-ffplay
--enable-rpath --enable-fontconfig --enable-libfreetype --enable-libass
--enable-libaom --disable-librav1e --enable-libdav1d --disable-htmlpages
--enable-gnutls --disable-mbedtls --disable-libopencore-amrnb
--disable-libopencore-amrwb --disable-openssl --disable-libjack
--disable-libpulse --disable-libtesseract --enable-libtheora
--enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libspeex
--enable-libxvid --enable-libx264 --enable-libx265 --enable-vdpau
--enable-vaapi --enable-libvpx --enable-libwebp --enable-libxcb
--enable-libxcb-shape --enable-libxcb-shm --enable-libxcb-xfixes
--enable-libbluray --arch=x86_64 --cc=gcc --disable-debug
--disable-optimizations --disable-stripping --enable-gpl --enable-libxml2
--enable-pthreads --enable-shared --mandir=/usr/pkg/man --prefix=/usr/pkg
--progs-suffix=6 --enable-runtime-cpudetect --datadir=/usr/pkg/share/ffmpeg6
--docdir=/usr/pkg/share/doc/ffmpeg6 --incdir=/usr/pkg/include/ffmpeg6
--libdir=/usr/pkg/lib/ffmpeg6 --shlibdir=/usr/pkg/lib/ffmpeg6
I also tried the original command while specifying a font file using:
-vf
drawtext="/usr/pkg/share/texmf-dist/fonts/truetype/public/gnu-freefont/FreeSerif.ttf:
fontcolor=yellow:text='%{localtime}':x=(w-text_w):y=(h-text_h)"
and get the following:
[AVFilterGraph @ 0x7ed38f266580] No option name near
'/usr/pkg/share/texmf-dist/fonts/truetype/public/gnu-freefont/FreeSerif.ttf:
fontcolor=yellow:text=%{localtime}:x=(w-text_w):y=(h-text_h)'
[AVFilterGraph @ 0x7ed38f266580] Error parsing a filter description around:
[AVFilterGraph @ 0x7ed38f266580] Error parsing filterchain
'drawtext=/usr/pkg/share/texmf-dist/fonts/truetype/public/gnu-freefont/FreeSerif.ttf:
fontcolor=yellow:text='%{localtime}':x=(w-text_w):y=(h-text_h)' around:
[vost#0:0/libx264 @ 0x7ed38f221500] Error initializing a simple filtergraph
Error opening output file timestamped-recording.mp4.
Error opening output files: Invalid argument
There is probably a simple fix to this, or something that I have overlooked,
but I am quite challenged to find it. Has anyone run into anything similar or
has any advice as to how to get this working?
Thank you very much!
Michael