<SOLVED - TY rene!> Hardware Acceleration? How to use it?

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

<SOLVED - TY rene!> Hardware Acceleration? How to use it?

Post by wallyUSA »

When I export a video (Using Shotcut), it takes a long time, many hours for a 120 minute video. I have seen on Google that turning on Hardware Acceleration may speed up the process.

How do I find if I have this and if it is turned on? Using 7 year old Dell XPS 13 and LM 20.2 Cinnamon.

Code: Select all

wally@wally-XPS-13-9343:~$ inxi -Fxxxrz
System:
  Kernel: 5.4.0-89-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 
  Desktop: Cinnamon 5.0.6 wm: muffin 5.0.2 dm: LightDM 1.30.0 
  Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: Dell product: XPS 13 9343 v: N/A serial: <filter> 
  Chassis: type: 9 serial: <filter> 
  Mobo: Dell model: 0WF2C3 v: A00 serial: <filter> UEFI [Legacy]: Dell 
  v: A20 date: 06/06/2019 
Battery:
  ID-1: BAT0 charge: 52.9 Wh condition: 52.9/57.5 Wh (92%) volts: 8.5/7.6 
  model: SMP DELL JHXPY53 type: Li-poly serial: <filter> status: Full 
  Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard 
  serial: <filter> charge: 55% (should be ignored) rechargeable: yes 
  status: Discharging 
CPU:
  Topology: Dual Core model: Intel Core i5-5200U bits: 64 type: MT MCP 
  arch: Broadwell rev: 4 L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 17559 
  Speed: 799 MHz min/max: 500/2700 MHz Core speeds (MHz): 1: 798 2: 803 
  3: 798 4: 798 
Graphics:
  Device-1: Intel HD Graphics 5500 vendor: Dell driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:1616 
  Display: x11 server: X.Org 1.20.11 driver: modesetting 
  unloaded: fbdev,vesa resolution: 1920x1080~60Hz, 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel HD Graphics 5500 (BDW GT2) v: 4.6 Mesa 21.0.3 
  direct render: Yes 
Audio:
  Device-1: Intel Broadwell-U Audio vendor: Dell driver: snd_hda_intel 
  v: kernel bus ID: 00:03.0 chip ID: 8086:160c 
  Device-2: Intel Wildcat Point-LP High Definition Audio vendor: Dell 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:9ca0 
  Sound Server: ALSA v: k5.4.0-89-generic 
Network:
  Device-1: Intel Wireless-AC 9260 driver: iwlwifi v: kernel port: f040 
  bus ID: 02:00.0 chip ID: 8086:2526 
  IF: wlp2s0 state: up mac: <filter> 
Drives:
  Local Storage: total: 238.49 GiB used: 133.19 GiB (55.8%) 
  ID-1: /dev/mmcblk0 model: GD4QT size: 119.25 GiB serial: <filter> 
  scheme: MBR 
  ID-2: /dev/sda vendor: LITE-ON model: L8H-128V2G-11 M.2 2280 128GB 
  size: 119.24 GiB speed: 6.0 Gb/s serial: <filter> rev: 10A scheme: MBR 
Partition:
  ID-1: / size: 116.38 GiB used: 74.23 GiB (63.8%) fs: ext4 dev: /dev/sda5 
Sensors:
  System Temperatures: cpu: 54.0 C mobo: 49.0 C 
  Fan Speeds (RPM): N/A 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/gezakovacs-ppa-focal.list 
  1: deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
  1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://packages.linuxmint.com uma main upstream import backport #id:linuxmint_main
  2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
  3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
  4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ focal partner
  Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
  1: deb https://linux.teamviewer.com/deb stable main
