You are not logged in.

#1 2023-11-24 09:03:01

rin
Member
Registered: 2013-12-24
Posts: 31

ffmpeg drawtext filter

I'm using a custom `i3lock` command that takes a screenshot of my monitors, blurs them, overlays some "type password to unlock" text, and passes that image to `i3lock -i`
To do the image creation, I'm using ffmpeg.

The script generates quite a long output (mostly because I have 3 monitors):

ffmpeg -f x11grab -draw_mouse 0 -video_size 7680x1440 -y -i :0.0 -i /usr/share/i3lock-fancy/lock.png -filter_complex [0:v]  boxblur=5:5 [out-0]; [out-0][1:v] overlay=1280-overlay_w/2:720-overlay_h/2 [out-1]; [out-1][1:v] overlay=3840-overlay_w/2:720-overlay_h/2 [out-2]; [out-2][1:v] overlay=6400-overlay_w/2:720-overlay_h/2 [out-3]; color=color=white@0:size=800x100, drawtext=text='Type password to unlock':x=(800-text_w)/2+2:y=(100-text_h)/2+2:fontsize=25:fontfile=/usr/share/fonts/TTF/DejaVuSans.ttf:fontcolor=black, drawtext=text='Type password to unlock':x=(800-text_w)/2:y=(100-text_h)/2:fontsize=25:fontfile=/usr/share/fonts/TTF/DejaVuSans.ttf:fontcolor=black, boxblur=2:2 [text-blur]; color=color=white@0:size=800x100, drawtext=text='Type password to unlock':x=(800-text_w)/2+1:y=(100-text_h)/2+1:fontsize=25:fontfile=/usr/share/fonts/TTF/DejaVuSans.ttf:fontcolor=black, drawtext=text='Type password to unlock':x=(800-text_w)/2+1:y=(100-text_h)/2+2:fontsize=25:fontfile=/usr/share/fonts/TTF/DejaVuSans.ttf:fontcolor=black, drawtext=text='Type password to unlock':x=(800-text_w)/2+2:y=(100-text_h)/2+2:fontsize=25:fontfile=/usr/share/fonts/TTF/DejaVuSans.ttf:fontcolor=black, drawtext=text='Type password to unlock':x=(800-text_w)/2:y=(100-text_h)/2:fontsize=25:fontfile=/usr/share/fonts/TTF/DejaVuSans.ttf:fontcolor=white [text-shadow]; [text-blur][text-shadow] overlay [text-0]; [text-0] split [text-0][text-1]; [text-1] split [text-1][text-2]; [out-3][text-0] overlay=1280-overlay_w/2:900-overlay_h/2 [out-4]; [out-4][text-1] overlay=3840-overlay_w/2:900-overlay_h/2 [out-5]; [out-5][text-2] overlay=6400-overlay_w/2:900-overlay_h/2 [out-6] -map [out-6] -vframes 1 /tmp/tmp.BIpix6q0uh.png

But the important part is I'm using a filtergraph with `filter_complex` and passing `drawtext` filter to it, among other things.

Since upgrading from ffmpeg 2:6.0-13 to 2:6.1-1, I get this error from the ffmpeg command:

[AVFilterGraph @ 0x55fae355cc40] No such filter: 'drawtext'

Downgrading ffmpeg fixes the problem.

I read the docs for ffmpeg, and they say: "To enable compilation of this filter, you need to configure FFmpeg with --enable-libfreetype and --enable-libharfbuzz."
I think that libharfbuzz is a recently added dependency for this filter. I noticed that Arch's latest version of ffmpeg doesn't seem to be configured with libharfbuzz.

Am I right in assuming that the missing libharfbuzz is what's causing the problem? If so, my options seem to be:
1. Keep ffmpeg downgraded
2. Use the ffmpeg-full aur package

Any other good solutions?

Is it possible that Arch's ffmpeg will get libharfbuzz added to the configuration any time soon?

Offline

#2 2023-11-24 09:05:59

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: ffmpeg drawtext filter

https://gitlab.archlinux.org/archlinux/ … -/issues/1

Last edited by dogknowsnx (2023-11-26 08:37:22)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

Board footer

Powered by FluxBB