[FFmpeg-user] Low GPU utilization

Mahmood Naderan mahmood.nt at gmail.com
Thu Jan 24 09:13:58 EET 2019


Guys, I tried the example from Nvidia website [1] for "Transcode a single
video file" in order to trranscode a 4K video to a 4K video.


$ ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i ../4k_normal.mp4 -vf
scale_npp=3840:2160 -c:v h264_nvenc 4k.mp4
ffmpeg version N-93005-gd92f06eb66 Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --enable-cuda --enable-cuvid --enable-nvenc
--enable-nonfree --enable-filter=scale_cuda --enable-cuda-sdk
--enable-libnpp --extra-cflags=-I/usr/local/cuda/include
--extra-ldflags=-L/usr/local/cuda/lib64
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../4k_normal.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
  Duration: 00:01:31.91, start: 0.000000, bitrate: 32684 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
3840x2160 [SAR 1:1 DAR 16:9], 32482 kb/s, 29.97 fps, 29.97 tbr, 30k tbn,
59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 195 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
File '4k.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to '4k.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.100
    Stream #0:0(und): Video: h264 (h264_nvenc) (Main) (avc1 / 0x31637661),
cuda, 3840x2160 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 29.97 fps, 30k tbn,
29.97 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.44.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay:
-1
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.44.100 aac
frame= 2760 fps=111 q=37.0 Lsize=   25235kB time=00:01:32.05
bitrate=2245.6kbits/s dup=5 drop=0 speed=3.72x
video:23717kB audio:1441kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.307457%
[aac @ 0x55e602553980] Qavg: 135.844




That utilizes GPU for about 20%. Is that all? Or there are some options for
better using GPU?

[1] https://developer.nvidia.com/ffmpeg



Regards,
Mahmood




On Thu, Jan 24, 2019 at 10:25 AM Mahmood Naderan <mahmood.nt at gmail.com>
wrote:

> >You're only using the GPU for decoding. (The "dec" in "nvdec" hints at
> >this.) The GPU probably idling, while the CPU encoding is the bottleneck.
>
> Even for encoding, I see 10% GPU utilization
>
> ./ffmpeg -i ../4k_normal.mp4 -c:v h264_nvenc 4k.mp4
>
>
> Regards,
> Mahmood
>
>
>
>
>


More information about the ffmpeg-user mailing list