Opened 5 years ago

Closed 4 years ago

#13345 closed Bug Report - General (Fixed)

VAAPI2 playback of 10bit HEVC 50fps fails

Reported by: Andreas Mayer Owned by: Peter Bennett
Priority: minor Milestone: 30.1
Component: MythTV - Video Playback Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no

Description

mythffmpeg -i hevc_test.ts
Input #0, mpegts, from 'hevc_test.ts':
        Duration: 00:02:47.65, start: 44350.528844, bitrate: 4602 kb/s
        Stream #0:0[0x1ff]: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
        Stream #0:1[0x200](DEU): Audio: aac (LC), 48000 Hz, stereo, fltp, 192 kb/s

I'm using a playback profile with filters, OSD fading and deinterlacing disabled, avsync2 enabled and mythavtest for playback (on a 1920x1080@50 display)

With VAAPI video and audio looks OK (although with -v playback you can see frames being dropped), intel_gpu_top shows 90-98% With VAAPI2 only a few video frames are shown every few seconds, intel_gpu_top shows low gpu utilization.

Change History (10)

comment:1 Changed 5 years ago by Peter Bennett

There are two issues I found with VAAPI2 so far.

On an older computer, H265 is not supported with VAAPI and it was switching to software decoding but only using 1 CPU.

On a newer but less powerful computer it is using VAAPI to decode but it is doing conversions and moving frames around in storage, causing the slowdown.

I have a fix for the first and a partial fix for the second.

comment:2 Changed 5 years ago by Peter Bennett

commit 22de417da6437e877ef6c4d0ae5ee5b4121424c6 (HEAD -> master, origin/master, origin/HEAD)

Author: Peter Bennett <pbennett@mythtv.org>
Date:   Mon Nov 5 16:57:12 2018 -0500

    Playback: Some optimizations
    
    1. Remove a useless call to av_image_fill_arrays.
    2. For VAAPI2, move the conversion of pixel type to the GPU.
    3. For hardware assisted formats, if they fail over to software
       decoding, use the number of CPUs specified in the profile.
    4. Change setup of Playback profiles to allow up to 8 CPUs.
    
    Refs #13345

comment:3 Changed 5 years ago by Peter Bennett <pbennett@…>

In 22de417da6/mythtv:

Playback: Some optimizations

  1. Remove a useless call to av_image_fill_arrays.
  2. For VAAPI2, move the conversion of pixel type to the GPU.
  3. For hardware assisted formats, if they fail over to software decoding, use the number of CPUs specified in the profile.
  4. Change setup of Playback profiles to allow up to 8 CPUs.

Refs #13345

comment:4 Changed 5 years ago by Peter Bennett <pbennett@…>

In 22de417da6/mythtv:

Playback: Some optimizations

  1. Remove a useless call to av_image_fill_arrays.
  2. For VAAPI2, move the conversion of pixel type to the GPU.
  3. For hardware assisted formats, if they fail over to software decoding, use the number of CPUs specified in the profile.
  4. Change setup of Playback profiles to allow up to 8 CPUs.

Refs #13345

comment:5 Changed 5 years ago by Peter Bennett

commit 9d627fe9eec3aca85e7ae62ada8f04b2cf26fc83 (HEAD -> master, origin/master)

Author: Peter Bennett <pbennett@mythtv.org>
Date:   Wed Nov 7 14:13:43 2018 -0500

    VAAPI2 playback: Optimizations
    
    Where possible, retrieve frames directly into MythTV Video Buffers
    instead of via an ffmpeg buffer.
    
    Refs #13345

comment:6 Changed 5 years ago by Peter Bennett <pbennett@…>

In 9d627fe9e/mythtv:

VAAPI2 playback: Optimizations

Where possible, retrieve frames directly into MythTV Video Buffers
instead of via an ffmpeg buffer.

Refs #13345

comment:7 Changed 5 years ago by Peter Bennett <pbennett@…>

In 9d627fe9e/mythtv:

VAAPI2 playback: Optimizations

Where possible, retrieve frames directly into MythTV Video Buffers
instead of via an ffmpeg buffer.

Refs #13345

comment:8 Changed 5 years ago by Peter Bennett

Milestone: needs_triage30.1

comment:9 Changed 4 years ago by Mac Michaels

Why is this bug still open?

commit 9d627fe9e/mythtv: appears to be in the fixes/30 branch and the master tree. I use an NVIDIA card in my system and enable VAAPI2 on my system, but I don't playback 10bit HEVC 50fps.

comment:10 Changed 4 years ago by Peter Bennett

Resolution: Fixed
Status: newclosed
Note: See TracTickets for help on using tickets.