LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-16-2018, 05:08 AM   #16
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230

I think that pathetic is the tentative to encode HEVC with a freaking 15W on-board CPU...

BTW, my post was literally on topic, discussing:

A. The lame state of hardware encoding to HEVC under Linux. Oh, and I do not touched the PATENTS issues.
B. Giving you a realistic suggestion: to buy a surveillance video-recorder, it is cheaper than your computer.

Last edited by Darth Vader; 03-16-2018 at 05:15 AM.
 
Old 03-16-2018, 08:05 AM   #17
zdolar
LQ Newbie
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by linuxbawks View Post
With Intel, one is fortunate as there are two native drivers available for use under X.

Please make sure you have installed: xf86-video-intel-git_20160601_b617f80-x86_64-1

Now you have two choices available. You can use this driver or use the modesetting driver which comes in the Kernel itself.

The /etc/X11/xorg.conf.d/10-intel-igp.conf file you will need is as follows:

Code:
Section "Device"
        Identifier      "IGP"
# Change the PCIe hardware address
        BusID           "PCI:00:0X:0"
#       Driver          "intel"
        Driver          "modesetting"
EndSection
I've tested both above suggestions.
1. xf86-video-intel-git_20160601_b617f80-x86_64-1 - HW acceleration do not work for any video type.
2. modesetting driver which comes in the Kernel itself - tested with kernel 4.15.9, 4.14.17, 4.14.26
The same result with all kernel drivers, X cripled GUI, hardly recognisable icons to skip out from X to text console.

Looks like first variant is the only option.
The machine is playground/testing for Linux video capabilities, in real I will need hardware accelerated ffmpeg for x264 video.

As Linux boxes can decode/encode video with intel GPU help I want to achieve that in Slackware as it's far most stable distro and I play with it for more than two decades.
As Intel develops opensource Linux drivers for its integrated graphic, I believe in success.
Here I add a part of Xorg.log regarding Intel GPU.

Code:
[ 70618.090] 
X.Org X Server 1.18.3
Release Date: 2016-04-04
[ 70618.090] X Protocol Version 11, Revision 0
[ 70618.090] Build Operating System: Slackware 14.2 Slackware Linux Project
[ 70618.090] Current Operating System: Linux video 4.14.26 #1 SMP Wed Mar 14 19:19:55 CET 2018 x86_64
[ 70618.091] Kernel command line: BOOT_IMAGE=kernel-4.14.26 ro root=802 vt.default_utf8=1 usbhid.quirks=0x0c45:0x7401:0x0004 i915.enable_guc_loading=1 i915.enable_guc_submission=1
[ 70618.091] Build Date: 18 October 2017  12:21:16PM
[ 70618.091]  
[ 70618.091] Current version of pixman: 0.34.0
[ 70618.091] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[ 70618.092] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 70618.093] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Mar 15 16:08:39 2018
[ 70618.093] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 70618.093] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 70618.094] (==) No Layout section.  Using the first Screen section.
[ 70618.094] (**) |-->Screen "Screen0" (0)
[ 70618.094] (**) |   |-->Monitor "<default monitor>"
[ 70618.095] (==) No device specified for screen "Screen0".
	Using the first device section listed.
[ 70618.095] (**) |   |-->Device "Intel Graphics"
[ 70618.095] (==) No monitor specified for screen "Screen0".
	Using a default monitor configuration.
