I
I
impressive172021-08-12 23:55:05
go
impressive17, 2021-08-12 23:55:05

How to run ffmpeg on GPU golang?

I am converting video with ffmpeg on the fly. Because of this, a very large load on the CPU
Is it possible to run ffmpeg on the GPU?
Now I'm running with
exec.CommandContext()

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Pavlyuk, 2021-08-16
@pav5000

This is more of a ffmpeg question, go has nothing to do with it at all.
GPU encoding is enabled by parameters passed to ffmpeg.
For different GPU manufacturers, the parameters will be different.
For example, here is the Cuda doc: https://docs.nvidia.com/video-technologies/video-c...

A
Armenian Radio, 2021-08-13
@gbg

1) This usually makes sense if the full processing cycle is on the video card. Otherwise, you risk spending more time on data transfer than on encoding.
2) It is highly likely that you will have to rebuild ffmpeg with support for nvenc or whatever card you have.

S
Sergey Tikhonov, 2021-08-19
@tumbler

Absolutely the same as on the CPU - by calling ffmpeg with the necessary command line arguments as a child process.
A good place to start reading the documentation is https://trac.ffmpeg.org/wiki/HWAccelIntro

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question