How to assessment the memory will use when motion interpolation on a 4k video?
Hi all I have a 4k video, resolution: 4320x2880, as a result form EDSR-pytorch -------------------------------------------------------------------------------------------- ffprobe -i 720_x4.mp4 ffprobe version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '720_x4.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.83.100 Duration: 00:00:03.00, start: 0.000000, bitrate: 9673 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4320x2880, 9669 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler -------------------------------------------------------------------------------------------- I want to use motion interpolate it to 60fps, so command like this: ffmpeg -i test.mp4 -filter "minterpolate=fps=60" output.mp4 -------------------------------------------------------------------------------------------- ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '720_x4.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.83.100 Duration: 00:00:03.00, start: 0.000000, bitrate: 9673 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4320x2880, 9669 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [Parsed_minterpolate_0 @ 0x5557bfb57540] Failed to configure input pad on Parsed_minterpolate_0 Error reinitializing filters! Failed to inject frame into filter network: Cannot allocate memory Error while processing the decoded data for stream #0:0 Conversion failed! -------------------------------------------------------------------------------------------- It always failed with "Cannot allocate memory", so my question: How to assessment the memory usuage for that operation? Thanks first. //dengke
Hi,
Hi all I have a 4k video, resolution: 4320x2880, as a result form EDSR-pytorch
Duration: 00:00:03.00, start: 0.000000, bitrate: 9673 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4320x2880, 9669 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
As far as bitrate goes, ballpark estimate, counting uncompressed y’uv 4:2:0 8 bpc as 3/2 bytes per pixel (luma is just 1 byte, for chroma, 1 byte over 4 pixels per channel => 1 + (1/4)*2 => around 3/2 bytes per pixel) you have around 4000 × 3000 = 12,000,000 pixels per frame, 12MP × 3/2 B = 18MB per frame, 25 fps input so 500MB/s or 4Gbps.
I want to use motion interpolate it to 60fps, so command like this: ffmpeg -i test.mp4 -filter "minterpolate=fps=60" output.mp4
It always failed with "Cannot allocate memory", so my question: How to assessment the memory usuage for that operation?
On the other hand interpolation involves making frames up by referencing other frames close by (time-wise) so with only 3 seconds input nearly all of them might be kept in memory, plus the interpolated frames to be encoded. And with the filtering/decoding/encoding all being multithreaded, I think it would take maybe 1.5×(# of cores) GB or some multiple of that from the start.
ffprobe version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2007-2019 the FFmpeg developers
Could be something else though. Does the same command work on lower data rate movies? Try using a newer a newer build as well. Regards, Ted Park
Am Do., 26. März 2020 um 12:28 Uhr schrieb Du Dengke <pinganddu90@gmail.com>:
I have a 4k video, resolution: 4320x2880, as a result form EDSR-pytorch
I want to use motion interpolate it to 60fps, so command like this: ffmpeg -i test.mp4 -filter "minterpolate=fps=60" output.mp4 -------------------------------------------------------------------------------------------- ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '720_x4.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.83.100 Duration: 00:00:03.00, start: 0.000000, bitrate: 9673 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4320x2880, 9669 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [Parsed_minterpolate_0 @ 0x5557bfb57540] Failed to configure input pad on Parsed_minterpolate_0 Error reinitializing filters! Failed to inject frame into filter network: Cannot allocate memory Error while processing the decoded data for stream #0:0 Conversion failed! --------------------------------------------------------------------------------------------
It always failed with "Cannot allocate memory", so my question: How to assessment the memory usuage for that operation?
Please test current FFmpeg git head before reporting issues. Carl Eugen
participants (3)
-
Carl Eugen Hoyos -
Du Dengke -
Ted Park