[FFmpeg-user] question about opencl use in decoders/encoders

Andrew Randrianasulu randrianasulu at gmail.com
Wed Nov 8 00:05:36 EET 2023


ср, 8 нояб. 2023 г., 00:36 Dennis Mungai <dmngaie at gmail.com>:

> On Tue, 7 Nov 2023 at 00:55, Andrew Randrianasulu <randrianasulu at gmail.com
> >
> wrote:
>
> > FFmpeg today support some opencl filters (but I was unable to use them
> > freely in Cinelerra-gg probably because they require not just
> > initialization of hw device but also manual up and download of data ...)
> >
> > but I wonder if same opencl infra can be used in decoders and encoders
> too?
> >
> >
> >
> https://cml.news/g/cml-raw-log-hdr/topic/braw_codec_analysis/25749037?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,25749037
> >
> > apparently those big player codecs use it, so it should be possible
> > technically, just at some dev time cost ...
> >
> > there is also some prores gpu accelerated decoder (closed source, win)
> >
> > https://mogurenko.com/2020/11/15/cuda-optimized-prores-decoder/
> >
> > and of course old standby mjpeg:
> >
> > https://github.com/nctu-pp/mjpeg-encoder
> >
> > (opencl part does not seems to work for me, but may be it basically
> > artefact of running in 32bit x86 mode , I filled mesa bug about it
> >
>
>
> Hello Andrew,
>
> I hope this email finds you well.
> In FFmpeg, OpenCL is primarily utilized in specific filters, a list of them
> which you can verify in your build(s) with OpenCL enabled via :
>
> ffmpeg -filters | grep opencl
>
> On the encoding side, to the best of my knowledge, the libx264 encoder
> wrapper implements lookahead (LA) bits that can be offloaded to an OpenCL
> capable GPU.
>


yeah, something to test! thanks for reminder.

Some users have reported potential performance gains in production, even
> upstream where there's still consensus on whether this feature should be
> deprecated.
> See this merge request's comments on the same:
> https://code.videolan.org/videolan/x264/-/merge_requests/66
>
> Separate from FFmpeg:
>
> 1. There are also implementations of VP9 encoders utilizing OpenCL-based
> offloading, such as the VP9 encoder by Ittiam systems:
>
> https://www.ittiam.com/resource/ittiam-enables-opencl-based-vp9-encode-for-mobile-and-consumer-applications/
> ,
> whose code can be viewed here https://github.com/ittiamvpx/libvpx



nice find, it even builds like this on my end

LDFLAGS="-lOpenCL" setarch i686 ./configure --enable-opencl

after I fixed little 32bit configure bug:

-        check_cpp <<EOF && bits=x32
+        check_cpp <<EOF && bits=32

in build/make/configure.sh

otherwise my gcc 11.2 had no idea what to do do with -mx32 flag.

now I have binary for testing, but localtime is 1am :)



> 2. A VP8 OpenCL-based encoder: https://github.com/Aazmp/vp8oclenc
> 3. And other derivatives of (1) above:
> https://github.com/awatry/libvpx.opencl
>
> I had also posted on this mailing list earlier regarding OpenCL somewhere
> in ~2018, may require verification for correctness:
> https://ffmpeg.org/pipermail/ffmpeg-user/2018-April/039610.html
>
> Hope that helps :-)
>


surely!

_______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list