[FFmpeg-trac] #4008(avfilter:new): "main_w" value unrecognized with the new "enable" option in Drawtext
FFmpeg
trac at avcodec.org
Mon Oct 6 00:15:34 CEST 2014
#4008: "main_w" value unrecognized with the new "enable" option in Drawtext
-------------------------------------+------------------------------------
Reporter: beloko | Owner:
Type: defect | Status: new
Priority: important | Component: avfilter
Version: unspecified | Resolution:
Keywords: drawtext | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+------------------------------------
Comment (by beloko):
Hello Cehoyos,
To build my binary I get the FFMPEG source code from this URL :
https://github.com/FFmpeg/FFmpeg.git
Should I use another repositery to get a fresh FFmpeg source code ?
Here is my complete command with the full failling command :
{{{
C:\Users\Beloko\Desktop\FFMPEG>ffmpeg.exe -i
"C:\Users\BelokoZ\Desktop\bunny.avi" -threads 0 -vcodec libx264 -s 1
920x1080 -b:v 4096k -maxrate 4096k -bufsize 4096k -r 25 -filter:v
"drawtext=font
file='/Users/Beloko/Desktop/FFMPEG/arial.ttf':text
='HELLO
TEXT':fontsize=47:fontcolor=yellow:x=(main_w/2-text_w/2):y=(main_h/2-tex
t_h/2):enable=gte(main_w\,700)*lte(main_w\,1200)*lt(mod(t\,8)\,6)"
-vprofile bas
eline -f mpegts big_bunny.ts
ffmpeg version N-66568-g81cee70 Copyright (c) 2000-2014 the FFmpeg
developers
built on Sep 04 2014 15:37:25 with gcc 4.7.2 (GCC)
configuration: --arch=x86_64 --target-os=mingw32 --cross-
prefix=/home/beloko/s
andbox/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config
--enable
-gpl --enable-libx264 --enable-avisynth --enable-libxvid --enable-
libmp3lame --e
nable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-
libthe
ora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm
--ena
ble-libfreetype --enable-libopus --disable-w32threads --enable-frei0r
--enable-f
ilter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs
--extra-cflag
s=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopencore-amrwb
--ena
ble-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-
libilbc --p
refix=/home/beloko/sandbox/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-
static -
-disable-shared --enable-libsoxr --enable-fontconfig --enable-libass
--enable-li
butvideo --enable-libbluray --enable-iconv --enable-libtwolame --extra-
cflags=-D
LIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug
--extra-
libs=-lstdc++ --extra-libs=-lpng --enable-libx265 --extra-cflags= --extra-
cflags
= --enable-nonfree --enable-libfdk-aac --disable-libfaac --disable-
decoder=aac -
-enable-runtime-cpudetect
libavutil 54. 7.101 / 54. 7.101
libavcodec 56. 1.102 / 56. 1.102
libavformat 56. 7.102 / 56. 7.102
libavdevice 56. 1.100 / 56. 1.100
libavfilter 5. 1.102 / 5. 1.102
libswscale 3. 1.100 / 3. 1.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 1.100 / 53. 1.100
Input #0, avi, from 'C:\Users\Beloko\Desktop\bunny.avi':
Metadata:
encoder : AVI-Mux GUI 1.17.7, Aug 8 2006 20:59:17
JUNK :
Duration: 00:09:56.46, start: 0.000000, bitrate: 12455 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46),
yuv420p, 192
0x1080 [SAR 1:1 DAR 16:9], 12001 kb/s, 24 fps, 24 tbr, 24 tbn, 24 tbc
Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side),
fltp, 44
8 kb/s
[drawtext @ 00000000003b6c00] [Eval @ 000000000022ac90] Unknown function
in 'mai
n_w,1200)*lt(mod(t,8),6)'
[drawtext @ 00000000003b6c00] Error when evaluating the expression
'gte(main_w,7
00)*lte(main_w,1200)*lt(mod(t,8),6)' for enable
[AVFilterGraph @ 000000000031af20] Error initializing filter 'drawtext'
with arg
s 'fontfile=/Users/Beloko/FFMPEG/arial.ttf
:text=HELLO
TEXT:fontsize=47:fontcolor=yellow:x=(main_w/2-text_w/2):y=(main_h/2-
text_h/2):enable=gte(main_w,700)*lte(main_w,1200)*lt(mod(t,8),6)'
Error opening filters!
}}}
In my FFMPEG command, you can replace "main_w" with another value like 800
for the "enable" option and you'll see my FFMPEG command works perfectly.
Problem is "enable" option doesn't support all "draw" option values like
"main_w" or "main_h".
:enable=gte('''main_w'''\,700)*lte('''main_w'''\,1200)*lt(mod(t\,8)\,6)
becomes
:enable=gte('''800'''\,700)*lte('''800'''\,1200)*lt(mod(t\,8)\,6)
--
Ticket URL: <https://trac.ffmpeg.org/ticket/4008#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list