Opened 8 years ago

Closed 5 years ago

#12992 closed Bug Report - General (Fixed)

VDPAU HEVC / h265 decode support broken if deinterlacing is on

Reported by: Dave Chiluk <chiluk@…> Owned by: Mark Kendall
Priority: minor Milestone: 31.0
Component: MythTV - General Version: Master Head
Severity: low Keywords:
Cc: Ticket locked: no

Description

VDPAU HEVC / h265 decode support broken if deinterlacing is on.

Related forum thread https://forum.mythtv.org/viewtopic.php?f=3&t=1881&p=9435#p9435

It looks like the correct bits need to get set in the switch (video_codec_id) section of VideoOutputVDPAU::DrawSlice?

Attachments (2)

logexcerpt.txt (3.8 KB) - added by Dave Chiluk <chiluk@…> 8 years ago.
Log excerpt
20170803_dave_chiluk_disable_x265_deint.patch (1.1 KB) - added by Peter Bennett 7 years ago.
Dave Chiluk's X265 VDPAU patch

Download all attachments as: .zip

Change History (26)

Changed 8 years ago by Dave Chiluk <chiluk@…>

Attachment: logexcerpt.txt added

Log excerpt

comment:1 Changed 8 years ago by Stuart Auchterlonie

Milestone: unknown29.0
Owner: set to JYA
Status: newassigned

comment:2 Changed 8 years ago by Stuart Auchterlonie

There's a patch on the forum thread which needs to be reviewed

comment:3 Changed 8 years ago by chiluk <chiluk@…>

I don't think the patch on the forum is acceptable, as it simply disables de-interlacing.

comment:4 Changed 8 years ago by chiluk <chiluk@…>

Ubuntu bug opened about this.

https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/1673481

After having reviewed this again, I really think this should integrated and then really fixed once a de-interlacing solution is found.

comment:5 Changed 8 years ago by chiluk@…

Hey jyavenard, have you made any progress on this? I've been a bit distracted the last few months, but I'm finally getting back around to this.

Interesting thing to note here is that this only affects machines that support HEVC offloading, which I think is only available in Pascal and newer cards.

comment:6 Changed 8 years ago by JYA

I didn't know I was supposed to look at this.

I have no particular urge to fix anything related to hevc. it's evil

comment:7 Changed 8 years ago by Gary Buhrmaster <gary.buhrmaster@…>

And to add to the mix, I have this vague recollection that nVidia has deprecated future VDPAU enhancements (although they continue to support the existing capabilities, and add partial tolerance for new hardware) in favor of their (new and improved) NVDEC API which is needed for some of the latest/greatest decoding capabilities on some of the latest/greatest GPUs, so likely the proper long term fix is a new video pipeline.

comment:8 Changed 8 years ago by chiluk@…

Well, in that case, I'm going to apply that forum patch to all xenial+ Ubuntu releases. If we come up with a better solution for mythtv, I'll gladly integrate that later down the road. I've been running with this patch for the last few months now, and I haven't seen anything untoward. I'd rather have it working, than failing, even if deinterlacing is forced off. After all most everything is progressive now-adays anyway.

comment:9 Changed 8 years ago by Peter Bennett

Where does one find x265 interlaced video? It seems to me that the world is moving away from interlaced video. I have never come across x264 interlaced video, let alone x265 interlaced video.

comment:10 Changed 8 years ago by Peter Bennett

Owner: changed from JYA to Peter Bennett

comment:11 in reply to:  9 Changed 8 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Replying to pbennett:

Where does one find x265 interlaced video? It seems to me that the world is moving away from interlaced video. I have never come across x264 interlaced video, let alone x265 interlaced video.

Technically, both H.264 and H.265 support interlaced content. However, as you say, because most SoC vendors do not wish to integrate/license good de-interlacers (the silicon die space for the dedicated hardware and the IP tends to be expensive), they have pushed to see interlaced content disappear.

