Avidemux Forum

Avidemux => Unix-Like (Linux/Bsd/...) => Topic started by: OkropNick on November 27, 2017, 01:24:04 PM

Title: GPU hardware encoding acceleration using CUDA
Post by: OkropNick 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.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a 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.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick 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.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick 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
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a 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?
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick on November 27, 2017, 02:08:24 PM
Ok, thanks. Let me try...
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a 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
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick 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
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a on November 27, 2017, 03:01:39 PM
You must have another Avidemux version installed, please uninstall all other builds. The launch command is

avidemux3_qt5

You better keep Avidemux in foreground, otherwise all the rich debug info fills your journal.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a 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

# ldconfig

would help?
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick on November 27, 2017, 03:19:34 PM
Quote from: eumagga0x2a on November 27, 2017, 03:01:39 PM
You must have another Avidemux version installed, please uninstall all other builds. The launch command is

avidemux3_qt5

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

Thanks.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a 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.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick 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.

Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a 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.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a on November 27, 2017, 04:16:41 PM
I prefer to install Avidemux behind the back of packet management to /usr/local using

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

bash bootStrap.bash --help
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: Jan Gruuthuse on November 27, 2017, 04:19:42 PM
currently  I have these on 16.04.3 LTS 64-bit:
dpkg -l build-essential cmake fakeroot g++ gcc libaften-dev libfaac-dev libfaad-dev libmp3lame-dev libpng12-dev libsqlite3-dev libqt5opengl5-dev libx264-dev make pkg-config qtbase5-dev qttools5-dev-tools yasm libasound2-dev x264 libdca-dev libfontconfig1-dev libfribidi-dev libmad0-dev libogg-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev libpulse-dev libtwolame-dev libva-dev libvdpau-dev libvorbis-dev libvpx-dev libx265-dev libxv-dev libxvidcore-dev libzip-dev nvidia-cuda-toolkit vainfo vdpauinfo x265 | grep '^.i'