Info:
  Processes: 247 Uptime: 1d 4h 49m Memory: 7.40 GiB used: 2.59 GiB (35.0%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash 
  v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 
wally@wally-XPS-13-9343:~$ 
TIA
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-102 Cinn 6.0.4
MikeNavy
Level 1
Level 1
Posts: 37
Joined: Sat May 08, 2021 9:08 am

Re: Hardware Acceleration? How to use it?

Post by MikeNavy »

Hi,

It seems you have a Intel HD Graphics 5500 GPU; it is a basic graphics chipset, not very powerful (it is not an NVIDIA or Radeon card). However you may take some advantages from it.

You should set the hardware acceleration in each program you use. It may accelerate video conversion, video playing.

It will not have any effect on uploading to internet time: this depends on your ISP, your modem router (optic fiber, wire...).

Regards,

MN

PS: If you use VLC for video conversion, it can use all the cores of your computer for this, and is is another way to have fast video conversion.
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: Hardware Acceleration? How to use it?

Post by wallyUSA »

@MikeNavy,

I am new to video editing so I am going thru some 'trial & error' (learning experience).

I guess my first question s/b is 'Hardware Acceleration' a system wide settings or is it an individual program (app) setting?

I d/l a video recording from Zoom, then edit it, export it (all on my Dell) and then upload to YouTube. It is .mp4 d/l and .mp4 u/l.

So it is the exporting on my PC that is taking hours. It probably has something to do with the parameters I am using in Shotcut that is the issue. I will go to the Shotcut forum for suggestions.

Thank you for your reply!
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-102 Cinn 6.0.4
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Hardware Acceleration? How to use it?

Post by Hoser Rob »

MikeNavy wrote: Sun Oct 24, 2021 3:10 am ... You should set the hardware acceleration in each program you use. It may accelerate video conversion, video playing....
Actually 3D video hardware acceleration hasn't anything to do with video encoding with the exception of Nvidia Cuda, which is a general parallel platform capable of doing it. But it's not considered good for quality encoding, and Intel doesn't have anything like it anyway. What you see when you read about video hardware accel is about playback, and your Intel video certainly seems to have it.

Video encoding is a lot more complex than many assume at first, and it can take a long time to encode. The source video and output codec matters, and so does settings. If you're encoding a 2160p x265 video to a smaller res in x264 (which is a worse codec) it's going to take a while. Or if you're encoding to HEVC (x265) it's going to be slower, the "high efficiency" part of HEVC doesn't mean it encodes faster at all. Without knowing what you're using it's hard to say what the issue is.

One good tip if you're encoding to x264 or x265 is to use CRF mode. The only exception I can think of is if you want to play the video on some devices via a USB stick, some of them can't play CRF encoded video. I always use crf, it gives you as good as or better quality than 2 pass bitrate mode but it's almost as fast as one pass bitrate mode. The only thing, not a problem for most anymore, is that you don't know exactly what the output file size will be. BTW bitrate mode is really the same as file size mode, size = bitrate * running time.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Hardware Acceleration? How to use it?

Post by rene »

While noting that I have personally literally 0 experience with Shotcut, it should in fact since a few versions support hardware-assisted encoding on Intel through VA-API:

https://www.linuxuprising.com/2018/11/s ... a-api.html

I expect your mileage may vary between repository and/or a more current flatpak version and even in latter possibly as to needing to provide explicit access and most certainly as to what type of acceleration, if any, your specific and actual hardware in fact provides, and I can't test any of that for you. To probe into things, sudo apt-get install vainfo and vainfo for some information on what your system provides for at least. If it doesn't Just Work otherwise, Google will need to be your friend...
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: Hardware Acceleration? How to use it?

Post by wallyUSA »

Hoser Rob wrote: Sun Oct 24, 2021 9:33 am
..... Without knowing what you're using it's hard to say what the issue is.

One good tip if you're encoding to x264 or x265 is to use CRF mode....
More about what I am doing/using:

Using Shotcut 21.06.29. Just starting using it last week. Neat program and I look forward to learning how to use it.

I am downloading a Zoom recording such as ‘file_Recording_640x360.mp4’. (500 MB). I trim off a few seconds (usually the beginning & end) and then export it.

I try to minimize the export file size so I can upload it to YouTube. Currently I export as preset ‘Slide Deck (HEVC)’. I would like to maintain video quality & minimize the file size.



Also: Is the CRF a settings in Shotcut? Did not see it in PRESETS.
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-102 Cinn 6.0.4
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: Hardware Acceleration? How to use it?

Post by wallyUSA »

rene wrote: Sun Oct 24, 2021 10:33 am While noting that I have personally literally 0 experience with Shotcut, it should in fact since a few versions support hardware-assisted encoding on Intel through VA-API:

https://www.linuxuprising.com/2018/11/s ... a-api.html
This looks promising. I will give it a try.

Thanks :!:
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-102 Cinn 6.0.4
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: Hardware Acceleration? How to use it?

Post by wallyUSA »

@rene,

Code: Select all

While noting that I have personally literally 0 experience with Shotcut, it should in fact since a few versions support hardware-assisted encoding on Intel through VA-API:

https://www.linuxuprising.com/2018/11/s ... a-api.html
Your suggestion (hardware encoding) seemed to fix it. The export went from 9 hours to 90 minutes! The file size tripled but I'll worry about that later.

Thank you! :D
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-102 Cinn 6.0.4
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: <SOLVED - TY rene!> Hardware Acceleration? How to use it?

Post by rene »

wallyUSA wrote: Sun Oct 24, 2021 7:58 pm The export went from 9 hours to 90 minutes! The file size tripled but I'll worry about that later.
6 times is impressive; the joys of massive GPU parallelism...

As to file size, I ran in to this: https://forum.shotcut.org/t/export-size ... ions/13348:
Also, you are using VAAPI, which is going to be quite dependent on whatever ffmpeg and the driver decides to do with qscale. In particular, FFmpeg dropped or broke support for qscale in VAAPI when we upgraded to v4.2. We now use vglobal_quality with a different numeric range. You will need to adjust the preset accordingly.
Last post there in turn leads to https://forum.shotcut.org/t/about-to-gi ... ut/12689/2:
In the FFmpeg documentation the sane CRF values are between 18 and 28, 18 corresponds to 64 % in Shotcut’s UI and is stated as “vglobal_quality” next to the percentage
Said FFmpeg documentation notes the CRF range to be 0-51 with 0 lossless. 18 would then be 1-18/52 ~ 65%. It notes 23 to be its default, i.e., in the Shotcut UI approx. 55%. Expect that if you set it thereabout you'll get the non-vaapi default quality hence size back.

The mentioned FFmpeg doc: https://trac.ffmpeg.org/wiki/Encode/H.264
User avatar
wallyUSA
Level 6
Level 6
Posts: 1439
Joined: Thu Jun 08, 2017 2:31 pm
Location: Top of Georgia

Re: <SOLVED - TY rene!> Hardware Acceleration? How to use it?

Post by wallyUSA »

@rene,
Thanks for all the info. This is pretty overwhelming for a neophyte video editor! I will have to read it a few more times to see if I understand how to use. Your input is much appreciated!
> If your query has been resolved, edit your original post and add <SOLVED> to the beginning of the subject line. This may help others find solutions. <

Dell Latitude 7490 Mint 21.3 Ker 5.15.0-102 Cinn 6.0.4
Locked

Return to “Hardware Support”