# How to use QSV/VAAPI on Linux Mint?



## catscarlet.com (Jan 15, 2021)

Is QSV available on Linux now in obs 26.1.1?

I tried and it showed this:


> Starting the output failed. Please check the log for details.
> Note: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.



here is vainfo


Spoiler: vainfo



~$ sudo vainfo
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSliceLP
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileVP9Profile2            :    VAEntrypointVLD



here is part of obs log


Spoiler: obs log



12:16:33 AM.519: CPU Name: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
12:16:33 AM.519: CPU Speed: 3314.755MHz
12:16:33 AM.519: Physical Cores: 4, Logical Cores: 4
12:16:33 AM.519: Physical Memory: 15729MB Total, 13181MB Free
12:16:33 AM.519: Kernel Version: Linux 5.4.0-62-generic
12:16:33 AM.519: Distribution: "Linux Mint" "20"
12:16:33 AM.519: Session Type: x11
12:16:33 AM.520: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.9
12:16:33 AM.520: Portable mode: false
12:16:33 AM.555: OBS 26.1.1 (linux)
12:16:33 AM.555: ---------------------------------
12:16:33 AM.555: ---------------------------------
12:16:33 AM.555: audio settings reset:
12:16:33 AM.555:     samples per sec: 48000
12:16:33 AM.555:     speakers:        2
12:16:33 AM.564: ---------------------------------
12:16:33 AM.564: Initializing OpenGL...
12:16:33 AM.619: Loading up OpenGL on adapter Intel Mesa Intel(R) UHD Graphics 620 (WHL GT2)
12:16:33 AM.619: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 20.2.6, shading language 4.60
12:16:33 AM.656: ---------------------------------
12:16:33 AM.656: video settings reset:
12:16:33 AM.656:     base resolution:   1920x1080
12:16:33 AM.656:     output resolution: 1280x720
12:16:33 AM.656:     downscale filter:  Area
12:16:33 AM.656:     fps:               60/1
12:16:33 AM.656:     format:            NV12
12:16:33 AM.656:     YUV mode:          709/Partial
12:16:33 AM.656: NV12 texture support not available
12:16:33 AM.658: Audio monitoring device:
12:16:33 AM.658:     name: Default
12:16:33 AM.658:     id: default
12:16:33 AM.658: ---------------------------------
12:16:33 AM.661: Failed to load 'en-US' text for module: 'decklink-captions.so'
12:16:33 AM.663: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
12:16:33 AM.784: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
12:16:33 AM.784: No blackmagic support
12:16:33 AM.794: v4l2loopback not installed, virtual camera disabled
12:16:33 AM.804: [obs-browser]: Version 2.9.1
12:16:33 AM.804: [obs-browser]: CEF Version 76.1.13+gf19c584+chromium-76.0.3809.132
12:16:33 AM.948: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory
12:16:33 AM.948: 
12:16:33 AM.948: FFMPEG VAAPI supported
12:16:33 AM.975: VLC found, VLC video source enabled
12:16:33 AM.975: ---------------------------------
12:16:33 AM.976:   Loaded Modules:
12:16:33 AM.976:     vlc-video.so
12:16:33 AM.976:     text-freetype2.so
12:16:33 AM.976:     rtmp-services.so
12:16:33 AM.976:     obs-x264.so
12:16:33 AM.976:     obs-vst.so
12:16:33 AM.976:     obs-transitions.so
12:16:33 AM.976:     obs-outputs.so
12:16:33 AM.976:     obs-libfdk.so
12:16:33 AM.976:     obs-filters.so
12:16:33 AM.976:     obs-ffmpeg.so
12:16:33 AM.976:     obs-browser.so
12:16:33 AM.976:     linux-v4l2.so
12:16:33 AM.976:     linux-pulseaudio.so
12:16:33 AM.976:     linux-jack.so
12:16:33 AM.976:     linux-decklink.so
12:16:33 AM.976:     linux-capture.so
12:16:33 AM.976:     linux-alsa.so
12:16:33 AM.976:     image-source.so
12:16:33 AM.976:     frontend-tools.so
12:16:33 AM.976:     decklink-ouput-ui.so
12:16:33 AM.976:     decklink-captions.so
12:16:33 AM.976: ---------------------------------
12:16:33 AM.976: os_dlopen(../obs-plugins/obs-browser->../obs-plugins/obs-browser.so): ../obs-plugins/obs-browser.so: cannot open shared object file: No such file or directory
12:16:33 AM.976: 
12:16:33 AM.976: ==== Startup complete ===============================================
12:16:33 AM.978: All scene data cleared
12:16:33 AM.978: ------------------------------------------------
12:16:33 AM.984: pulse-input: Server name: 'pulseaudio 13.99.1'
12:16:33 AM.985: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
12:16:33 AM.985: pulse-input: Started recording from 'alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor'
12:16:33 AM.985: [Loaded global audio device]: 'Desktop Audio'
12:16:33 AM.987: pulse-input: Server name: 'pulseaudio 13.99.1'
12:16:33 AM.987: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
12:16:33 AM.987: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo'
12:16:33 AM.987: [Loaded global audio device]: 'Mic/Aux'
12:16:33 AM.989: xshm-input: Geometry 1920x1080 @ 0,0
12:16:34 AM.013: Switched to scene 'Scene 16:9'
12:16:34 AM.013: ------------------------------------------------
12:16:34 AM.013: Loaded scenes:
12:16:34 AM.013: - scene 'Scene 4:3':
12:16:34 AM.013: - scene 'Scene 16:9':
12:16:34 AM.013:     - source: 'Window Capture (Xcomposite) 16:9' (xcomposite_input)
12:16:34 AM.013: - scene 'Scene RetroArch':
12:16:34 AM.013:     - source: 'Window Capture (Xcomposite) retroarch' (xcomposite_input)
12:16:34 AM.013:     - source: 'Q' (text_ft2_source_v2)
12:16:34 AM.013: - scene 'Fullscreen':
12:16:34 AM.013:     - source: 'Screen Capture (XSHM)' (xshm_input)
12:16:34 AM.013: ------------------------------------------------
12:16:34 AM.845: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)
12:16:34 AM.845: 
12:16:59 AM.926: Settings changed (outputs)
12:16:59 AM.926: ------------------------------------------------
12:17:14 AM.865: ---------------------------------
12:17:14 AM.866: [FFMPEG VAAPI encoder: 'streaming_h264'] settings:
12:17:14 AM.866:     device:       /dev/dri/renderD128
12:17:14 AM.866:     rate_control: CBR
12:17:14 AM.866:     profile:      100
12:17:14 AM.866:     level:        -99
12:17:14 AM.866:     qp:           0
12:17:14 AM.866:     bitrate:      2500
12:17:14 AM.866:     maxrate:      2500
12:17:14 AM.866:     keyint:       120
12:17:14 AM.866:     width:        1280
12:17:14 AM.866:     height:       720
12:17:14 AM.866:     b-frames:     0
12:17:14 AM.866: 
12:17:14 AM.891: [FFMPEG VAAPI encoder: 'streaming_h264'] Failed to open VAAPI codec: Invalid argument



