Opened 9 years ago

Last modified 8 years ago

#3910 new enhancement

uspp filter using a lot memory

Reported by: mike Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: uspp mpfilter snow
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)


Trying to filter video by uspp and fixed qp, it taking almost all memory in my computer, it is imposible for me to filter in good resolution. I would like to see some improvments over memory usage in this filter, to be able filter 4k video with 8GB memory.

How to reproduce:

  • filtering single impage 1920:1080 need about 5GB memory:

ffmpeg.exe -i test.png -vf mp=uspp=7:6 out.png

  • filtering video 1920:1080 need about 6GB memory:

ffmpeg.exe -loop 1 -i test.png -r 25 -t 00:00:30 -vf mp=uspp=7:6 out.avi

  • filtering video in 2560:1440 resolution need about 10GB memory:

ffmpeg.exe -loop 1 -i test.png -r 25 -t 00:00:30 -vf scale=-1:1440,mp=uspp=7:6 out.avi

  • filtering video in 3840:2160 resolution ...

i do not have that much memory ....

Some log from filtering single image:

C:\inne>ffmpeg.exe -i test.png -vf mp=uspp=7:6 out.png
ffmpeg version N-65991-g8c63a0d Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 30 2014 22:10:41 with gcc 4.8.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, image2, from 'test.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1080 [SAR 2835:2835 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[Parsed_mp_0 @ 0000000002afaae0] 'uspp' is a wrapped MPlayer filter (libmpcodecs). This filter may be removed once it has been ported to a native libavfilter.
Output #0, image2, to 'out.png':
    encoder         : Lavf56.3.100
    Stream #0:0: Video: png, rgb24, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
      encoder         : Lavc56.1.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> png (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:56kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Attachments (1)

test.png (19.5 KB ) - added by mike 9 years ago.
test file

Download all attachments as: .zip

Change History (4)

by mike, 9 years ago

Attachment: test.png added

test file

comment:1 by Carl Eugen Hoyos, 9 years ago

Description: modified (diff)
Keywords: snow added

One third of the memory allocations happen in ff_snow_common_init(), another third in ff_snow_common_init_after_header().

comment:2 by Elon Musk, 8 years ago

IMHO this is not possible, buy more memory.

comment:3 by mike, 8 years ago

I now have 32GB of RAM (max for desktop motherboard for now) and is still too low,
I have seen many improvements to encoder and it's a bit better than before,
was wondering why it need to allocate so much memory, it looks like for one frame it alocate long buffer in the encoder

Note: See TracTickets for help on using tickets.