[FFmpeg-user] hwaccel cuvid with filters

Guido Holz guido.holz at googlemail.com
Thu Apr 19 19:08:33 EEST 2018


Hi all,

have a question of how to use in a correct way the hwaccel of nvidia. I get
the error "cuda is not supported as input pixel format". I didn't find help
how to use hwaccel with filters.
Maybe someone can explain how to use in filters?

Many thanks!

the following works:
ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -i Input.ts -t 3 -c:v h264_nvenc
-profile:v main -level 3.1 -crf 22  output.mp4


doesn't work:
ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -i Input.ts -t 3
-filter_complex_script filter.txt  c:v h264_nvenc -profile:v main -level
3.1 -crf 22  output.mp4

filter.txt:
color=black:960x540[c];
[c]drawtext=fontfile=CUTE.ttf:
  fontsize=50:
  text='NAME':
  fontcolor=white:
  x=80:
  y=400,
drawtext=fontfile=CUTE.ttf:
  fontsize=50:
  text='GO':
  fontcolor=white:
  x=120:
  y=330,
split[text][alpha];
[text][alpha]alphamerge[txta];
[txta]perspective=
 x0=256:
  y0=306:
  x1=575:
  y1=306:
  x2=0:
  y2=H:
  x3=W:
  y3=H:
  sense=1[persp];
[persp][0]blend=
  all_mode='softlight'


And the error is on bottom:

ffmpeg version 3.2.4-tessus Copyright (c) 2000-2017 the FFmpeg developers

  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609

  configuration: --prefix=/usr/local/ --extra-version=tessus
--enable-avisynth --enable-fontconfig --enable-gpl --enable-libass
--enable-libfreetype --enable-libgsm --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopus --enable-libschroedinger --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxvid
--enable-version3 --disable-ffplay --disable-indev=qtkit
--disable-indev=x11grab_xcb --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      55. 34.101 / 55. 34.101

  libavcodec     57. 64.101 / 57. 64.101

  libavformat    57. 56.101 / 57. 56.101

  libavdevice    57.  1.100 / 57.  1.100

  libavfilter     6. 65.100 /  6. 65.100

  libswscale      4.  2.100 /  4.  2.100

  libswresample   2.  3.100 /  2.  3.100

  libpostproc    54.  1.100 / 54.  1.100

Input #0, mpegts, from 'DEFAULT/PREROLL.ts':

  Duration: 00:00:03.00, start: 1.480000, bitrate: 1728 kb/s

  Program 1

    Metadata:

      service_name    : Service01

      service_provider: FFmpeg

    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 960x540 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn,
50 tbc

Codec AVOption crf (Select the quality for constant quality mode) specified
for output file #0 (PREROLL_TMP/GUIDO.ts) 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.

Output #0, mpegts, to 'PREROLL_TMP/GUIDO.ts':

  Metadata:

    encoder         : Lavf57.56.101

    Stream #0:0: Video: h264 (h264_nvenc) (Main), yuv420p, 960x540 [SAR 1:1
DAR 16:9], q=-1--1, 2000 kb/s, 25 fps, 90k tbn, 25 tbc

    Metadata:

      encoder         : Lavc57.64.101 h264_nvenc

    Side data:

      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay:
-1

Stream mapping:

  Stream #0:0 (h264_cuvid) -> blend:bottom

  blend -> Stream #0:0 (h264_nvenc)

Press [q] to stop, [?] for help

[graph 0 input from stream 0:0 @ 0x31e7b20] Changing frame properties on
the fly is not supported by all filters.

[swscaler @ 0x3220cc0] cuda is not supported as input pixel format

Failed to inject frame into filter network: Invalid argument

Conversion failed!


More information about the ffmpeg-user mailing list