[ 70618.095] (==) Automatically adding devices
[ 70618.095] (==) Automatically enabling devices
[ 70618.095] (==) Automatically adding GPU devices
[ 70618.095] (==) Max clients allowed: 256, resource mask: 0x1fffff
...
[ 70618.095] (==) ModulePath set to "/usr/lib64/xorg/modules"
[ 70618.095] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 70618.095] (II) Loader magic: 0x807c00
[ 70618.095] (II) Module ABI versions:
[ 70618.095] 	X.Org ANSI C Emulation: 0.4
[ 70618.095] 	X.Org Video Driver: 20.0
[ 70618.095] 	X.Org XInput driver : 22.1
[ 70618.095] 	X.Org Server Extension : 9.0
[ 70618.096] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 70618.100] (--) PCI:*(0:0:2:0) 8086:5916:8086:0000 rev 2, Mem @ 0xde000000/16777216, 0xa0000000/536870912, I/O @ 0x0000f000/64, BIOS @ 0x????????/131072
[ 70618.100] (II) Open ACPI successful (/var/run/acpid.socket)
[ 70618.100] (II) "glx" will be loaded by default.
[ 70618.100] (II) LoadModule: "vnc"
[ 70618.102] (II) Loading /usr/lib64/xorg/modules/extensions/libvnc.so
[ 70618.119] (II) Module vnc: vendor="TigerVNC Project"
[ 70618.119] 	compiled for 1.18.3, module version = 1.0.0
[ 70618.119] 	Module class: X.Org Server Extension
[ 70618.119] 	ABI class: X.Org Server Extension, version 9.0
[ 70618.119] (II) LoadModule: "glx"
[ 70618.120] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[ 70618.122] (II) Module glx: vendor="X.Org Foundation"
[ 70618.122] 	compiled for 1.18.3, module version = 1.0.0
[ 70618.122] 	ABI class: X.Org Server Extension, version 9.0
[ 70618.122] (==) AIGLX enabled
[ 70618.123] (II) LoadModule: "intel"
[ 70618.123] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so
[ 70618.123] (II) Module intel: vendor="X.Org Foundation"
[ 70618.123] 	compiled for 1.18.3, module version = 2.99.917
[ 70618.123] 	Module class: X.Org Video Driver
[ 70618.123] 	ABI class: X.Org Video Driver, version 20.0
[ 70618.123] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
	i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
	915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
	Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
	GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[ 70618.123] (II) intel: Driver for Intel(R) HD Graphics: 2000-6000
[ 70618.123] (II) intel: Driver for Intel(R) Iris(TM) Graphics: 5100, 6100
[ 70618.123] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300
[ 70618.123] (--) using VT number 7

[ 70618.133] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20170818
[ 70618.145] (--) intel(0): gen9 engineering sample
[ 70618.145] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2; using a maximum of 2 threads
[ 70618.145] (II) intel(0): Creating default Display subsection in Screen section
	"Screen0" for depth/fbbpp 16/16
[ 70618.145] (**) intel(0): Depth 16, (--) framebuffer bpp 16
[ 70618.145] (==) intel(0): RGB weight 565
[ 70618.145] (==) intel(0): Default visual is TrueColor
[ 70618.145] (**) intel(0): Option "AccelMethod" "sna"
[ 70618.145] (**) intel(0): Option "TearFree" "true"
[ 70618.146] (II) intel(0): Output DP1 has no monitor section
[ 70618.146] (II) intel(0): Enabled output DP1
[ 70618.146] (II) intel(0): Output HDMI1 has no monitor section
[ 70618.146] (II) intel(0): Enabled output HDMI1
[ 70618.146] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[ 70618.146] (II) intel(0): Output VIRTUAL1 has no monitor section
[ 70618.146] (II) intel(0): Enabled output VIRTUAL1
[ 70618.146] (--) intel(0): Output DP1 using initial mode 1680x1050 on pipe 0
[ 70618.146] (**) intel(0): TearFree enabled
[ 70618.146] (==) intel(0): DPI set to (96, 96)
[ 70618.146] (II) Loading sub module "dri2"
[ 70618.146] (II) LoadModule: "dri2"
[ 70618.146] (II) Module "dri2" already built-in
[ 70618.146] (II) Loading sub module "present"
[ 70618.146] (II) LoadModule: "present"
[ 70618.146] (II) Module "present" already built-in
[ 70618.146] (II) intel(0): SNA initialized with generic backend
[ 70618.146] (==) intel(0): Backing store enabled
[ 70618.146] (==) intel(0): Silken mouse enabled
[ 70618.146] (II) intel(0): HW Cursor enabled
[ 70618.146] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[ 70618.146] (==) intel(0): DPMS enabled
[ 70618.146] (==) intel(0): Display hotplug detection enabled
[ 70618.146] (II) intel(0): Textured video not supported on this hardware or backend
[ 70618.146] (II) intel(0): [DRI2] Setup complete
[ 70618.146] (II) intel(0): [DRI2]   DRI driver: i965
[ 70618.146] (II) intel(0): [DRI2]   VDPAU driver: va_gl
[ 70618.146] (II) intel(0): direct rendering: DRI2 enabled
[ 70618.146] (II) intel(0): hardware support for Present enabled
[ 70618.146] (WW) intel(0): Option "SecurityTypes" is not used
[ 70618.146] (WW) intel(0): Option "PasswordFile" is not used
[ 70618.146] (--) RandR disabled
[ 70618.151] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[ 70618.151] (II) AIGLX: enabled GLX_ARB_create_context
[ 70618.151] (II) AIGLX: enabled GLX_ARB_create_context_profile
[ 70618.151] (II) AIGLX: enabled GLX_EXT_create_context_es{,2}_profile
[ 70618.151] (II) AIGLX: enabled GLX_INTEL_swap_event
[ 70618.151] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[ 70618.151] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[ 70618.151] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[ 70618.151] (II) AIGLX: enabled GLX_EXT_fbconfig_packed_float
[ 70618.151] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[ 70618.151] (II) AIGLX: enabled GLX_ARB_create_context_robustness
[ 70618.151] (II) AIGLX: Loaded and initialized i965
[ 70618.151] (II) GLX: Initialized DRI2 GL provider for screen 0
[ 70618.152] (II) intel(0): switch to mode 1680x1050@60.0 on DP1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 70618.164] (II) intel(0): Setting screen physical size to 444 x 277
Looks like mode Setting driver is active regardles of
Code:
#  Driver          "modesetting"
Driver      "intel"
placed in /etc/X11/xorg.conf.d/ *.conf file

