So, I run veeery experimental clvk (OpenCL via Vulkan) on my termux, ffmpeg tried to init filter but died. I guess my day is not today ... Anyway, my test line was: ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i ~/20210419_055507A.mp4 -vf "hwupload, boxblur_opencl, hwdownload,format=yuv420p" -f null /dev/null for different filters format might be yuv420p or nv12 ... I wonder if anyone here have working OpenCL ffmpeg setup ? I'll try with llvmpipe/rusticl on desktop .... but it guaranteed to be slow.
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.
пн, 13 февр. 2023 г., 19:21 Andrea paz <[email protected]>:
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.
Ah, cool! Can you post clinfo output too? http://underpop.online.fr/f/ffmpeg/help/tonemap_005fopencl.htm.gz I tried to get more complex tonemapping example but it was erroring out due to syntax errors :( If you get this one to work it will be awesome! And double-awesome if you can put such long hw filter string in opts file for cinelerra-gg to pick. It might error out due to missing filtering device init but I hope this can be relatively easily fixed by even me.
Here is the clinfo. Keep in mind that AMD video cards are problematic in Arch linux and my RX 5700XT is even more so. So I use the open "amdgpu + mesa" driver, but for OpenCL I use the driver extracted from amdgpu-pro (closed) via the "opencl-amd" package found in AUR: https://pastebin.com/GaeCw33j Using the command: ffmpeg -i kumar.mp4 -vf "format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" sdr.mp4 I get error (NOTE: I omitted the first part of summary [...]): [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kumar.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42mp41isomavc1 creation_time : 2021-01-29T03:44:29.000000Z Duration: 00:00:08.42, start: 0.000000, bitrate: 11930 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2560x1440, 11923 kb/s, 60 fps, 60 tbr, 60 tbn (default) Metadata: creation_time : 2021-01-29T03:44:29.000000Z handler_name : L-SMASH Video Handler vendor_id : [0][0][0][0] encoder : AVC Coding Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [hwupload @ 0x55d02f90bf00] A hardware device reference is required to upload frames to. [Parsed_hwupload_1 @ 0x55d030732540] Query format failed for 'Parsed_hwupload_1': Invalid argument Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 Conversion failed! Trying to also use the options "-init_hw_device opencl=gpu -filter_hw_device gpu" I still get error: [...] [AVHWDeviceContext @ 0x55f2d5c9a680] QSV to OpenCL mapping not usable. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kumar.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42mp41isomavc1 creation_time : 2021-01-29T03:44:29.000000Z Duration: 00:00:08.42, start: 0.000000, bitrate: 11930 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2560x1440, 11923 kb/s, 60 fps, 60 tbr, 60 tbn (default) Metadata: creation_time : 2021-01-29T03:44:29.000000Z handler_name : L-SMASH Video Handler vendor_id : [0][0][0][0] encoder : AVC Coding Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [tonemap_opencl @ 0x55f2d6cf9780] unsupported transfer function characteristic. Error while filtering: Function not implemented Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed! Trying to use bt709 instead of bt2020: [...] [AVHWDeviceContext @ 0x56091bb58680] QSV to OpenCL mapping not usable. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kumar.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42mp41isomavc1 creation_time : 2021-01-29T03:44:29.000000Z Duration: 00:00:08.42, start: 0.000000, bitrate: 11930 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2560x1440, 11923 kb/s, 60 fps, 60 tbr, 60 tbn (default) Metadata: creation_time : 2021-01-29T03:44:29.000000Z handler_name : L-SMASH Video Handler vendor_id : [0][0][0][0] encoder : AVC Coding Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [tonemap_opencl @ 0x56091cbb76c0] unsupported transfer function characteristic. Error while filtering: Function not implemented Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed! Trying with nv12 instead of p010 gives the same error. Trying with another HDR video works: $ ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i New_York.ts -vf "format=p010,hwupload,tonemap_opencl=t=bt709:tonemap=linear:format=p010,hwdownload,format=p010" sdr.mp4 [...] [AVHWDeviceContext @ 0x55ab233ad680] QSV to OpenCL mapping not usable. [mpegts @ 0x55ab233f3540] start time for stream 1 is not set in estimate_timings_from_pts [mpegts @ 0x55ab233f3540] stream 1 : no TS found at start of file, duration not set [mpegts @ 0x55ab233f3540] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'New_York.ts': Duration: 00:01:12.24, start: 0.999989, bitrate: 52032 kb/s Program 1 Stream #0:0[0x101]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn Stream #0:1[0x102](und): Audio: aac ([15][0][0][0] / 0x000F), 0 channels File 'sdr.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0x55ab23549580] using SAR=1/1 [libx264 @ 0x55ab23549580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x55ab23549580] profile High 10, level 5.1, 4:2:0, 10-bit [libx264 @ 0x55ab23549580] 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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'sdr.mp4': Metadata: encoder : Lavf59.27.100 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p10le(tv, bt2020nc/bt2020/bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc59.37.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A frame= 1806 fps= 20 q=-1.0 Lsize= 172058kB time=00:01:12.12 bitrate=19543.8kbits/s speed=0.782x video:172035kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.013862% [libx264 @ 0x55ab23549580] frame I:22 Avg QP:28.31 size:714949 [libx264 @ 0x55ab23549580] frame P:495 Avg QP:33.55 size:194494 [libx264 @ 0x55ab23549580] frame B:1289 Avg QP:37.99 size: 49775 [libx264 @ 0x55ab23549580] consecutive B-frames: 3.7% 2.4% 2.8% 91.0% [libx264 @ 0x55ab23549580] mb I I16..4: 28.8% 52.4% 18.9% [libx264 @ 0x55ab23549580] mb P I16..4: 6.0% 10.5% 1.1% P16..4: 33.7% 10.5% 8.3% 0.0% 0.0% skip:30.0% [libx264 @ 0x55ab23549580] mb B I16..4: 0.9% 2.7% 0.3% B16..8: 29.0% 3.1% 0.9% direct: 2.3% skip:60.8% L0:43.2% L1:50.0% BI: 6.8% [libx264 @ 0x55ab23549580] 8x8 transform intra:61.8% inter:74.7% [libx264 @ 0x55ab23549580] coded y,uvDC,uvAC intra: 43.4% 47.4% 16.3% inter: 14.0% 10.8% 1.1% [libx264 @ 0x55ab23549580] i16 v,h,dc,p: 33% 36% 10% 21% [libx264 @ 0x55ab23549580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 27% 27% 3% 4% 4% 6% 4% 7% [libx264 @ 0x55ab23549580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 31% 10% 4% 6% 7% 8% 5% 7% [libx264 @ 0x55ab23549580] i8c dc,h,v,p: 64% 19% 13% 4% [libx264 @ 0x55ab23549580] Weighted P-Frames: Y:28.1% UV:20.0% [libx264 @ 0x55ab23549580] ref P L0: 68.1% 18.4% 11.7% 1.8% [libx264 @ 0x55ab23549580] ref B L0: 86.6% 10.4% 3.0% [libx264 @ 0x55ab23549580] ref B L1: 94.4% 5.6% [libx264 @ 0x55ab23549580] kb/s:19508.61 It does not work with nv12 but works with p010. The conversion uses the CPU 100% but also uses the GPU (not 100%). ffprobe on the source video: $ ffprobe New_York.ts [...] [mpegts @ 0x55a97d509380] start time for stream 1 is not set in estimate_timings_from_pts [mpegts @ 0x55a97d509380] stream 1 : no TS found at start of file, duration not set [mpegts @ 0x55a97d509380] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'New_York.ts': Duration: 00:01:12.24, start: 0.999989, bitrate: 52032 kb/s Program 1 Stream #0:0[0x101]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn Stream #0:1[0x102](und): Audio: aac ([15][0][0][0] / 0x000F), 0 channels ffprobe on the target video (sdr.mp4): $ ffprobe sdr.mp4 [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sdr.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf59.27.100 Duration: 00:01:12.24, start: 0.000000, bitrate: 19511 kb/s Stream #0:0[0x1](und): Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le(tv, bt2020nc/bt2020/bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 19508 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc59.37.100 libx264 I haven't tried in CinGG yet.
On Tuesday, February 14, 2023 9:54:03 AM CET, Andrea paz via Cin wrote:
Here is the clinfo. Keep in mind that AMD video cards are problematic in Arch linux and my RX 5700XT is even more so. So I use the open "amdgpu + mesa" driver, but for OpenCL I use the driver extracted from amdgpu-pro (closed) via the "opencl-amd" package found in AUR:
I think the main issues with AMD and opencl is that there were never drivers to support the 'older cards' when they were new. And the newer drivers dropped the support for older cards. If you do enable it (for example on a Ryzen 5 Mobile CPU) you can literally crash the Linux kernel, I noticed this with Tesseract OCR. -- Stefan
вт, 14 февр. 2023 г., 12:17 Stefan de Konink via Cin < [email protected]>:
On Tuesday, February 14, 2023 9:54:03 AM CET, Andrea paz via Cin wrote:
Here is the clinfo. Keep in mind that AMD video cards are problematic in Arch linux and my RX 5700XT is even more so. So I use the open "amdgpu + mesa" driver, but for OpenCL I use the driver extracted from amdgpu-pro (closed) via the "opencl-amd" package found in AUR:
I think the main issues with AMD and opencl is that there were never drivers to support the 'older cards' when they were new. And the newer drivers dropped the support for older cards. If you do enable it (for example on a Ryzen 5 Mobile CPU) you can literally crash the Linux kernel, I noticed this with Tesseract OCR.
:( may be you should file amdgpu (? kernel component) bug then ..if not already.
-- Stefan -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
вт, 14 февр. 2023 г., 11:54 Andrea paz <[email protected]>:
Here is the clinfo. Keep in mind that AMD video cards are problematic in Arch linux and my RX 5700XT is even more so. So I use the open "amdgpu + mesa" driver, but for OpenCL I use the driver extracted from amdgpu-pro (closed) via the "opencl-amd" package found in AUR:
Using the command:
ffmpeg -i kumar.mp4 -vf
"format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" sdr.mp4
I get error (NOTE: I omitted the first part of summary [...]):
may be surround first hwupload in ",format=p010" just like output part does? thanks for testing, as usual!
[...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kumar.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42mp41isomavc1 creation_time : 2021-01-29T03:44:29.000000Z Duration: 00:00:08.42, start: 0.000000, bitrate: 11930 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2560x1440, 11923 kb/s, 60 fps, 60 tbr, 60 tbn (default) Metadata: creation_time : 2021-01-29T03:44:29.000000Z handler_name : L-SMASH Video Handler vendor_id : [0][0][0][0] encoder : AVC Coding Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [hwupload @ 0x55d02f90bf00] A hardware device reference is required to upload frames to. [Parsed_hwupload_1 @ 0x55d030732540] Query format failed for 'Parsed_hwupload_1': Invalid argument Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 Conversion failed!
Trying to also use the options "-init_hw_device opencl=gpu -filter_hw_device gpu" I still get error:
[...] [AVHWDeviceContext @ 0x55f2d5c9a680] QSV to OpenCL mapping not usable. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kumar.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42mp41isomavc1 creation_time : 2021-01-29T03:44:29.000000Z Duration: 00:00:08.42, start: 0.000000, bitrate: 11930 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2560x1440, 11923 kb/s, 60 fps, 60 tbr, 60 tbn (default) Metadata: creation_time : 2021-01-29T03:44:29.000000Z handler_name : L-SMASH Video Handler vendor_id : [0][0][0][0] encoder : AVC Coding Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [tonemap_opencl @ 0x55f2d6cf9780] unsupported transfer function characteristic. Error while filtering: Function not implemented Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed!
Trying to use bt709 instead of bt2020:
[...] [AVHWDeviceContext @ 0x56091bb58680] QSV to OpenCL mapping not usable. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kumar.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42mp41isomavc1 creation_time : 2021-01-29T03:44:29.000000Z Duration: 00:00:08.42, start: 0.000000, bitrate: 11930 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 2560x1440, 11923 kb/s, 60 fps, 60 tbr, 60 tbn (default) Metadata: creation_time : 2021-01-29T03:44:29.000000Z handler_name : L-SMASH Video Handler vendor_id : [0][0][0][0] encoder : AVC Coding Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [tonemap_opencl @ 0x56091cbb76c0] unsupported transfer function characteristic. Error while filtering: Function not implemented Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed!
Trying with nv12 instead of p010 gives the same error. Trying with another HDR video works:
$ ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i New_York.ts -vf
"format=p010,hwupload,tonemap_opencl=t=bt709:tonemap=linear:format=p010,hwdownload,format=p010" sdr.mp4 [...] [AVHWDeviceContext @ 0x55ab233ad680] QSV to OpenCL mapping not usable. [mpegts @ 0x55ab233f3540] start time for stream 1 is not set in estimate_timings_from_pts [mpegts @ 0x55ab233f3540] stream 1 : no TS found at start of file, duration not set [mpegts @ 0x55ab233f3540] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'New_York.ts': Duration: 00:01:12.24, start: 0.999989, bitrate: 52032 kb/s Program 1 Stream #0:0[0x101]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn Stream #0:1[0x102](und): Audio: aac ([15][0][0][0] / 0x000F), 0 channels File 'sdr.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0x55ab23549580] using SAR=1/1 [libx264 @ 0x55ab23549580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x55ab23549580] profile High 10, level 5.1, 4:2:0, 10-bit [libx264 @ 0x55ab23549580] 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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'sdr.mp4': Metadata: encoder : Lavf59.27.100 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p10le(tv, bt2020nc/bt2020/bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc59.37.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A frame= 1806 fps= 20 q=-1.0 Lsize= 172058kB time=00:01:12.12 bitrate=19543.8kbits/s speed=0.782x video:172035kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.013862% [libx264 @ 0x55ab23549580] frame I:22 Avg QP:28.31 size:714949 [libx264 @ 0x55ab23549580] frame P:495 Avg QP:33.55 size:194494 [libx264 @ 0x55ab23549580] frame B:1289 Avg QP:37.99 size: 49775 [libx264 @ 0x55ab23549580] consecutive B-frames: 3.7% 2.4% 2.8% 91.0% [libx264 @ 0x55ab23549580] mb I I16..4: 28.8% 52.4% 18.9% [libx264 @ 0x55ab23549580] mb P I16..4: 6.0% 10.5% 1.1% P16..4: 33.7% 10.5% 8.3% 0.0% 0.0% skip:30.0% [libx264 @ 0x55ab23549580] mb B I16..4: 0.9% 2.7% 0.3% B16..8: 29.0% 3.1% 0.9% direct: 2.3% skip:60.8% L0:43.2% L1:50.0% BI: 6.8% [libx264 @ 0x55ab23549580] 8x8 transform intra:61.8% inter:74.7% [libx264 @ 0x55ab23549580] coded y,uvDC,uvAC intra: 43.4% 47.4% 16.3% inter: 14.0% 10.8% 1.1% [libx264 @ 0x55ab23549580] i16 v,h,dc,p: 33% 36% 10% 21% [libx264 @ 0x55ab23549580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 27% 27% 3% 4% 4% 6% 4% 7% [libx264 @ 0x55ab23549580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 31% 10% 4% 6% 7% 8% 5% 7% [libx264 @ 0x55ab23549580] i8c dc,h,v,p: 64% 19% 13% 4% [libx264 @ 0x55ab23549580] Weighted P-Frames: Y:28.1% UV:20.0% [libx264 @ 0x55ab23549580] ref P L0: 68.1% 18.4% 11.7% 1.8% [libx264 @ 0x55ab23549580] ref B L0: 86.6% 10.4% 3.0% [libx264 @ 0x55ab23549580] ref B L1: 94.4% 5.6% [libx264 @ 0x55ab23549580] kb/s:19508.61
It does not work with nv12 but works with p010. The conversion uses the CPU 100% but also uses the GPU (not 100%).
ffprobe on the source video:
$ ffprobe New_York.ts [...] [mpegts @ 0x55a97d509380] start time for stream 1 is not set in estimate_timings_from_pts [mpegts @ 0x55a97d509380] stream 1 : no TS found at start of file, duration not set [mpegts @ 0x55a97d509380] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'New_York.ts': Duration: 00:01:12.24, start: 0.999989, bitrate: 52032 kb/s Program 1 Stream #0:0[0x101]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn Stream #0:1[0x102](und): Audio: aac ([15][0][0][0] / 0x000F), 0 channels
ffprobe on the target video (sdr.mp4):
$ ffprobe sdr.mp4 [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sdr.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf59.27.100 Duration: 00:01:12.24, start: 0.000000, bitrate: 19511 kb/s Stream #0:0[0x1](und): Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le(tv, bt2020nc/bt2020/bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 19508 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc59.37.100 libx264
I haven't tried in CinGG yet.
may be surround first hwupload in ",format=p010" just like output part does? By removing both "format=" or removing one and leaving the other I always get format error.
Using bt2020 as a transfer instead of bt709 the GPU occupancy is 100% but it actually stands still without proceeding with rendering. I have to kill the process. I have tried making a few .opts files, but they don't work for me (they are ignored without any message, not even error!). Could you provide me with one because I think I am doing it wrong.
вт, 14 февр. 2023 г., 18:55 Andrea paz <[email protected]>:
may be surround first hwupload in ",format=p010" just like output part does? By removing both "format=" or removing one and leaving the other I always get format error.
Using bt2020 as a transfer instead of bt709 the GPU occupancy is 100% but it actually stands still without proceeding with rendering. I have to kill the process.
I have tried making a few .opts files, but they don't work for me (they are ignored without any message, not even error!). Could you provide me with one because I think I am doing it wrong.
try to put say init_hw_device opencl=gpu filter_hw_device gpu video_filter=format=yuv420p,scale,format=p010 in file named 20210419_055931A.opts for media file named 20210419_055931A.mp4 in same directory. hwupload/hwdownload still does not work for me this way, but at least few linear video filters attach to each other ...
I have done many tests in CinGG, but nothing works because no hardware device is seen, opencl filters are not seen, and the .opts file I make is not seen. No errors, they are simply not seen.... The only thing left for me to try is to compile trying to enable "-enable-opencl".
пт, 17 февр. 2023 г., 18:48 Andrea paz <[email protected]>:
I have done many tests in CinGG, but nothing works because no hardware device is seen, opencl filters are not seen, and the .opts file I make is not seen. No errors, they are simply not seen....
this is strange, I mean that opts files do not work for you.
The only thing left for me to try is to compile trying to enable "-enable-opencl".
yeah, it seems without this compile-time configure option internal ffmpeg does not know about opencl. Still, you can try to build --without-thirdparty and thus link to system's ffmpeg. Sorry for not discovering this earlier.
I tried compiling by putting in ./configure... the option "--enable-opencl" but it is not recognized. I tried exporting opencl between the autogen.sh and ./configure steps...: export FFMPEG_EXTRA_CFG=" --enable-opencl" I have no errors during ./configure but I have a crash in make: "ERROR: opencl not found If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the [email protected] mailing list or IRC #ffmpeg on irc.libera.chat. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem." I attach the cin5-with.log, if it helps. I redid the compilation always with "export..." but putting in ./configure also "--without-thirdparty" but I have a crash after a few seconds of "make". I also attach the cin5-without.log. https://transfer.sh/CXaksQ/cin5.tar.gz
вс, 19 февр. 2023 г., 11:44 Andrea paz <[email protected]>:
I tried compiling by putting in ./configure... the option "--enable-opencl" but it is not recognized. I tried exporting opencl between the autogen.sh and ./configure steps...:
export FFMPEG_EXTRA_CFG=" --enable-opencl"
I have no errors during ./configure but I have a crash in make:
"ERROR: opencl not found If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the [email protected] mailing list or IRC #ffmpeg on irc.libera.chat. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem."
for this one try to install opencl-headers ?
I attach the cin5-with.log, if it helps.
I redid the compilation always with "export..." but putting in ./configure also "--without-thirdparty" but I have a crash after a few seconds of "make". I also attach the cin5-without.log.
for this one try with --without-libdpx also ....
Done more testing, but I can't get CinGG to see opencl. I installed opencl-headers. With thirdparty the compilation still fails. With -without-thirdparty and -without-libdpx the compilation is without problems. I had to use export FFMPEG_EXTRA_CFG=" --enable-opencl" again because simple -enable-opencl in ./configure is not seen. I tried putting two plugins (tonemap_opencl and boxblur_opencl) in plugin.opts and they are loaded and visible among the ffmpeg plugins. If we apply them in timeline they can be opened and changed options, but they don't work. I get these kinds of messages: PluginFVClient::activate() F_tonemap_opencl err: Function not implemented PluginFVClient::process_buffer() F_tonemap_opencl err: Operation not permitted I tried putting "init_hw_device opencl=gpu and filter_hw_device gpu" inside "ffmpeg.opts", but using them in timeline leads to a freeze. When I do a kill, I get the following messages: signal_entry: got SIGTERM my pid=12977 execution table size=0: signal_entry: lock table size=19 0x564f8d6ef860 VIconThread::draw_lock, VIconThread::run 0 0x7f89a4dfe6c0 0x564f8dec5220 CWindowTool::input_lock, CWindowTool::run 0x7f8989ffb6c0 0x564f8df03a50 BC_DialogThread::active_lock, BC_DialogThread::run 0x7f8988ff96c0 * 0x7f897c2c24d0 PlaybackEngine::output_lock, PlaybackEngine::run 0x7f8981ffb6c0 0x564f8e2fdc90 RecordSetChannel::change_channel, (null) 0x7f8964ff96c0 0x564f8e42b260 ChannelInfo::scan_lock, (null) 0x7f894ffff6c0 0x564f8e42b7d0 SWindow::swin_lock, (null) 0x7f894f7fe6c0 0x564f8e479a40 MainIndexes::input_lock, MainIndexes::run 1 0x7f893bfff6c0 0x564f8df2d070 ResourceThreadBase::draw_lock, ResourceThreadBase::run 0x7f896e7fc6c0 0x564f8defc350 PlaybackEngine::renderengine_lock, PlaybackEngine::stop_playback 0x7f89c2e630c0 * 0x7f89a0022c70 RenderEngine::render_active, RenderEngine::wait_done 0x7f89c2e630c0 0x7f89a7fff6c0 0x564f8defc350 PlaybackEngine::renderengine_lock, PlaybackEngine::interrupt_playback 0x7f89897fa6c0 0x7f89c2e630c0 0x7f891c0042f0 BC_SynchronousCommand::command_done, BC_Synchronous::send_command 0x7f89b64bd6c0 0x564f8df421d0 ResourceThreadBase::draw_lock, ResourceThreadBase::run 0x7f896dffb6c0 0x564f8e42e100 BC_Repeater::repeat_lock, BC_Repeater::run 0x7f894effd6c0 0x7f897c002cd0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7f8988ff96c0 0x564f8df29020 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7f89667fc6c0 lock_items: 17 lock_frees: 2 SigHandler::signal_handler total files=0 I link the cin5.log of the failed compile with "thirdparty" if you are interested. https://transfer.sh/4JyqCP/cin5.tar.gz
Andrea, although I can not offer any help, if you do get this working please keep track of how in case we want to add it to the manual for other people. On Fri, Feb 24, 2023 at 6:30 AM Andrea paz via Cin < [email protected]> wrote:
Done more testing, but I can't get CinGG to see opencl.
I installed opencl-headers. With thirdparty the compilation still fails. With -without-thirdparty and -without-libdpx the compilation is without problems. I had to use export FFMPEG_EXTRA_CFG=" --enable-opencl" again because simple -enable-opencl in ./configure is not seen. I tried putting two plugins (tonemap_opencl and boxblur_opencl) in plugin.opts and they are loaded and visible among the ffmpeg plugins. If we apply them in timeline they can be opened and changed options, but they don't work. I get these kinds of messages:
PluginFVClient::activate() F_tonemap_opencl err: Function not implemented PluginFVClient::process_buffer() F_tonemap_opencl err: Operation not permitted
I tried putting "init_hw_device opencl=gpu and filter_hw_device gpu" inside "ffmpeg.opts", but using them in timeline leads to a freeze. When I do a kill, I get the following messages:
signal_entry: got SIGTERM my pid=12977 execution table size=0: signal_entry: lock table size=19 0x564f8d6ef860 VIconThread::draw_lock, VIconThread::run 0 0x7f89a4dfe6c0 0x564f8dec5220 CWindowTool::input_lock, CWindowTool::run 0x7f8989ffb6c0 0x564f8df03a50 BC_DialogThread::active_lock, BC_DialogThread::run 0x7f8988ff96c0 * 0x7f897c2c24d0 PlaybackEngine::output_lock, PlaybackEngine::run 0x7f8981ffb6c0 0x564f8e2fdc90 RecordSetChannel::change_channel, (null) 0x7f8964ff96c0 0x564f8e42b260 ChannelInfo::scan_lock, (null) 0x7f894ffff6c0 0x564f8e42b7d0 SWindow::swin_lock, (null) 0x7f894f7fe6c0 0x564f8e479a40 MainIndexes::input_lock, MainIndexes::run 1 0x7f893bfff6c0 0x564f8df2d070 ResourceThreadBase::draw_lock, ResourceThreadBase::run 0x7f896e7fc6c0 0x564f8defc350 PlaybackEngine::renderengine_lock, PlaybackEngine::stop_playback 0x7f89c2e630c0 * 0x7f89a0022c70 RenderEngine::render_active, RenderEngine::wait_done 0x7f89c2e630c0 0x7f89a7fff6c0 0x564f8defc350 PlaybackEngine::renderengine_lock, PlaybackEngine::interrupt_playback 0x7f89897fa6c0 0x7f89c2e630c0 0x7f891c0042f0 BC_SynchronousCommand::command_done, BC_Synchronous::send_command 0x7f89b64bd6c0 0x564f8df421d0 ResourceThreadBase::draw_lock, ResourceThreadBase::run 0x7f896dffb6c0 0x564f8e42e100 BC_Repeater::repeat_lock, BC_Repeater::run 0x7f894effd6c0 0x7f897c002cd0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7f8988ff96c0 0x564f8df29020 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7f89667fc6c0 lock_items: 17 lock_frees: 2 SigHandler::signal_handler total files=0
I link the cin5.log of the failed compile with "thirdparty" if you are interested.
https://transfer.sh/4JyqCP/cin5.tar.gz -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Andrea, although I can not offer any help, if you do get this working please keep track of how in case we want to add it to the manual for other people. Hopefully we can do it, but I don't think it's possible; too many variables. It seems to me that the biggest problem is being able to initialize the GPU in CinGG, but I have no idea how to do that.
пт, 24 февр. 2023 г., 19:28 Andrea paz <[email protected]>:
Andrea, although I can not offer any help, if you do get this working please keep track of how in case we want to add it to the manual for other people. Hopefully we can do it, but I don't think it's possible; too many variables. It seems to me that the biggest problem is being able to initialize the GPU in CinGG, but I have no idea how to do that.
Thanks for testing, as always. Please post failed log with thirdparty + opencl. May be headers were installed in some location where we can't see them, may be we can include those just like nvidia headers .... I thought it will be cool if libavcodec will construct "format, hwupload ..." filter "hwdownload, format" full string for us, but for now it seems we must do it by hand ... in addition to initing opencl especially.
Please post failed log with thirdparty + opencl. May be headers were installed in some location where we can't see them, may be we can include those just like nvidia headers .... I thought I put the link to the previous email. Maybe I'm doing something wrong. Maybe I need to put opencl-headers somewhere in configure? I redid the compile and put the new link: https://transfer.sh/UINEwf/cin5.tar.gz
пт, 24 февр. 2023 г., 21:42 Andrea paz <[email protected]>:
Please post failed log with thirdparty + opencl. May be headers were installed in some location where we can't see them, may be we can include those just like nvidia headers .... I thought I put the link to the previous email. Maybe I'm doing something wrong. Maybe I need to put opencl-headers somewhere in configure?
oh sorry. /home/paz/cinelerra5/cinelerra-5.1/thirdparty/ffmpeg-5.1/libavutil/hwcontext_opencl.c:666: undefine d reference to `clRetainCommandQueue' sounds like you need to add output of pkg-config --libs OpenCL to ffmpeg's linker line ... try export EXTRA_LIBS="-lOpenCL" before configure, in addition to FFMPEG_EXTRA line. I redid the compile and put the new link:
сб, 25 февр. 2023 г., 01:27 Andrea paz <[email protected]>:
try export EXTRA_LIBS="-lOpenCL" before configure, in addition to FFMPEG_EXTRA line. I'm sorry, but I don't understand where to put the line. In which file and when? After autogen.sh?
you can create small sh file with two lines export lines and then usual autogen.sh/configure or set them manually before test compilation in terminal ... for example my termux script in blds looks like this #!/bin/bash # Produced, tested, and used by Andrew-R on an Android tablet export FFMPEG_EXTRA_CFG="--disable-debug --disable-doc --disable-ffprobe --enable-libdav1d" export EXTRA_LIBS="-ldav1d" ./configure --without-lv2 --without-vdpau --without-vaapi --without-ladspa-build \ --without-nv --with-single-user --with-clang --without-gl --disable-dav1d just in your case you enable opencl, so export and configure lines will looks different.
Thanks Andrew; I tried to compile using the following script: #!/bin/bash # Copied, tested, and used by Andrea-Paz export FFMPEG_EXTRA_CFG="--enable-opencl" export EXTRA_LIBS="-lOpenCL" The build happens without errors. If you need it I can post you the cin5.log. I then put some opencl plugins in "plugin.opts", but these are not seen. I remind you that compiling without thirdparty the opencl plugins used to load in CinGG and also in timeline, but then they would not work. Now, with thirdparty, they do not load in CinGG. I also tried creating the following opts file: boxblur_opencl.opts -init_hw_device opencl=ocl:0.0 -filter_hw_device ocl 'format=nv12,hwupload,boxblur_opencl,hwdownload,format=nv12' Even then nothing happens and the opencl plugins are not seen. Do you have any idea what I can try?
вс, 26 февр. 2023 г., 15:25 Andrea paz <[email protected]>:
Thanks Andrew; I tried to compile using the following script:
#!/bin/bash # Copied, tested, and used by Andrea-Paz export FFMPEG_EXTRA_CFG="--enable-opencl" export EXTRA_LIBS="-lOpenCL"
The build happens without errors. If you need it I can post you the cin5.log. I then put some opencl plugins in "plugin.opts", but these are not seen.
I remind you that compiling without thirdparty the opencl plugins used to load in CinGG and also in timeline, but then they would not work. Now, with thirdparty, they do not load in CinGG.
I also tried creating the following opts file:
boxblur_opencl.opts
-init_hw_device opencl=ocl:0.0 -filter_hw_device ocl 'format=nv12,hwupload,boxblur_opencl,hwdownload,format=nv12'
Even then nothing happens and the opencl plugins are not seen.
Do you have any idea what I can try?
You can try to use ffmpeg executable from thirdparty/ffmpeg-5.1 and see if it works with opencl ...
With system ffmpeg the boxblur filter works. With CinGG's ffmpeg (thirdparty) it fails to initialize the hardware: $ ./ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i /home/paz/kumar.mp4 -vf 'hwupload,boxblur_opencl,hwdownload,format=yuv420p' /home/paz/test-opencl.mp4 Device creation failed: -12. Failed to set value 'opencl=gpu' for option 'init_hw_device': Cannot allocate memory Error parsing global options: Cannot allocate memory
вс, 26 февр. 2023 г., 23:12 Andrea paz <[email protected]>:
With system ffmpeg the boxblur filter works. With CinGG's ffmpeg (thirdparty) it fails to initialize the hardware:
$ ./ffmpeg -init_hw_device opencl=gpu -filter_hw_device gpu -i /home/paz/kumar.mp4 -vf 'hwupload,boxblur_opencl,hwdownload,format=yuv420p' /home/paz/test-opencl.mp4 Device creation failed: -12. Failed to set value 'opencl=gpu' for option 'init_hw_device': Cannot allocate memory Error parsing global options: Cannot allocate memory
===
yeah, it does same for me, while I thought it was due to ffmpeg compiled without opencl support. Does any opencl filter show up in "ffmpeg -filters" output for local ffmpeg?
./ffmpeg -init_hw_device list Supported hardware device types: vdpau cuda vaapi vulkan Instead with system ffmpeg: ffmpeg -init_hw_device list [...] Supported hardware device types: vdpau cuda vaapi qsv drm opencl vulkan ./ffmpeg -filters bash: ./ffmpeg:no such file or directory (with system ffmpeg I get the full list)
вс, 26 февр. 2023 г., 23:33 Andrea paz <[email protected]>:
./ffmpeg -init_hw_device list Supported hardware device types: vdpau cuda vaapi vulkan
Instead with system ffmpeg:
ffmpeg -init_hw_device list [...] Supported hardware device types: vdpau cuda vaapi qsv drm opencl vulkan
./ffmpeg -filters bash: ./ffmpeg:no such file or directory
(with system ffmpeg I get the full list)
last error seems strange, if you do all this from inside thirdparty/ffmpeg-5.1 dir. But guess our options somewhat had no effect on ffmpeg compiled as part of cingg's thirdparty build? Oh, guess you can drop this alley for now ..:/ I logged ffmpeg (32bit) opencl error at mesa bugtracker, [0] so may be it will be resolved at some future time so I'll play with it some more Sorry! [0] https://gitlab.freedesktop.org/mesa/mesa/-/issues/8267
One final consideration: system ffmpeg has "--enable-opencl" active by default, while our ffmpeg does not have it and cannot even activate it. Did we take this option off? Thank you Andrew, you are doing a great job!
вс, 26 февр. 2023 г., 23:48 Andrea paz <[email protected]>:
One final consideration: system ffmpeg has "--enable-opencl" active by default, while our ffmpeg does not have it and cannot even activate it. Did we take this option off?
I feared so, but my termux rebuild showed opencl as only available hw device for internal ffmpeg: ~/cinelerra/cinelerra-5.1 $ thirdparty/ffmpeg-5.1/ffmpeg -init_hw_device list Supported hardware device types: opencl after I modified my build script. ~/cinelerra/cinelerra-5.1 $ git diff blds/termux.bld diff --git a/cinelerra-5.1/blds/termux.bld b/cinelerra-5.1/blds/termux.bld index afa14a74..7cbcdf2a 100755 --- a/cinelerra-5.1/blds/termux.bld +++ b/cinelerra-5.1/blds/termux.bld @@ -1,6 +1,6 @@ #!/bin/bash # Produced, tested, and used by Andrew-R on an Android tablet -export FFMPEG_EXTRA_CFG="--disable-debug --disable-doc --disable-ffprobe --enable-libdav1d" -export EXTRA_LIBS="-ldav1d" +export FFMPEG_EXTRA_CFG="--disable-debug --enable-opencl --disable-doc --disable-ffprobe --enable-libdav1d" +export EXTRA_LIBS="-ldav1d -lOpenCL" ./configure --without-lv2 --without-vdpau --without-vaapi --without-ladspa-build \ --without-nv --with-single-user --with-clang --without-gl --disable-dav1d So, for some reason your ffmpeg build as done by cingg does not pick up those opencl variables?
Thank you Andrew, you are doing a great job!
OK, I am glad that this is something that only affects my system. It's probably because I don't use "mesa-opencl" but use "ROCm opencl" which comes from amdgpu-pro (and I don't use clang either).
participants (4)
-
Andrea paz -
Andrew Randrianasulu -
Phyllis Smith -
Stefan de Konink