HEVC Main 10 support via VAAPI in Linux with modern intel graphic

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
laasa
Junior
Posts: 19
Joined: Tue Jan 03, 2017 2:48 pm
Germany

HEVC Main 10 support via VAAPI in Linux with modern intel graphic

Post by laasa »

The task is to play HEVC Main 10 coded video material like broadcasted via satelite ASTRA 1 (see http://www.astra.de/18049106/ultra-hd).

MPV shows that VAAPI hardware decoding and video output works fine (mpv --fs --no-config --hwdec=vaapi --vo=vaapi $1).
When using other video outputs with MPV (e.g. --vo=opengl-hq) I get same choppy video output as in mythtv and VAAPI.
There seems to be no option to select VAAPI video output inside MythTV.

The question is if there is any plan to have VAAPI video output support in mythtv in near future?

Only if interested: My test hardware is NUC6CAYH (with Intel Celeron J3455 and Intel HD Grafik 500).
When playing same material in windows (e.g. via KODI) all is fine.

Thanks,
laasa.
User avatar
stuarta
Developer
Posts: 220
Joined: Wed Feb 05, 2014 5:13 pm
Great Britain

Re: HEVC Main 10 support via VAAPI in Linux with modern intel graphic

Post by stuarta »

Hi,

We already have VAAPI support, however it has stopped working under wayland on F26 and newer.
Please share the distro / x window system you are using, and the output of `vainfo`


Regards
Stuart
laasa
Junior
Posts: 19
Joined: Tue Jan 03, 2017 2:48 pm
Germany

Re: HEVC Main 10 support via VAAPI in Linux with modern intel graphic

Post by laasa »

Hi,

I am using Mythbuntu 16.04 64 Bit with kernel 4.10.0-38-generic.
VAAPI is working and vainfo output is perfect.

With MPV (master branch and self compiled) under same conditions HEVC Main 10 videos working perfect.
But only when set decoding and video output to VAAPI in the MPV options.
When set video output method to opengl (like used in MythTV) I get choppy video output (like with MythTV).

In MythTV there is no other video output method available when selecting VAAPI for decoding.
So I assume that VAAPI as video output method is not implemented.

Regards,
Laasa.
User avatar
stuarta
Developer
Posts: 220
Joined: Wed Feb 05, 2014 5:13 pm
Great Britain

Re: HEVC Main 10 support via VAAPI in Linux with modern intel graphic

Post by stuarta »

Hi,

That is not correct, MythTV has supported VAAPI for a long time.
Selecting OpenGL video output profile does not use VAAPI,
you need to set it up to use the `VAAPI Normal` profile.

Regards
Stuart
laasa
Junior
Posts: 19
Joined: Tue Jan 03, 2017 2:48 pm
Germany

Re: HEVC Main 10 support via VAAPI in Linux with modern intel graphic

Post by laasa »

Hi,

sorry when it sounds like criticism. I only want to find out what is possible in MythTV and what is in plan.
To play 4K HDR material could be interesting for many people next months.

MythTV is supporting vaapi for a long time. I am using it for AVC and HEVC in SD and HD and it works fine.
But it seems to have issues with HEVC and 4K and HDR (possibly only on my hardware).

So I try to have some more investigations for a recorded file from a ASTRA UHD channel.
The result is again that MPV can play this video when using vaapi for decoding and for video output (via x11).
When I call MPV with video output method opengl I get the same choppy video output as via mythtv.
The question is if it helps to add vaapi video output via x11 in MythTV to get same good result as with MPV.

mediainfo video details:
Video
ID : 511 (0x1FF)
Menu ID : 1 (0x1)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@Main
Codec ID : 36
Duration : 16h 44mn
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Writing library : ATEME Titan File 3.7.7 (4.7.7.1)
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : BT.2020
Matrix coefficients : BT.2020 non-constant

mythavtest log file are here (-v playback)
...
2017-11-14 21:36:46.903163 I Using Frameless Window
2017-11-14 21:36:46.903181 I Using Full Screen Window
2017-11-14 21:36:46.926322 I UI Screen Resolution: 1920 x 1200
2017-11-14 21:36:46.967877 W OpenGL: Could not determine whether Sync to VBlank is enabled.
2017-11-14 21:36:46.976678 I Trying the OpenGL 2.0 render
2017-11-14 21:36:46.983807 I OpenGL painter using existing OpenGL context.
2017-11-14 21:36:47.000775 I OpenGL2: GLSL supported
2017-11-14 21:36:47.000836 I OpenGL: OpenGL vendor : Intel Open Source Technology Center
2017-11-14 21:36:47.000847 I OpenGL: OpenGL renderer: Mesa DRI Intel(R) HD Graphics 500 (Broxton 2x6)
2017-11-14 21:36:47.000852 I OpenGL: OpenGL version : 3.0 Mesa 17.0.7
2017-11-14 21:36:47.000862 I OpenGL: Max texture size: 16384 x 16384
2017-11-14 21:36:47.000868 I OpenGL: Max texture units: 8
2017-11-14 21:36:47.000876 I OpenGL: Direct rendering: Yes
2017-11-14 21:36:47.000886 I OpenGL: Extensions Supported: 1e1b
2017-11-14 21:36:47.000890 I OpenGL: PixelBufferObject support available
2017-11-14 21:36:47.058203 I OpenGL: Initialised MythRenderOpenGL
...
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
...
2017-11-14 21:36:48.893198 I AFD: Selected track #0 (id 0x1ff codec id H265, type Video, bitrate 500000 at 0x1a3d5c0)
2017-11-14 21:36:48.894201 I FilterManager: GetFilterInfo(greedyhdeint) returning: 0x28d6240
2017-11-14 21:36:48.894212 I FilterManager: GetFilterInfo(greedyhdoubleprocessdeint) returning: 0x28d6370
2017-11-14 21:36:48.894404 I VDP: decoder<->render support: ffmpeg null xlib xshm xv-blit opengl opengl-lite vdpau nullvdpau nullvaapi openglvaapi
2017-11-14 21:36:48.894415 I VDP: decoder<->render support: vdpau vdpau nullvdpau
2017-11-14 21:36:48.894423 I VDP: decoder<->render support: vaapi nullvaapi openglvaapi
2017-11-14 21:36:48.894432 I VDP: decoder<->render support: crystalhd null xlib xshm xv-blit opengl opengl-lite vdpau nullvdpau nullvaapi
2017-11-14 21:36:48.902808 I VDP: Accepting: cmp() dec(vaapi) cpus(2) skiploop(enabled) rend(openglvaapi) osd(opengl2) osdfade(enabled) deint(vaapibobdeint,vaapionefield) filt()
2017-11-14 21:36:48.902839 I VDP: LoadBestPreferences(2048x2048, 0)
2017-11-14 21:36:48.902865 I VDP: LoadBestPreferences(2048x2048, 60)
2017-11-14 21:36:48.902884 I VDP: LoadBestPreferences(3840x2160, 60)
2017-11-14 21:36:48.906613 I VAAPI: Version: 0.39
2017-11-14 21:36:48.906630 I VAAPI: Driver : Intel i965 driver for Intel(R) Broxton - 1.7.0
2017-11-14 21:36:48.906638 I VAAPI: Created VAAPI X11 display
2017-11-14 21:36:48.906668 I VAAPI: Profile: MPEG2Simple Entrypoints: VLD
2017-11-14 21:36:48.906677 I VAAPI: Profile: MPEG2Main Entrypoints: VLD
2017-11-14 21:36:48.906686 I VAAPI: Profile: H264ConstrainedBase Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906696 I VAAPI: Profile: H264Main Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906706 I VAAPI: Profile: H264High Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906714 I VAAPI: Profile: Unknown Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906722 I VAAPI: Profile: H264StereoHigh Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906730 I VAAPI: Profile: VC1Simple Entrypoints: VLD
2017-11-14 21:36:48.906738 I VAAPI: Profile: VC1Main Entrypoints: VLD
2017-11-14 21:36:48.906745 I VAAPI: Profile: VC1Advanced Entrypoints: VLD
2017-11-14 21:36:48.906754 I VAAPI: Profile: None Entrypoints: VideoProc (UNSUPPORTED)
2017-11-14 21:36:48.906762 I VAAPI: Profile: Unknown Entrypoints: VLD Unknown
2017-11-14 21:36:48.906770 I VAAPI: Profile: Unknown Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906778 I VAAPI: Profile: HEVCMain Entrypoints: VLD EncSlice (UNSUPPORTED)
2017-11-14 21:36:48.906785 I VAAPI: Profile: HEVCMain10 Entrypoints: VLD
2017-11-14 21:36:48.906793 I VAAPI: Profile: Unknown Entrypoints: VLD
2017-11-14 21:36:48.906803 I VAAPI: Desired profile for 'HEVC VAAPI': HEVCMain
2017-11-14 21:36:48.906810 I VAAPI: Found profile HEVCMain with entry VLD
2017-11-14 21:36:48.906822 I VAAPI: Created context (3840x2160->3840x2160)
2017-11-14 21:36:48.907255 I VAAPI: Deleting VAAPI display.
2017-11-14 21:36:48.907273 I VAAPI: Deleted context
2017-11-14 21:36:48.907337 I AFD: Using 1 CPUs for decoding
2017-11-14 21:36:48.907354 I AFD: InitVideoCodec() 0x28dd2e0 id(H265) type (Video).
...
2017-11-14 21:36:48.974701 I VideoOutput: Allowed renderers: openglvaapi
2017-11-14 21:36:48.974744 I VideoOutput: Allowed renderers (filt: vaapi): openglvaapi
2017-11-14 21:36:48.980682 I VDP: Accepting: cmp() dec(vaapi) cpus(2) skiploop(enabled) rend(openglvaapi) osd(opengl2) osdfade(enabled) deint(vaapibobdeint,vaapionefield) filt()
2017-11-14 21:36:48.980718 I VDP: LoadBestPreferences(2048x2048, 0)
2017-11-14 21:36:48.980764 I VDP: LoadBestPreferences(2048x2048, 60)
2017-11-14 21:36:48.980793 I VDP: LoadBestPreferences(3840x2160, 60)
2017-11-14 21:36:48.980834 I VideoOutput: Preferred renderer: openglvaapi
2017-11-14 21:36:48.980856 I VideoOutput: Trying video renderer: 'openglvaapi'
2017-11-14 21:36:49.024614 I VDP: Accepting: cmp() dec(vaapi) cpus(2) skiploop(enabled) rend(openglvaapi) osd(opengl2) osdfade(enabled) deint(vaapibobdeint,vaapionefield) filt()
2017-11-14 21:36:49.024648 I VDP: LoadBestPreferences(2048x2048, 0)
2017-11-14 21:36:49.024677 I VDP: LoadBestPreferences(2048x2048, 60)
2017-11-14 21:36:49.024743 I VideoOutWindow::SetPIPState. pip_state: 0]
2017-11-14 21:36:49.024761 I VDP: LoadBestPreferences(2048x2048, 50)
2017-11-14 21:36:49.024800 I Display Rect left: 0, top: 150, width: 1920, height: 900, aspect: 1.33333
2017-11-14 21:36:49.024820 I Video Rect left: 0, top: 0, width: 3840, height: 2160, aspect: 1.77778
2017-11-14 21:36:49.024837 I VDP: LoadBestPreferences(3840x2160, 50)
2017-11-14 21:36:49.024864 I Display Rect left: 0, top: 150, width: 1920, height: 900, aspect: 1.33333
2017-11-14 21:36:49.024883 I Video Rect left: 0, top: 0, width: 3840, height: 2160, aspect: 1.77778
2017-11-14 21:36:49.024898 I VDP: SetVideoRenderer(openglvaapi)
2017-11-14 21:36:49.024914 I VDP: SetVideoRender(openglvaapi) == GetVideoRenderer()
2017-11-14 21:36:49.025042 I VidOutGL: Using main UI render context
2017-11-14 21:36:49.026304 I VideoOutput: Pixel dimensions: Screen 1920x1200, window 1920x1200
2017-11-14 21:36:49.026339 I VideoOutput: Actual display dimensions: 508x317 mm Aspect: 1.60252
2017-11-14 21:36:49.026359 I VideoOutput: Estimated window dimensions: 508x317 mm Aspect: 1.60252
2017-11-14 21:36:49.026381 I VidOutGL: Using main UI painter
2017-11-14 21:36:49.026473 I GLVid: Viewport: 3840x2160
2017-11-14 21:36:49.026541 I ColourSpace: PictureAttributes:
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
2017-11-14 21:36:49.265726 I GLVid: Creating resize filter.
2017-11-14 21:36:49.270611 I GLVid: Using raw RGBA input textures.
2017-11-14 21:36:49.270652 I GLVid: MMX: 1 PBO: 1
2017-11-14 21:36:49.270697 I Display Rect left: 0, top: 59, width: 1920, height: 1082, aspect: 1.60252
2017-11-14 21:36:49.270711 I Video Rect left: 0, top: 0, width: 3840, height: 2160, aspect: 1.77778
2017-11-14 21:36:49.275020 I VAAPI: Created VAAPI GLX display
2017-11-14 21:36:49.275047 I VAAPI: Desired profile for 'HEVC VAAPI': HEVCMain
2017-11-14 21:36:49.275055 I VAAPI: Found profile HEVCMain with entry VLD
2017-11-14 21:36:49.275068 I VAAPI: Created context (3840x2160->3840x2160)
2017-11-14 21:36:49.275430 I VAAPI: Created 24 buffers
2017-11-14 21:36:49.275482 I ColourSpace: PictureAttributes: Brightness, Contrast, Colour, Hue,
2017-11-14 21:36:49.279101 I Over/underscan. V: 0, H: 0
2017-11-14 21:36:49.279132 I Display Rect left: 0, top: 59, width: 1920, height: 1082, aspect: 1.60252
2017-11-14 21:36:49.279143 I Video Rect left: 0, top: 0, width: 3840, height: 2160, aspect: 1.77778
2017-11-14 21:36:49.279185 I Player(0): LoadFilters(''..) -> 0x0
2017-11-14 21:36:49.288362 I Player(0): Decoder thread starting.
..
2017-11-14 21:36:49.691733 I VAAPI: Number of VAAPI GLX surfaces: 1

I have checked MythTV V0.28 and V29.
The selected video profile is "VAAPI normal" (VAAPI decoder, openglvaapi video output).
Using openglvaapi as video output method means using module is mythtv\libs\libmythtv\videoout_openglvaapi.cpp.
It looks like that the via VAAPI decoded frames giving to opengl for rendering.

MPV
MPV log is as followed when called via mpv --fs --no-config --hwdec=vaapi --vo=vaapi file
...
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Using hardware decoding (vaapi).
VO: [vaapi] 3840x2160 vaapi[nv12]

So MPV is using vaapi for decoding (module mpv/video/vaapi.c) and vaapi for video out (module mpv/video/out/vo_vaapi.c).
The vaapi video out based on X11. It looks like that the via vaapi decoded frames giving direct to X11.
Post Reply