Looks all good to me, no errors or warnings, hardware acceleration enabled..

Can someone confirm, that the above Xorg.log truly show, that HW acceleration is enabled. If yes, then I have to look for settings in compile/use of ffmpeg and VNC.
 
Old 03-16-2018, 08:25 AM   #18
zdolar
LQ Newbie
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Darth Vader View Post
I think that pathetic is the tentative to encode HEVC with a freaking 15W on-board CPU...

BTW, my post was literally on topic, discussing:

A. The lame state of hardware encoding to HEVC under Linux. Oh, and I do not touched the PATENTS issues.
B. Giving you a realistic suggestion: to buy a surveillance video-recorder, it is cheaper than your computer.
I'm aware that encoding HEVC is to much for i5-7200U, was just testing. Read my previous post - I need only x264 decode with ffmpeg that's all.

Regarding custom build surveillance video-recorder - I bought one with camera and I was completely disappointed. Is I have knowledge about computers HW and SW (> 30 years) I Installed Slackware & Zoneminder on an old notebook for test. That's excellent couple and work over a year without interruption.
Afraid of a HW failure and higher demands, I bought an Intel NUC clone without fans to create a production machine. New upcoming version of ZM will better support x264, so I test that right now.. That's for my hobby. (But I could buy an expensive custom made system)
 
Old 03-16-2018, 08:47 AM   #19
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 514

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Like I mentioned before, the DDX driver you use has no impact on the hardware video decoding, only the used drm driver does. So whether you use 'intel' or 'modesetting' only impacts your 2d rendering, nothing else.

To check whether video decoding works with VA-API run "va-info". For me this returns:

Quote:
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.1.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
And then you just need a player that supports VA-API, and potentially find the setting that enables it for that player if it's not enabled by default.
 
Old 03-17-2018, 07:56 AM   #20
zdolar
LQ Newbie
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by ppr:kut View Post
Like I mentioned before, the DDX driver you use has no impact on the hardware video decoding, only the used drm driver does. So whether you use 'intel' or 'modesetting' only impacts your 2d rendering, nothing else.

To check whether video decoding works with VA-API run "va-info". For me this returns:



And then you just need a player that supports VA-API, and potentially find the setting that enables it for that player if it's not enabled by default.
Thank you ppr:kut!

