1

I have 500 MB video file which I am converting to MP4 format.

My laptop is i7 and 16 GB Memory and ffmpeg is able to convert the file. Command used is as follows:

ffmpeg.exe -i  "a.mp4" -c:v  libx264  -crf  35  -preset  ultrafast  "b.mp4"

On Azure , I have D series machine with 8 core and 32 GB. Memory used is 14% only. at this time, when I run this command , after certain time I get following error.

Is there any other fine tuning required on azure VM?

out:


err: ffmpeg version N-102630-g51f1194eda Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10-win32 (GCC) 20210408
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  1.100 / 59.  1.100
  libavformat    59.  2.101 / 59.  2.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.101 /  8.  0.101
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2013-11-27T01:38:48.000000Z
  Duration: 00:17:38.00, start: 0.040000, bitrate: 1972 kb/s
  Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuvj420p(pc, bt709), 1920x1080, 1971 kb/s, 25 fps, 25 tbr, 1250 tbn (default)
    Metadata:
      creation_time   : 2013-11-27T01:38:48.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 00000253f18aa780] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
[libx264 @ 00000253f18aa780] profile Constrained Baseline, level 4.0, 4:2:0, 8-bit
[libx264 @ 00000253f18aa780] 264 - core 161 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=35.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'b.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.2.101
  Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 25 fps, 12800 tbn (default)
    Metadata:
      creation_time   : 2013-11-27T01:38:48.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.1.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=26450 fps=256 q=-1.0 Lsize=  331714kB time=00:17:37.96 bitrate=2568.5kbits/s speed=10.2x
video:331604kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.032993%
[libx264 @ 00000253f18aa780] frame I:106   Avg QP:31.17  size:143921
[libx264 @ 00000253f18aa780] frame P:26344 Avg QP:34.09  size: 12310
[libx264 @ 00000253f18aa780] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 00000253f18aa780] mb P  I16..4:  1.3%  0.0%  0.0%  P16..4: 17.5%  0.0%  0.0%  0.0%  0.0%    skip:81.2%
[libx264 @ 00000253f18aa780] coded y,uvDC,uvAC intra: 48.5% 8.5% 1.4% inter: 8.1% 0.3% 0.0%
[libx264 @ 00000253f18aa780] i16 v,h,dc,p: 16% 30% 41% 13%
[libx264 @ 00000253f18aa780] i8c dc,h,v,p: 66% 17% 15%  2%
[libx264 @ 00000253f18aa780] kb/s:2567.58
Not enough memory resources are available to process this command.
2
  • Try running top/htop alongside ffmpeg and watch for the usage, and does your laptop have a dGPU? If yes, this error is linked to the fact that that VM has to do software encoding which is way more ressource hogging Commented Aug 22, 2021 at 18:31
  • This is windows machine top/htop not available, I check task manager, resource utilization was minimum. Then I reduced the CRF to 45 and it got processed
    – Gaurav
    Commented Aug 26, 2021 at 10:02

0

You must log in to answer this question.

Browse other questions tagged .