[Cin] OpenCL again

Andrea paz gamberucci.andrea at gmail.com
Mon Feb 13 17:21:03 CET 2023


I tried using your command line (with one of my mp4 files) and
everything seems to work (with another mp4 I had filters error):

$ ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i
~/mixkit-worried-and-sad-woman-outdoors-8739.mp4 -vf "hwupload,
boxblur_opencl,hwdownload,format=yuv420p" -f null /dev/null
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static
--disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm
--enable-lto --enable-fontconfig --enable-gmp --enable-gnutls
--enable-gpl --enable-ladspa --enable-libaom --enable-libass
--enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm
--enable-libfreetype --enable-libfribidi --enable-libgsm
--enable-libiec61883 --enable-libjack --enable-libmfx
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr
--enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1
--enable-libtheora --enable-libv4l2 --enable-libvidstab
--enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2
--enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc
--enable-opencl --enable-opengl --enable-shared --enable-version3
--enable-vulkan
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[AVHWDeviceContext @ 0x55ca3888f340] QSV to OpenCL mapping not usable.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/home/paz/mixkit-worried-and-sad-woman-outdoors-8739.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: isomavc1mp42
    creation_time   : 2020-06-21T18:53:40.000000Z
  Duration: 00:00:15.00, start: 0.000000, bitrate: 24801 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661),
yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24798
kb/s, 24 fps, 24 tbr, 24k tbn (default)
    Metadata:
      creation_time   : 2020-06-21T18:53:40.000000Z
      handler_name    : ETI ISO Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Elemental H.264
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: isomavc1mp42
    encoder         : Lavf59.27.100
  Stream #0:0(und): Video: wrapped_avframe, yuv420p(tv, bt709,
progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 24 fps,
24 tbn (default)
    Metadata:
      creation_time   : 2020-06-21T18:53:40.000000Z
      handler_name    : ETI ISO Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 wrapped_avframe
frame=  360 fps=0.0 q=-0.0 Lsize=N/A time=00:00:15.00 bitrate=N/A speed=15.4x
video:166kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown


Or, creating a new mkv file:

$ ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i
~/mixkit-worried-and-sad-woman-outdoors-8739.mp4 -vf "hwupload,
boxblur_opencl,hwdownload,format=yuv420p" output.mkv
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static
--disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm
--enable-lto --enable-fontconfig --enable-gmp --enable-gnutls
--enable-gpl --enable-ladspa --enable-libaom --enable-libass
--enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm
--enable-libfreetype --enable-libfribidi --enable-libgsm
--enable-libiec61883 --enable-libjack --enable-libmfx
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr
--enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1
--enable-libtheora --enable-libv4l2 --enable-libvidstab
--enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2
--enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc
--enable-opencl --enable-opengl --enable-shared --enable-version3
--enable-vulkan
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[AVHWDeviceContext @ 0x55ad13a57300] QSV to OpenCL mapping not usable.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/home/paz/mixkit-worried-and-sad-woman-outdoors-8739.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: isomavc1mp42
    creation_time   : 2020-06-21T18:53:40.000000Z
  Duration: 00:00:15.00, start: 0.000000, bitrate: 24801 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661),
yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24798
kb/s, 24 fps, 24 tbr, 24k tbn (default)
    Metadata:
      creation_time   : 2020-06-21T18:53:40.000000Z
      handler_name    : ETI ISO Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Elemental H.264
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x55ad13c1a140] using SAR=1/1
[libx264 @ 0x55ad13c1a140] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55ad13c1a140] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x55ad13c1a140] 264 - core 164 r3095 baee400 - H.264/MPEG-4
AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html -
options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2
threads=24 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1
interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2
b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
Output #0, matroska, to 'output.mkv':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: isomavc1mp42
    encoder         : Lavf59.27.100
  Stream #0:0(und): Video: h264 (H264 / 0x34363248), yuv420p(tv,
bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 1k
tbn (default)
    Metadata:
      creation_time   : 2020-06-21T18:53:40.000000Z
      handler_name    : ETI ISO Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=  360 fps= 98 q=-1.0 Lsize=    3012kB time=00:00:14.87
bitrate=1658.5kbits/s speed=4.04x
video:3008kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.111606%
[libx264 @ 0x55ad13c1a140] frame I:2     Avg QP:18.75  size: 32568
[libx264 @ 0x55ad13c1a140] frame P:90    Avg QP:20.16  size: 16107
[libx264 @ 0x55ad13c1a140] frame B:268   Avg QP:21.18  size:  5840
[libx264 @ 0x55ad13c1a140] consecutive B-frames:  0.6%  0.6%  0.0% 98.9%
[libx264 @ 0x55ad13c1a140] mb I  I16..4: 23.2% 72.9%  3.9%
[libx264 @ 0x55ad13c1a140] mb P  I16..4:  8.9% 15.5%  0.1%  P16..4:
38.1%  4.7%  1.4%  0.0%  0.0%    skip:31.4%
[libx264 @ 0x55ad13c1a140] mb B  I16..4:  0.7%  0.8%  0.0%  B16..8:
31.8%  1.6%  0.1%  direct: 1.2%  skip:63.9%  L0:46.6% L1:52.3% BI:
1.0%
[libx264 @ 0x55ad13c1a140] 8x8 transform intra:62.4% inter:98.3%
[libx264 @ 0x55ad13c1a140] coded y,uvDC,uvAC intra: 17.8% 35.6% 1.7%
inter: 4.5% 9.6% 0.0%
[libx264 @ 0x55ad13c1a140] i16 v,h,dc,p: 27% 27% 10% 36%
[libx264 @ 0x55ad13c1a140] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 16% 43%
2%  4%  5%  4%  3%  2%
[libx264 @ 0x55ad13c1a140] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 20% 16%
4% 11%  7%  5%  3%  1%
[libx264 @ 0x55ad13c1a140] i8c dc,h,v,p: 65% 16% 16%  3%
[libx264 @ 0x55ad13c1a140] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x55ad13c1a140] ref P L0: 68.4%  4.6% 19.6%  7.4%
[libx264 @ 0x55ad13c1a140] ref B L0: 88.4%  9.5%  2.1%
[libx264 @ 0x55ad13c1a140] ref B L1: 95.1%  4.9%
[libx264 @ 0x55ad13c1a140] kb/s:1642.56


The resulting video shows the blur, so it is fine.


More information about the Cin mailing list