You can see my vainfo output in my very first post.
Looks like my expectations were right. The confguration of the sistem is right, I just have to configure ffmpeg to use HW acceleration.
Is there any special option at configure (pre compile, and at runtime) for Intel HD graphics?
Compile config of ffmpeg from Slackware contributor Eric Hameleers is:
Code:
TMPDIR="$TMP" \
CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \
CPPFLAGS="-I$FFMPEGDEPSDIR/usr/include -I$FFMPEGDEPSDIR/usr/include/SDL" \
CXXFLAGS="-I$FFMPEGDEPSDIR/usr/include -I$FFMPEGDEPSDIR/usr/include/SDL $SLKCFLAGS" \
LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS -lpng -lXext" \
PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
PATH="$FFMPEGDEPSDIR/usr/bin:$PATH" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --shlibdir=/usr/lib${LIBDIRSUFFIX} \
  --docdir=/usr/doc/${PRGNAM}-${VERSION} \
  --mandir=/usr/man \
  --enable-gpl \
  --enable-version3 \
  --enable-avfilter \
  --enable-avresample \
  --enable-libmp3lame \
  --enable-libass \
  --enable-libdc1394 \
  --enable-libfribidi \
  --enable-libgsm \
  --enable-libmfx \
  --enable-libopencore-amrnb \
  --enable-libopencore-amrwb \
  --enable-libopus \
  --enable-libssh \
  --enable-libspeex \
  --enable-libtheora \
  --enable-libv4l2 \
  --enable-libvo-amrwbenc \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libwavpack \
  --enable-libx264 \
  --enable-libx265 \
  --enable-libzvbi \
  --enable-postproc \
  --enable-runtime-cpudetect \
  --enable-sdl2 \
  --enable-vaapi \
  --enable-vdpau \
  --enable-pthreads \
  --enable-bzlib \
  --enable-zlib \
  --enable-shared \
  --enable-static \
  --disable-debug \
  ${USE_BLURAY} \
  ${USE_WEBP} \
  ${USE_OPENCL} \
  ${USE_PULSE} \
  ${USE_NONFREE} \
  $ARCHOPTS \
  --extra-cflags="-I$FFMPEGDEPSDIR/usr/include -I$FFMPEGDEPSDIR/usr/include/SDL2 -DRUNTIME_CPUDETECT" \
  --extra-ldflags="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} -ldl -lssl -lcrypto -lz -lusb -ldrm" \
  --pkg-config-flags="--static" \
  2>&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log
  # Use ffmpeg's own implementation:
  #--enable-librtmp \
make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_ffmpeg.log
Is there any runtime config of ffmpeg/ffplay, to enable libva and internal Intel HD graphics acceleration?
 
Old 03-17-2018, 08:06 AM   #21
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 514

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Normally ffmpeg picks up libvdpau and libva automatically if they are installed on the system, but you can also see in the configure parameters that those are there (--enable-vdpau --enable-vaapi).
From there on it depends on what you want to do.

https://trac.ffmpeg.org/wiki/Hardware/VAAPI should help you figuring out the correct arguments for ffmpeg itself. However, ffmpeg is no media play and ffplay is not a very sophisticated one. Depending on what you want to achieve you might be better off looking at how to configure vaapi for vlc or xine.
 
Old 03-17-2018, 11:32 AM   #22
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230Reputation: 1230
Quote:
Originally Posted by ppr:kut View Post
However, ffmpeg is no media play and ffplay is not a very sophisticated one. Depending on what you want to achieve you might be better off looking at how to configure vaapi for vlc or xine.
Or maybe our BDFL will have mercy for those poor souls who have 15W CPUs and bless them to use MPlayer with VA-API, via https://github.com/i-rinat/libvdpau-va-gl

Excuse me, but the lack of libvdpau-va-gl from Slackware is really ridiculous, in the context where the distro officially ships MPlayer, also VDPAU and VA-API support.

The OP's computer is poster child of that missing/messing feature. NOT everyone have a modern computer driven by a ThreadRipper or a Ryzen with 8 cores and 16 threads, you know...

Last edited by Darth Vader; 03-17-2018 at 11:34 AM.
 
Old 03-19-2018, 09:11 AM   #23
zdolar
LQ Newbie
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 1
Thank you all, especially ppr:kut !

Realized that the problem is almost sure in ffmpeg, as vainfo and Xorg.log show HW accelerated system.

Darth Vader for your record: Currently I use "Intel(R) Core(TM) i5-3210M CPU" machine for two cameras and take a look at attached picture. It easy cope with demands, max load less than 33%! So no problem with 25% faster i5-7200U. So don't be insulting and cool please.

