When I attempt to execute the following:
ffmpeg -f lavfi -i mandelbrot=s=7680x4320:r=60 -vf "[in]drawtext=DejaVuSansMono-Bold.ttf: text='mandelbrot-libvpx-vp9-7680x4320x60p': fontcolor=white: fontsize=72: box=1: [email protected]: boxborderw=5: x=(w-text_w)/2:y=h-th-100, drawtext=DejaVuSansMono-Bold.ttf:text='-0-yuv420p-75.webm': fontcolor=white: fontsize=72: box=1: [email protected]: boxborderw=5:x=(w-text_w)/2:y=h-th-25[out]" -c:v libvpx-vp9 -profile:v 0 -b:v 75M -minrate 75M -maxrate 75M -bufsize 150M -pix_fmt yuv420p -framerate 60 -t 10 -y mandelbrot-libvpx-vp9-7680x4320x60p-0-yuv420p-75.webm
I see
ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat
59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 [lavfi @ 0x7fb33dd11f00] Error initializing filter 'mandelbrot' with args 's=7680x4320:r=60' mandelbrot=s=7680x4320:r=60: Cannot allocate memory
I found in this source: https://ffmpeg.org/doxygen/3.2/vsrc__mandelbrot_8c_source.html, that "s->cache_allocated = s->w * s->h * 3;" Perhaps, that means 100MB is needed per image?
Is this an issue with ffmpeg, or this particular filter or do I need more memory than the 16GB my Mac provides?
s->point_cache= av_malloc_array(s->cache_allocated, sizeof(*s->point_cache))
. Size of Point is at least 22 bytes.s->point_cache =
7680*4320*3*22` =2189721600
. The size is grater than MAX_INT (2147483647
). It looks likeav_malloc_array
is limited to MAX_INT size (I don't know if the limitation is a bug). In case you want to fix the sources... replaceav_malloc_array
withmalloc
.