This computer has also win10 installed and on win10, obs supports qsv well.
do i need to install something else or i need to recompiling something to support qsv on linux?


----------



## Tuna (Jan 15, 2021)

I think VAEntrypointEncSliceLP is not supported (LP I think stands for low power). Not sure about the exact reason.


----------



## catscarlet.com (Jan 16, 2021)

Tuna said:


> I think VAEntrypointEncSliceLP is not supported (LP I think stands for low power). Not sure about the exact reason.



Thanks for the info. It helps a lot.

After knowing it, I searched and found something more about it. Someone who has similar cpu as mine also having trouble with vaapi and post it on reddit https://www.reddit.com/r/jellyfin/comments/hfy3ot/stumped_with_hw_transcoding/fw133gg/ , which also refered "VAEntrypointEncSliceLP". The continuous discussion says:


> Intel does not intend to continue to support processors after Coffee Lake in the free intel-vaapi-driver.


and lead me to an intel-vaapi-driver issue.
The soluation is to use Intel(R) Media Driver for VAAPI (https://github.com/intel/media-driver), and must be the *Full Feature Build *one, aka intel-media-va-driver-non-free*. *

On default, Linux always installs free/opensourse version of everything. I checked and my computer said intel-media-va-driver is installed.
So I tried 


> sudo apt install intel-media-va-driver-non-free


It automatically removed intel-media-va-driver and installed intel-media-va-driver-non-free. I rebooted computer(not should if it's necessary but I did). Reopen OBS, tried recording with vaapi.

*it works now!*

Here is some more info about vainfo after install non-free version of iHD, with a comparison with the free version output(sorry about the indentation)



Spoiler: vainfo



~$ sudo vainfo 
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc
      VAProfileNone                   :    VAEntrypointStats
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Simple            :    VAEntrypointEncSlice
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointFEI
      VAProfileH264Main               :    VAEntrypointEncSliceLP
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointFEI
      VAProfileH264High               :    VAEntrypointEncSliceLP
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:    VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileVP8Version0_3          :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointFEI
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointEncSlice
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileVP9Profile2            :    VAEntrypointVLD
cat@cat-Inspiron-7380-linux:~$


----------