Will post here after success with ffmpeg.
Attached Thumbnails
Click image for larger version

Name:	ZM_SLoad.jpg
Views:	22
Size:	141.8 KB
ID:	27220  

Last edited by zdolar; 03-19-2018 at 09:12 AM.
 
Old 03-28-2018, 06:17 AM   #24
zdolar
LQ Newbie
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 1
advances in a field

Hi!

CPU: Intel i5-7200U
OS: Slackware64-14.2
Test video: Tears_400_x265.mp4
Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1920x800, 402 kb/s, 24 fps, 24 tbr, 24k tbn, 24 tbc (default)


I found two excellent pages regarding new Intel processors optimizations/settings for video acceleration with internal GPU:
https://gist.github.com/Brainiarc7/a...ad6cdd835efe57
https://gist.github.com/Brainiarc7/9...b2931bed379219

Following the above, I set up all correctly and verified, that HW accleration on my system is working - GuC: Loaded firmware at booting and vainfo output.


ffmpeg - compiled on my system and optimized for libva. Version 3.4.2
BUT, the interesting part are codecs.
Code:
root@video:~/Videos$ ffmpeg -hide_banner -codecs |grep vaapi
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: libx264 libx264rgb h264_v4l2m2m h264_vaapi )
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 hevc_vaapi )
 DEVIL. mjpeg                Motion JPEG (encoders: mjpeg mjpeg_vaapi )
 DEV.L. mpeg2video           MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m ) (encoders: mpeg2video mpeg2_vaapi )
 DEV.L. vp8                  On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx ) (encoders: libvpx vp8_v4l2m2m vp8_vaapi )
 DEV.L. vp9                  Google VP9 (decoders: vp9 libvpx-vp9 ) (encoders: libvpx-vp9 vp9_vaapi )
From the above it is clear, that ffmpeg can take advantage of vaapi ONLY for encoding, but not for decoding/play.
Test ffplay with Tears_400_x265.mp4 working without HW acceleration, CPU load around 30%.
Is there anybody, that can explain that? Are there any special config options at compile, to enable vaapi capable decoders and not only encoders?

VLC-3.0.1 - compiled on my system and optimized for libva.
VLC is practicaly GUI for ffmpeg. I compiled VLC to include the same version of ffmpeg as above.
BUT I way highly surprised: VLC uses libva and HW acceleration! CPU use less than 5%.
Code:
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
[00007f9804c0f010] avcodec decoder: Using Intel i965 driver for Intel(R) Kaby Lake - 2.1.0 for hardware decoding
[hevc @ 0x7f9804c12260] Using deprecated struct vaapi_context in decode.
But VLC HW assisted video play output is crippled, colors are distorted.
Take look at a screenshot attachment.
Maybe last line of log above mean something?

So two unresolved questions:

1. Why ffmpeg on its own can't play HW accelerated video, VLC which uses the same ffmpeg as background can?
2. VLC video distortion.

Any ideas?
Attached Thumbnails
Click image for larger version

Name:	VLC-3.0.1_Tears_400_x265.jpg
Views:	19
Size:	224.3 KB
ID:	27316  
 
Old 04-05-2018, 08:30 AM   #25
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Rep: Reputation: 17
Quote:
Originally Posted by zdolar View Post
I've tested both above suggestions.
1. xf86-video-intel-git_20160601_b617f80-x86_64-1 - HW acceleration do not work for any video type.
2. modesetting driver which comes in the Kernel itself - tested with kernel 4.15.9, 4.14.17, 4.14.26
The same result with all kernel drivers, X cripled GUI, hardly recognisable icons to skip out from X to text console.

Looks like first variant is the only option.
The machine is playground/testing for Linux video capabilities, in real I will need hardware accelerated ffmpeg for x264 video.

As Linux boxes can decode/encode video with intel GPU help I want to achieve that in Slackware as it's far most stable distro and I play with it for more than two decades.
As Intel develops opensource Linux drivers for its integrated graphic, I believe in success.
Here I add a part of Xorg.log regarding Intel GPU.