MythTV can either support the standards (however unlikely some parts of those standards are likely to be seen in the real world) or simply document that do not.

comment:12 Changed 7 years ago by Peter Bennett

Here is the patch from Dave Chiluk (modified for oour repository structure). I have superficially tested it on a low level VDPAU card that does not support H265 hardware decoding and there is no adverse effect with H264, H265 or MPEG2 content. If there are no objections, I will apply it.

Changed 7 years ago by Peter Bennett

Dave Chiluk's X265 VDPAU patch

comment:13 Changed 7 years ago by Dave Chiluk <chiluk@…>

In b63e92cc00f466391157cb45830f98d2e1a58dcd/mythtv:

Video Playback: Workaround for VDPAU h265 interlaced playback

Allow VDPAU h265 interlaced playback without deinterlacing.

Refs #12992

Signed-off-by: Peter Bennett <pbennett@…>

comment:14 Changed 7 years ago by Dave Chiluk <chiluk@…>

In 022d0989f1d015b252c89ce797185652834e61e7/mythtv:

Video Playback: Workaround for VDPAU h265 interlaced playback

Allow VDPAU h265 interlaced playback without deinterlacing.

Refs #12992

Signed-off-by: Peter Bennett <pbennett@…>
(cherry picked from commit b63e92cc00f466391157cb45830f98d2e1a58dcd)

comment:15 Changed 7 years ago by Peter Bennett

Milestone: 29.029.1

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

In c0a2558689915b0fe9aa3b2bf7d41e21d395e10e/mythtv:

Video Playback: Fix compile error on debian jessie

Prior commit for for VDPAU h265 needs to have an ifdef so that it
does not fail compile if the vdpau.h file is old and does not
have H265 support.

Refs #12992

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

In ad5f88b1174ea49a133d920cb454f4810b1c1ff8/mythtv:

Video Playback: Fix compile error on debian jessie

Prior commit for for VDPAU h265 needs to have an ifdef so that it
does not fail compile if the vdpau.h file is old and does not
have H265 support.

Refs #12992

(cherry picked from commit c0a2558689915b0fe9aa3b2bf7d41e21d395e10e)

comment:18 Changed 7 years ago by Peter Bennett

This should allow H265 to play. If there is interlaced content, the user can either live with it or use the playback profile to set h265 decoding to software. Most systems will have enough power to decode in software. Render could still be done in hardware in that case.

comment:19 Changed 7 years ago by Peter Bennett

Priority: majorminor
Severity: mediumlow

comment:20 Changed 7 years ago by Peter Bennett

Owner: Peter Bennett deleted
Status: assignednew

I am unassigning this ticket as I have no device capable of VDPAU H265, so I can do nothing further to fix it.

comment:21 Changed 7 years ago by Stuart Auchterlonie

Milestone: 29.10.28.2

Moving remaining open tickets to 0.28.2 milestone

comment:22 Changed 7 years ago by Stuart Auchterlonie

Milestone: 0.28.229.2

Moving remaining open tickets to 29.2 milestone

comment:23 Changed 5 years ago by Mark Kendall

Owner: set to Mark Kendall
Status: newaccepted

comment:24 Changed 5 years ago by Mark Kendall

Milestone: 29.231.0
Resolution: Fixed
Status: acceptedclosed

VDPAU has been mostly re-written in master.

Currently, interlaced HEVC material is a lottery - both with and without VDPAU.

FFmpeg generally returns a single field (as in a half height frame), more often than not the content is not flagged as interlaced, the current NVIDIA drivers will hang if you try to deinterlace any HEVC that is actually progressive (this is a regression - they did not do this previously) and a lot of the HEVC samples are actually HEVC MAIN 10 - which VDPAU cannot decode anyway.

But other than that, it's great:)

Some samples do actually deinterlace correctly - but they are always half height. None of these issues are in the MythTV code.

Note: See TracTickets for help on using tickets.