ii  build-essential             12.1ubuntu2                amd64        Informational list of build-essential packages
ii  cmake                       3.5.1-1ubuntu3             amd64        cross-platform, open-source make system
ii  fakeroot                    1.20.2-1ubuntu1            amd64        tool for simulating superuser privileges
ii  g++                         4:5.3.1-1ubuntu1           amd64        GNU C++ compiler
ii  gcc                         4:5.3.1-1ubuntu1           amd64        GNU C compiler
ii  libaften-dev                0.0.8+git20100105-0ubuntu2 amd64        audio AC3 encoder - development files
ii  libasound2-dev:amd64        1.1.0-0ubuntu1             amd64        shared library for ALSA applications -- development files
ii  libdca-dev:amd64            0.0.5-7build1              amd64        decoding library for DTS Coherent Acoustics streams (development)
ii  libfaac-dev:amd64           1.28+cvs20151130-1         amd64        AAC audio encoder (development)
ii  libfaad-dev:amd64           2.8.0~cvs20150510-1        amd64        freeware Advanced Audio Decoder - development files
ii  libfontconfig1-dev:amd64    2.11.94-0ubuntu1.1         amd64        generic font configuration library - development
ii  libfribidi-dev              0.19.7-1                   amd64        Development files for FreeBidi library
ii  libmad0-dev                 0.15.1b-8ubuntu1           amd64        MPEG audio decoder development library
ii  libmp3lame-dev:amd64        3.99.5+repack1-9build1     amd64        MP3 encoding library (development)
ii  libogg-dev:amd64            1.3.2-1                    amd64        Ogg bitstream library development files
ii  libopencore-amrnb-dev:amd64 0.1.3-2.1                  amd64        Adaptive Multi Rate speech codec - development files
ii  libopencore-amrwb-dev:amd64 0.1.3-2.1                  amd64        Adaptive Multi-Rate - Wideband speech codec - development files
ii  libopus-dev:amd64           1.1.2-1ubuntu1             amd64        Opus codec library development files
ii  libpng12-dev:amd64          1.2.54-1ubuntu1            amd64        PNG library - development
ii  libpulse-dev:amd64          1:8.0-0ubuntu3.4           amd64        PulseAudio client development headers and libraries
ii  libqt5opengl5-dev:amd64     5.5.1+dfsg-16ubuntu7.5     amd64        Qt 5 OpenGL library development files
ii  libsqlite3-dev:amd64        3.11.0-1ubuntu1            amd64        SQLite 3 development files
ii  libtwolame-dev:amd64        0.3.13-1.2                 amd64        MPEG Audio Layer 2 encoder (development files)
ii  libva-dev:amd64             1.7.0-1                    amd64        Video Acceleration (VA) API for Linux -- development files
ii  libvdpau-dev:amd64          1.1.1-3ubuntu1             amd64        Video Decode and Presentation API for Unix (development files)
ii  libvorbis-dev:amd64         1.3.5-3                    amd64        development files for Vorbis General Audio Compression Codec
ii  libvpx-dev:amd64            1.5.0-2ubuntu1             amd64        VP8 and VP9 video codec (development files)
ii  libx264-dev:amd64           2:0.148.2643+git5c65704-1  amd64        development files for libx264
ii  libx265-dev:amd64           1.9-3                      amd64        H.265/HEVC video stream encoder (development files)
ii  libxv-dev:amd64             2:1.0.10-1                 amd64        X11 Video extension library (development headers)
ii  libxvidcore-dev:amd64       2:1.3.4-1                  amd64        Open source MPEG-4 video codec (development)
ii  libzip-dev:amd64            1.0.1-0ubuntu1             amd64        library for reading, creating, and modifying zip archives (development)
ii  make                        4.1-6                      amd64        utility for directing compilation
ii  nvidia-cuda-toolkit         7.5.18-0ubuntu1            amd64        NVIDIA CUDA development toolkit
ii  pkg-config                  0.29.1-0ubuntu1            amd64        manage compile and link flags for libraries
ii  qtbase5-dev:amd64           5.5.1+dfsg-16ubuntu7.5     amd64        Qt 5 base development files
ii  qttools5-dev-tools          5.5.1-3build1              amd64        Qt 5 development tools
ii  vainfo                      1.7.0-1                    amd64        Video Acceleration (VA) API for Linux -- info program
ii  vdpauinfo                   1.0-1                      amd64        Video Decode and Presentation API for Unix (vdpauinfo utility)
ii  x264                        2:0.148.2643+git5c65704-1  amd64        video encoder for the H.264/MPEG-4 AVC standard
ii  x265                        1.9-3                      amd64        H.265/HEVC video stream encoder
ii  yasm                        1.3.0-2                    amd64        modular assembler with multiple syntaxes support

Title: Re: GPU hardware encoding acceleration using CUDA
Post by: Jan Gruuthuse on November 27, 2017, 04:25:22 PM
starting Avidemux gui from terminal:
/usr/bin/avidemux3_qt5
check if the binaries are installed there! else change path /usr/bin/ to correct location.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick on November 27, 2017, 04:45:30 PM
Thank you for all your patience. Problem solved. It was permissions problem on my system and has nothing to do with Avidemux. Great software. Thread can be closed and removed.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a on November 27, 2017, 04:50:15 PM
Could you please give more details? Did the shared libraries of the plugins lack execute permissions? Maybe there is something the convenience script should take care of.
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: OkropNick on November 27, 2017, 05:14:06 PM
I have umask set to 007 and that was the reason why Avidemux couldn't access his files after I compiled it by "bash bootStrap.bash --prefix=/usr/local" and after compilation copied by "sudo cp -R install/usr/* /usr/"
Title: Re: GPU hardware encoding acceleration using CUDA
Post by: eumagga0x2a on November 27, 2017, 05:23:43 PM
Thanks.