Code:
[ 70618.090] 
X.Org X Server 1.18.3
Release Date: 2016-04-04
[ 70618.090] X Protocol Version 11, Revision 0
[ 70618.090] Build Operating System: Slackware 14.2 Slackware Linux Project
[ 70618.090] Current Operating System: Linux video 4.14.26 #1 SMP Wed Mar 14 19:19:55 CET 2018 x86_64
[ 70618.091] Kernel command line: BOOT_IMAGE=kernel-4.14.26 ro root=802 vt.default_utf8=1 usbhid.quirks=0x0c45:0x7401:0x0004 i915.enable_guc_loading=1 i915.enable_guc_submission=1
[ 70618.091] Build Date: 18 October 2017  12:21:16PM
[ 70618.091]  
[ 70618.091] Current version of pixman: 0.34.0
[ 70618.091] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[ 70618.092] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 70618.093] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Mar 15 16:08:39 2018
[ 70618.093] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 70618.093] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 70618.094] (==) No Layout section.  Using the first Screen section.
[ 70618.094] (**) |-->Screen "Screen0" (0)
[ 70618.094] (**) |   |-->Monitor "<default monitor>"
[ 70618.095] (==) No device specified for screen "Screen0".
	Using the first device section listed.
[ 70618.095] (**) |   |-->Device "Intel Graphics"
[ 70618.095] (==) No monitor specified for screen "Screen0".
	Using a default monitor configuration.
[ 70618.095] (==) Automatically adding devices
[ 70618.095] (==) Automatically enabling devices
[ 70618.095] (==) Automatically adding GPU devices
[ 70618.095] (==) Max clients allowed: 256, resource mask: 0x1fffff
...
[ 70618.095] (==) ModulePath set to "/usr/lib64/xorg/modules"
[ 70618.095] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 70618.095] (II) Loader magic: 0x807c00
[ 70618.095] (II) Module ABI versions:
[ 70618.095] 	X.Org ANSI C Emulation: 0.4
[ 70618.095] 	X.Org Video Driver: 20.0
[ 70618.095] 	X.Org XInput driver : 22.1
[ 70618.095] 	X.Org Server Extension : 9.0
[ 70618.096] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 70618.100] (--) PCI:*(0:0:2:0) 8086:5916:8086:0000 rev 2, Mem @ 0xde000000/16777216, 0xa0000000/536870912, I/O @ 0x0000f000/64, BIOS @ 0x????????/131072
[ 70618.100] (II) Open ACPI successful (/var/run/acpid.socket)
[ 70618.100] (II) "glx" will be loaded by default.
[ 70618.100] (II) LoadModule: "vnc"
[ 70618.102] (II) Loading /usr/lib64/xorg/modules/extensions/libvnc.so
[ 70618.119] (II) Module vnc: vendor="TigerVNC Project"
[ 70618.119] 	compiled for 1.18.3, module version = 1.0.0
[ 70618.119] 	Module class: X.Org Server Extension
[ 70618.119] 	ABI class: X.Org Server Extension, version 9.0
[ 70618.119] (II) LoadModule: "glx"
[ 70618.120] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[ 70618.122] (II) Module glx: vendor="X.Org Foundation"
[ 70618.122] 	compiled for 1.18.3, module version = 1.0.0
[ 70618.122] 	ABI class: X.Org Server Extension, version 9.0
[ 70618.122] (==) AIGLX enabled
[ 70618.123] (II) LoadModule: "intel"
[ 70618.123] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so
[ 70618.123] (II) Module intel: vendor="X.Org Foundation"
[ 70618.123] 	compiled for 1.18.3, module version = 2.99.917
[ 70618.123] 	Module class: X.Org Video Driver
[ 70618.123] 	ABI class: X.Org Video Driver, version 20.0
[ 70618.123] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
	i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
	915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
	Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
	GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[ 70618.123] (II) intel: Driver for Intel(R) HD Graphics: 2000-6000
[ 70618.123] (II) intel: Driver for Intel(R) Iris(TM) Graphics: 5100, 6100
[ 70618.123] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300
[ 70618.123] (--) using VT number 7

[ 70618.133] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20170818
[ 70618.145] (--) intel(0): gen9 engineering sample
[ 70618.145] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2; using a maximum of 2 threads
[ 70618.145] (II) intel(0): Creating default Display subsection in Screen section
	"Screen0" for depth/fbbpp 16/16
