Bug#1056597: ffmpeg: drawtext filter missing from ffmpeg binaries

2023-11-28 Thread Leo Butler
The original bug-report expresses doubt about the solution proposed.

As documented here:
https://ffmpeg.org/ffmpeg-all.html#drawtext-1

the build must be configured with both --enable-libfreetype and
--enable-libharfbuzz.

I can confirm that is correct, when building ffmpeg against current git
head.

Leo

ffmpeg started on 2023-11-28 at 15:32:08
Report written to "ffmpeg-20231128-153208.log"
Log level: 48
Command line:
./ffmpeg -y -report -f lavfi -i "testsrc=duration=5:size=hd720:rate=10" -filter_complex "drawtext=fontsize=30:fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:text=\"hello world\":x=(w-text_w)/2:y=(h-text_h)/2" -f mpegts /tmp/out.ts
ffmpeg version N-112875-g47e214245b-3 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Debian 13.2.0-5)
  configuration: --enable-libfreetype --enable-libharfbuzz --enable-libx264 --enable-gpl --prefix=/usr --extra-version=3 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls
  libavutil  58. 32.100 / 58. 32.100
  libavcodec 60. 35.100 / 60. 35.100
  libavformat60. 18.100 / 60. 18.100
  libavdevice60.  4.100 / 60.  4.100
  libavfilter 9. 14.100 /  9. 14.100
  libswscale  7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc57.  4.100 / 57.  4.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.
Reading option '-i' ... matched as output url with argument 'testsrc=duration=5:size=hd720:rate=10'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'drawtext=fontsize=30:fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:text="hello world":x=(w-text_w)/2:y=(h-text_h)/2'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mpegts'.
Reading option '/tmp/out.ts' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option report (generate a report) with argument 1.
Applying option filter_complex (create a complex filtergraph) with argument drawtext=fontsize=30:fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:text="hello world":x=(w-text_w)/2:y=(h-text_h)/2.
[AVFilterGraph @ 0x55677bdf0580] Setting 'fontsize' to value '30'
[AVFilterGraph @ 0x55677bdf0580] Setting 'fontfile' to value '/usr/share/fonts/truetype/freefont/FreeSerif.ttf'
[AVFilterGraph @ 0x55677bdf0580] Setting 'text' to value '"hello world"'
[AVFilterGraph @ 0x55677bdf0580] Setting 'x' to value '(w-text_w)/2'
[AVFilterGraph @ 0x55677bdf0580] Setting 'y' to value '(h-text_h)/2'
Successfully parsed a group of options.
Parsing a group of options: input url testsrc=duration=5:size=hd720:rate=10.
Applying option f (force format) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc=duration=5:size=hd720:rate=10.
[AVFilterGraph @ 0x55677bdf5040] Setting 'duration' to value '5'
[AVFilterGraph @ 0x55677bdf5040] Setting 'size' to value 'hd720'
[AVFilterGraph @ 0x55677bdf5040] Setting 'rate' to value '10'
detected 8 logical cores
[Parsed_testsrc_0 @ 0x55677bdf2240] size:1280x720 rate:10/1 duration:5.00 sar:1/1
[AVFilterGraph @ 0x55677bdf5040] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed
[lavfi @ 0x55677bdf4940] All info found
Input #0, lavfi, from 'testsrc=duration=5:size=hd720:rate=10':
  Duration: N/A, start: 0.00, bitrate: N/A
  Stream #0:0, 1, 1/10: Video: wrapped_avframe, rgb24, 1280x720 [SAR 1:1 DAR 16:9], 10 fps, 10 tbr, 10 tbn
Successfully opened the file.
Parsing a group of options: output url /tmp/out.ts.
Applying option f (force format) with argument mpegts.
Successfully parsed a group of options.
Opening an output file: /tmp/out.ts.
[out#0/mpegts @ 0x55677bdfac40] Creating output stream from unlabeled output of complex filtergraph 0. This overrides automatic video mapping.
[vost#0:0/mpeg2video @ 0x55677bdfbe00] Created video stream from complex filtergraph 0:[drawtext:default]
[vost#0:0/mpeg2video @ 0x55677bdfbe00] 
[out#0/mpegts @ 0x55677bdfac40] No explicit maps, mapping streams automatically...
[file @ 0x55677bdfef80] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
  Stream #0:0 (wrapped_avframe) -> drawtext:default
  drawtext:default -> Stream #0:0 (mpeg2video)
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x55677bdff640] Setting 'fontsize' to value '30'
[AVFilterGraph @ 0x55677bdff640] Setting 'fontfile' to value '/usr/share/fonts/truetype/freefont/FreeSerif.ttf'
[AVFilterGraph @ 0x55677bdff640] Setting 'text' to value '"hello world"'
[AVFilterGraph @ 

Bug#1056597: ffmpeg: drawtext filter missing from ffmpeg binaries

2023-11-23 Thread Slim Joe
Package: ffmpeg
Version: 7:6.1-4
Severity: normal

Dear Maintainer,

The FFmpeg binaries (i.e. ffplay and ffmpeg) no longer
provides the drawtext filter, useful for embedding text (such
as subtitles and time codes) into a video.

Here's a simple test command using a legally available video.

$ ffplay -i 
https://static.fsf.org/nosvn/videos/escape-to-freedom/videos/escape-to-freedom-720p.webm
 -vf "drawtext=x=20:y=20:fontsize=24:fontcolor=gold:text='%{localtime \: %T 
%Z%n(%F)}'"

The relevant portion of stderr from this command is this:

[AVFilterGraph @ 0x7f6ae4003e40] No such filter: 'drawtext'
[AVFilterGraph @ 0x7f6ae4003e40] Error processing filtergraph: Filter not found

A shallow search for a similar bug turns up the following link
from the ArchLinux bug tracker ("drawtext filter not available",
dated "Wednesday, 22 November 2023, 15:17 GMT"):

https://bugs.archlinux.org/task/80327

The recommended solution is to recompile FFmpeg with the
"--enable-libharfbuzz" option. There is a libharfbuzz-dev
package in Debian, so this should not be a problem (assuming
the ArchLinux bug report is correct).

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (900, 'testing'), (90, 'unstable')
Architecture: amd64 (x86_64)

Versions of packages ffmpeg depends on:
ii  libavcodec607:6.1-3
ii  libavdevice60   7:6.1-3
ii  libavfilter97:6.1-3
ii  libavformat60   7:6.1-3
ii  libavutil58 7:6.1-3
ii  libc6   2.37-12
ii  libpostproc57   7:6.1-3
ii  libsdl2-2.0-0   2.28.5+dfsg-2
ii  libswresample4  7:6.1-3
ii  libswscale7 7:6.1-3