Author Topic: GPU hardware encoding acceleration using CUDA  (Read 236 times)

OkropNick

  • Newbie
  • *
  • Posts: 9
GPU hardware encoding acceleration using CUDA
« on: November 27, 2017, 01:24:04 PM »
Hi all.

I can't find anywhere informations about possibillity to encode h264 / h265 video using GPU (Nvidia CUDA GTX 1060). Can someone explain it to me or point me to answer?

Thank you in advance.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #1 on: November 27, 2017, 01:58:15 PM »
Do you build Avidemux from source? You need the nvEncodeAPI.h header and devel package for libvdpau. If everything is done correctly, you will find NVENC based encoders in the list of video codecs.

OkropNick

  • Newbie
  • *
  • Posts: 9
Re: GPU hardware encoding acceleration using CUDA
« Reply #2 on: November 27, 2017, 02:02:01 PM »
Yes,

I can build Avidemux 2.7.0 from sources, I also have downloaded whole CUDA development library from Nvidia, but don't know what and where I have to copy. Any help will be appreciated.

Thanks.

OkropNick

  • Newbie
  • *
  • Posts: 9
Re: GPU hardware encoding acceleration using CUDA
« Reply #3 on: November 27, 2017, 02:04:53 PM »
I probably found right instuctions, let me try...

http://avidemux.org/smif/index.php?topic=16750.0

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #4 on: November 27, 2017, 02:07:38 PM »
Please use the current git, not 2.7.0, there were important fixes WRT hw accelerated encoders post-2.7.0. You need the binary NVIDIA graphics driver installed and working, libvdpau incl. -devel and just the nvEncodeAPI.h header.

Edit: Are you on Ubuntu?

OkropNick

  • Newbie
  • *
  • Posts: 9
Re: GPU hardware encoding acceleration using CUDA
« Reply #5 on: November 27, 2017, 02:08:24 PM »
Ok, thanks. Let me try...

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #6 on: November 27, 2017, 02:13:41 PM »
I asked about Ubuntu because there is a script for Ubuntu which would install all the requisites (except of the NVENC header, you'd have to take care of it yourself) and build (and install) Avidemux: https://github.com/mean00/avidemux2/blob/master/createDebFromSourceUbuntu.bash

OkropNick

  • Newbie
  • *
  • Posts: 9
Re: GPU hardware encoding acceleration using CUDA
« Reply #7 on: November 27, 2017, 02:54:22 PM »
Thanks, I installed Avidemux using script createDebFromSourceUbuntu.bash. Compilation and installation was finished without errors, but when I'm starting avidemux from console using:

kuba@okropnick:~/Pulpit$ avidemux&

Avidemux don't work properly. There are no muxers, video & audio codecs, I don't know what went wrong. Can you help me to resolve this problem?

Problem exists in git version and 2.7.0 sources.

Thank you in advance.

Here is log:

https://pastebin.com/uZ9LPD7m
« Last Edit: November 27, 2017, 03:08:47 PM by OkropNick »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #8 on: November 27, 2017, 03:01:39 PM »
You must have another Avidemux version installed, please uninstall all other builds. The launch command is

Code: [Select]
avidemux3_qt5
You better keep Avidemux in foreground, otherwise all the rich debug info fills your journal.
« Last Edit: November 27, 2017, 03:07:35 PM by eumagga0x2a »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #9 on: November 27, 2017, 03:11:01 PM »
You've built 2.7.0. Please don't do that if you want to use NVENC, use the latest git.

Maybe

Code: [Select]
# ldconfig
would help?

OkropNick

  • Newbie
  • *
  • Posts: 9
Re: GPU hardware encoding acceleration using CUDA
« Reply #10 on: November 27, 2017, 03:19:34 PM »
You must have another Avidemux version installed, please uninstall all other builds. The launch command is

Code: [Select]
avidemux3_qt5

Would you explain me this? I don't understand.

Thanks.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #11 on: November 27, 2017, 03:23:43 PM »
The vanilla upstream Avidemux application binary on Linux is called "avidemux3_qt5". Unless you made a custom launch script or a symlink as "avidemux", this doesn't belong to the upstream Avidemux.

OkropNick

  • Newbie
  • *
  • Posts: 9
Re: GPU hardware encoding acceleration using CUDA
« Reply #12 on: November 27, 2017, 03:41:19 PM »
Ok, but if I'm launching program by "avidemux3_qt5" is not working either. Still can't find any muxers and codecs. Even source cloned from git. How to find reason?

Would you kindly build an appimage with requested feature? I can pay for help.

Thanks.


eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #13 on: November 27, 2017, 03:49:38 PM »
Have you removed all other builds? Have you checked that the plugins are really there? If yes, have you run ldconfig?

I never looked into appimage and don't have time to delve into it now.
« Last Edit: November 27, 2017, 03:51:10 PM by eumagga0x2a »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1544
Re: GPU hardware encoding acceleration using CUDA
« Reply #14 on: November 27, 2017, 04:16:41 PM »
I prefer to install Avidemux behind the back of packet management to /usr/local using

Code: [Select]
bash bootStrap.bash --prefix=/usr/local
and then simply copying the content of install/usr/local directory to its destination.

You can also reduce the install size by using some system libs instead of the bundled ones, see the --with-system- options from

Code: [Select]
bash bootStrap.bash --help