[ 70618.145] (**) intel(0): Depth 16, (--) framebuffer bpp 16
[ 70618.145] (==) intel(0): RGB weight 565
[ 70618.145] (==) intel(0): Default visual is TrueColor
[ 70618.145] (**) intel(0): Option "AccelMethod" "sna"
[ 70618.145] (**) intel(0): Option "TearFree" "true"
[ 70618.146] (II) intel(0): Output DP1 has no monitor section
[ 70618.146] (II) intel(0): Enabled output DP1
[ 70618.146] (II) intel(0): Output HDMI1 has no monitor section
[ 70618.146] (II) intel(0): Enabled output HDMI1
[ 70618.146] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[ 70618.146] (II) intel(0): Output VIRTUAL1 has no monitor section
[ 70618.146] (II) intel(0): Enabled output VIRTUAL1
[ 70618.146] (--) intel(0): Output DP1 using initial mode 1680x1050 on pipe 0
[ 70618.146] (**) intel(0): TearFree enabled
[ 70618.146] (==) intel(0): DPI set to (96, 96)
[ 70618.146] (II) Loading sub module "dri2"
[ 70618.146] (II) LoadModule: "dri2"
[ 70618.146] (II) Module "dri2" already built-in
[ 70618.146] (II) Loading sub module "present"
[ 70618.146] (II) LoadModule: "present"
[ 70618.146] (II) Module "present" already built-in
[ 70618.146] (II) intel(0): SNA initialized with generic backend
[ 70618.146] (==) intel(0): Backing store enabled
[ 70618.146] (==) intel(0): Silken mouse enabled
[ 70618.146] (II) intel(0): HW Cursor enabled
[ 70618.146] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[ 70618.146] (==) intel(0): DPMS enabled
[ 70618.146] (==) intel(0): Display hotplug detection enabled
[ 70618.146] (II) intel(0): Textured video not supported on this hardware or backend
[ 70618.146] (II) intel(0): [DRI2] Setup complete
[ 70618.146] (II) intel(0): [DRI2]   DRI driver: i965
[ 70618.146] (II) intel(0): [DRI2]   VDPAU driver: va_gl
[ 70618.146] (II) intel(0): direct rendering: DRI2 enabled
[ 70618.146] (II) intel(0): hardware support for Present enabled
[ 70618.146] (WW) intel(0): Option "SecurityTypes" is not used
[ 70618.146] (WW) intel(0): Option "PasswordFile" is not used
[ 70618.146] (--) RandR disabled
[ 70618.151] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[ 70618.151] (II) AIGLX: enabled GLX_ARB_create_context
[ 70618.151] (II) AIGLX: enabled GLX_ARB_create_context_profile
[ 70618.151] (II) AIGLX: enabled GLX_EXT_create_context_es{,2}_profile
[ 70618.151] (II) AIGLX: enabled GLX_INTEL_swap_event
[ 70618.151] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[ 70618.151] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[ 70618.151] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[ 70618.151] (II) AIGLX: enabled GLX_EXT_fbconfig_packed_float
[ 70618.151] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[ 70618.151] (II) AIGLX: enabled GLX_ARB_create_context_robustness
[ 70618.151] (II) AIGLX: Loaded and initialized i965
[ 70618.151] (II) GLX: Initialized DRI2 GL provider for screen 0
[ 70618.152] (II) intel(0): switch to mode 1680x1050@60.0 on DP1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 70618.164] (II) intel(0): Setting screen physical size to 444 x 277
Looks like mode Setting driver is active regardles of
Code:
#  Driver          "modesetting"
Driver      "intel"
placed in /etc/X11/xorg.conf.d/ *.conf file

Looks all good to me, no errors or warnings, hardware acceleration enabled..

Can someone confirm, that the above Xorg.log truly show, that HW acceleration is enabled. If yes, then I have to look for settings in compile/use of ffmpeg and VNC.
intel driver is being used.
You do have HW acceleration. It works out of the box withtout any special configs.
 
