Mailing List Archive

Fwd: MythTV Kernel HW GL Deinterlacer
-------- Forwarded Message --------
Subject: MythTV Kernel HW GL Deinterlacer
Date: Thu, 29 Nov 2018 16:36:38 -0600
From: David Engel <david@istwok.net>
To: Peter Bennett <pb.mythtv@gmail.com>, Mark Spieth
<mark@digivation.com.au>



FYI, I tried but failed to figure out the OpenGL, kernel deinterlacer
issue. I decided to reach out to Mark Kendall. He originally wrote
the code in question but left the project several years ago under very
acrimonious circumstances. He replied and also offered some
additoinal comments about the current state of openglvideo.cpp. Here
is that email discussion so far. Feel free to jump in.

David

--
David Engel
david@istwok.net

David

Thank you for copying us on that. I have done very little OpenGL, and I
also tried to understand the MythTV OpenGL code, but largely failed.
There are multiple layers to it. The way the OpenGL code gets modified
by the C++ code makes it more difficult for me to figure it out.

My current dilemma is that the OpenGL is too slow for some devices. On
the fire stick (non-4K), it decodes fast enough, but in rendering at
1080 30fps it drops 50% of frames or more. Perhaps if all of the
optional OpenGL processing was removed and it just had to display the
textures it would work at full speed. I believe there is a lot of OpenGL
code for things like format change, color adjustment that may be slowing
it down.

I also need to figure out how to move the image directly from the
decoder to the display without going through memory for mediacodec,
vaapi2 and cuda. This may be key to displaying 4K video at 50 fps.

4K video has the option of 10bit which enhances the number of colors and
is not supported by MythTV OpenGL. The 10bit images are currently
translated down to YUV before being displayed. This needs to be fixed.
Hopefully if the images moved directly from decoder to texture this
would be handled.

Peter
Re: MythTV Kernel HW GL Deinterlacer [ In reply to ]
> Wiadomo?? napisana przez Peter Bennett <pb.mythtv@gmail.com> w dniu 30.11.2018, o godz. 20:35:
>
> I also need to figure out how to move the image directly from the decoder to the display without going through memory for mediacodec, vaapi2 and cuda. This may be key to displaying 4K video at 50 fps.

I personally believe DRM_PRIME is best option.
IMHO here we have 2 options:
a) producer (video decoder) and consumer (DRM plane) are in the same memory - so they can work on the same buffer (zero-copy)
b) producer (video decoder) and consumer (DRM plane) are in different memory (VRAM & RAM) - then DMA_BUF allows zero-cpu-load mem copy operations.

There are already patches for ffmpeg to use DRM_PRIME for transferring data from ffmpeg v4l2 m2m decoder to DRM plane:
https://github.com/ldts/FFmpeg/commits/v4l2-drm
Maybe this might be ported also to mediacodec decoder….

I have extracted all required patches for ffmpeg 4.02 to go with DRM_PRIME:
https://github.com/warpme/minimyth2/tree/master/script/lib/ffmpeg/files

I personally think in long term we should follow kodi18 route (and reuse ideas/code Lukas developing for exploiting v4l2 m2m, DRM_PRIME, etc).

pls look on v.generic overview: https://archive.fosdem.org/2018/schedule/event/kodi/








_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org