[FFmpeg-user] FFMPEG not using GPU/CUDA

Mahmood Naderan mahmood.nt at gmail.com
Wed Jan 23 20:46:55 EET 2019


Excuse me, the following command

./ffmpeg -hwaccel nvdec -i ........

utilizes GPU.
Is that all I was looking for?


$ ./ffmpeg -hwaccel nvdec -i ../fast_video.mp4 -preset medium -movflags
+faststart -c:a aac ../fast_video_conv.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-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 '../fast_video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:01:18.35, start: 0.000000, bitrate: 8249 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 8239 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), 48000 Hz,
stereo, fltp, 2 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Codec AVOption preset (Set the encoding preset) specified for output file
#0 (../fast_video_conv.mp4) has not been used for any stream. The most
likely reason is either wrong type (e.g. a video option with no video
streams) or that it is a private option of some encoder which was not
actually used for any stream.
File '../fast_video_conv.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to '../fast_video_conv.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.100
    Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 1920x1080
[SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.44.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.44.100 aac
[mp4 @ 0x561bd68d6ac0] Starting second pass: moving the moov atom to the
beginning of the file
frame= 2348 fps=158 q=31.0 Lsize=   40272kB time=00:01:18.31
bitrate=4212.8kbits/s speed=5.26x
video:40182kB audio:22kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.169521%
[aac @ 0x561bd68d7d40] Qavg: 65536.000




Regards,
Mahmood




On Wed, Jan 23, 2019 at 10:13 PM Mahmood Naderan <mahmood.nt at gmail.com>
wrote:

> So, I think the command should be similar to this
>
> ./ffmpeg -i ../fast_video.mp4 h264_nvenc -preset medium -movflags
> +faststart -c:a aac ../fast_video_conv.mp4
>
> but that fails
>
> [NULL @ 0x558bd7fcadc0] Unable to find a suitable output format for
> 'h264_nvenc'
> h264_nvenc: Invalid argument
>
>
> Regards,
> Mahmood
>
>


More information about the ffmpeg-user mailing list