Old 04-05-2018, 11:47 AM   #26
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 514

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
Originally Posted by zdolar View Post
ffmpeg - compiled on my system and optimized for libva. Version 3.4.2
BUT, the interesting part are codecs.
Code:
root@video:~/Videos$ ffmpeg -hide_banner -codecs |grep vaapi
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: libx264 libx264rgb h264_v4l2m2m h264_vaapi )
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (encoders: libx265 hevc_vaapi )
 DEVIL. mjpeg                Motion JPEG (encoders: mjpeg mjpeg_vaapi )
 DEV.L. mpeg2video           MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m ) (encoders: mpeg2video mpeg2_vaapi )
 DEV.L. vp8                  On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx ) (encoders: libvpx vp8_v4l2m2m vp8_vaapi )
 DEV.L. vp9                  Google VP9 (decoders: vp9 libvpx-vp9 ) (encoders: libvpx-vp9 vp9_vaapi )
From the above it is clear, that ffmpeg can take advantage of vaapi ONLY for encoding, but not for decoding/play.
Test ffplay with Tears_400_x265.mp4 working without HW acceleration, CPU load around 30%.
Is there anybody, that can explain that? Are there any special config options at compile, to enable vaapi capable decoders and not only encoders?
That's fine, vaapi doesn't have specific decoders you need to select. Instead it works with the -hwaccel parameter (as the wiki page I linked before explains).
The reason you didn't see that in action with ffplay is that even though ffmpeg supports hardware acceleration, ffplay does not.
 
1 members found this post helpful.
Old 04-06-2018, 09:19 AM   #27
zdolar
LQ Newbie
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by ppr:kut View Post
The reason you didn't see that in action with ffplay is that even though ffmpeg supports hardware acceleration, ffplay does not.
OK, that explain, why ffplay is slow. But now I'm confused: VLC in its base is ffmpeg GUI. How come it is fast with video play?
Is there any info regarding including HW acceleration in ffplay?

Last edited by zdolar; 04-06-2018 at 09:20 AM.
 
Old 04-06-2018, 10:01 AM   #28
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,426

Rep: Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206
Quote:
Originally Posted by zdolar View Post
OK, that explain, why ffplay is slow. But now I'm confused: VLC in its base is ffmpeg GUI. How come it is fast with video play?
Is there any info regarding including HW acceleration in ffplay?
If I'm understanding your question properly, it is because vlc doesn't use ffplay to play videos. VLC provides its own GUI and it uses the libraries provided by ffmpeg (libavcodec, libavformat, etc) to support that hardware acceleration.
 
Old 04-07-2018, 05:27 PM   #29
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Rep: Reputation: 17
Quote:
Originally Posted by bassmadrigal View Post
If I'm understanding your question properly, it is because vlc doesn't use ffplay to play videos. VLC provides its own GUI and it uses the libraries provided by ffmpeg (libavcodec, libavformat, etc) to support that hardware acceleration.
VLC uses the QT toolkit.
VLC uses the libavcodec codec but uses its own muxers.

I have only ever used ffmpeg for media encoding. For content consumption MPlayer works best and it has no setup overheads. It's all essentially plug and play.
 
Old 04-07-2018, 09:27 PM   #30
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,426

Rep: Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206
Quote:
Originally Posted by linuxbawks View Post
I have only ever used ffmpeg for media encoding. For content consumption MPlayer works best and it has no setup overheads. It's all essentially plug and play.
I prefer using mplayer as well, but VLC is a very popular video player on all platforms (and mpv is a popular alternative to mplayer). Whether one is better than another is based on opinion...

And if you get Eric's restricted VLC, it supports just about everything, which Slackware's mplayer (and ffmpeg if you're running -current) is limited due to patent restrictions in some countries preventing distribution. You'd need to rebuild ffmpeg and mplayer to be able to fully support everything that Eric's VLC provides.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
video hardware acceleration HP zv5000 N-videa 3NJlYmmB Linux - Newbie 1 01-12-2015 10:03 PM
Hardware acceleration for ATI video card problems? displacedtexan Linux - Hardware 5 04-20-2010 02:29 PM
Xorg 2D hardware acceleration for Intel 865G video card michal017 Linux - Software 9 01-16-2006 02:51 AM
Hardware Video Acceleration and Xinerama deadlove75 Linux - Hardware 0 05-17-2004 04:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration