[Cin] LIMITED Hardware Acceleration using the GPU Encoding/Rendering checked in

Phyllis Smith phylsmith2017 at gmail.com
Tue May 7 19:47:44 CEST 2019


VERY LIMITED hardware acceleration for rendering has been checked into GIT
and a description is included below that will eventually make it into the
manual.  Limitations are described there and why, but here is a one line
summary.

*If you have an Intel computer with Intel graphics board and render to mp4,
you can take advantage of this.*

We have no hardware to test Intel computer with Nvidia graphics board but
are assuming that it will not work.  An AMD computer with the Nvidia
graphics board installed does not work (not implemented).  If you can prove
me wrong, I would really like to hear that!

The following URL, although not generic for all operating systems, does
provide a Comparison tables for ascertaining whether or not the VA-API will
work for your specific hardware. * Do not be fooled by the GE Force listed
in the Decoding section *-- it does not appear in the Encoding section.
The table is about 2/3 of the way down the article.

https://wiki.archlinux.org/index.php/Hardware_video_acceleration

@Ubuntu16 users: there is a test build at:


https://www.cinelerra-gg.org/download/testing/cinelerra-5.1-ub16-x86_64-static.txz

@Pierre: if someone lets us know that it works on an Intel computer with
Nvidia graphics, gg will make a Mint18 build but otherwise prepare to be
disappointed. :)

@Andrea: we did look a little bit at OpenCL but got the impression that the
overhead may be too much and that it it seems to only help with filters.

@Andrew: thanks for your last email on this subject as it provided the
useful vdpauinfo amongst other things.

-----------------------------------------------------------

*Rendering with Hardware Acceleration / Encoding using VA-API*

Encoding using hardware acceleration of your graphics board GPU is included
in CinelerraGG but it is of limited availability and may be exclusive to
only a particular set of hardware graphics boards and only with certain
ffmpeg formats. The encoding is done via vaapi (libva installed), which is
known to work with Intel HD graphics board and some others. Usage of
encoding as developed by Nvidia is not included with CinGG because ffmpeg
has to be compiled with the *non-free *option and that goes against GPL. In
addition the Nvidia encoding, referred to as *nvenc, *requires proprietary
libraries to be installed.


To use hardware acceleration for rendering (that is, encoding) you do not
have to set a preference or an environment variable, as used by decoding.
To use this feature you must use an ffmpeg render options file which
specifies a vaapi codec, such as h264_vaapi. You must also include the line
in the file to trigger the hardware probe: cin_hw_dev=vaapi


There are currently 4 options files available in the Render menu already
set up for you that you see when you select the Video wrench and use the
down arrow on the first line in the menu. These are:


h264_vaapi.mp4     # known to work on Intel computer with Intel Broadwell
graphics driver

mpeg2_vaapi.mp4  # known to work on Intel computer with Intel Broadwell
graphics driver

mjpeg_vaapi.mp4   # error message of “open failed with mjpeg_vaapi...” on
above computer

hevc_vaapi.mp4     # error message of “open failed with hevc_vaapi...” on
above computer


Other option files can be added as needed for your specific hardware if it
is known to work for you, such as VP8 and VP9. The contents of the included
cinelerra’s ffmpeg/video/h264_vaapi.mp4 file:


mp4 h264_vaapi

cin_hw_dev=vaapi

profile=high


According to an online wiki, hardware encoders usually create output of
lower quality than some software encoders like x264, but are much faster
and use less CPU. Keep this in mind as you might want to set a higher
bitrate to get output of similar visual quality.


Results of a particular test case performed on a Intel, 4-core computer,
with Broadwell Graphics using an mp4 input video/audio file with dimensions
of 1440x1080 / 29.97fps is shown next (note, tutorial.mp4). This may very
well be a “best case” scenario! But clearly, at least on this computer with
only 4 cores, the hardware acceleration seems to be advantageous. A
comparison of the 2 output files using ydiff (as described in Appendix C in
the manual) shows no obvious defects.


                                                            *CPU
usage*  *Render
Time* *Output File Size* *Options File*

Without Hardware Acceleration    388%        100 secs.
36,862,542       h264.mp4

With vaapi Harware Acceleration 150%          19 secs.
74,522,736       h264_vaapi.mp4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20190507/bae1d5f2/attachment.html>


More information about the Cin mailing list