<div dir="auto"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2019, 8:48 PM Peter Bennett <<a href="mailto:pb.mythtv@gmail.com">pb.mythtv@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mark<br>
<br>
Here are a few observations.<br>
<br>
**VAAPI acceleration<br>
OpenGL-HW - no deinterlacer is offered<br>
Resolution change is ok - it would fail on old VAAPI<br>
1080i - ticker jerky due to single frame deinterlace<br>
So it is inferior to the old vaapi in the deinterlace area, superior in <br>
the changed resolution area.<br>
<br>
**VAAPI decode only<br>
the va deinterlacers are not being used - if you select one of them the <br>
output is still interlaced<br>
video output is corrupt after a change of resolution<br>
1080i - ticker jerky due to interlace<br>
So it is inferior to the old vaapi2 in the deinterlace area and in the <br>
changed resolution area.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Hi Peter,</div><div dir="auto"><br></div><div dir="auto">Thanks for testing.</div><div dir="auto"><br></div><div dir="auto">With respect to deinterlacing, for the most part the deinterlacers are not currently hooked up. I decided to wait until all of the different hardware decoders were converted to opengl direct rendering before implementing the deinterlacer settings changes I mentioned before. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
OpenGL Slim (s/w decode)<br>
video output is corrupt after a change of resolution<br>
<br>
Screen shot of corrupted video after resolution change<br>
see <a href="https://imgur.com/LbACR9c" rel="noreferrer noreferrer" target="_blank">https://imgur.com/LbACR9c</a></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That looks strangely familiar:) I'm aware of this issue (with the same clip!) - just trying to decide how to best fix it.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I have not yet taken much of a look at the code in the render branch <br>
yet. I thing that tracing through it during playback would help <br>
understanding.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You'll find the code has changed considerably. The VideoOutput classes have been gutted, OpenGLVideo is now much more straight forward, most of the video texture handling has been passed off to MythVideoTexture and MythOpenGLInterop (and subclasses) handles the hardware frames. And MythRenderOpenGL has been largely rewritten.</div><div dir="auto"><br></div><div dir="auto">Apart from the deinterlacer changes, it is 90% there. I have uncommitted changes for vdpau (direct rendering and decode only), nvdec direct rendering and openmax EGL direct rendering. VAAPI seems to be fine other than deinterlacing, videotoolbox is done and mediacodec is almost there. That only leaves windows - which may have to wait.</div><div dir="auto"><br></div><div dir="auto">The render branch also has changes to allow direct display of a range of other YUV formats - including 10/12/16 bit YUV420P and NV12. (I.e. 10bit video is passed through without loss/conversion)</div><div dir="auto"><br></div><div dir="auto">This is all via VideoOutOpenGL/OpenGLVideo.</div><div dir="auto"><br></div><div dir="auto">Including uncommitted code, the current outstanding issues/bugs are:</div><div dir="auto"><br></div><div dir="auto">- the input change bug above</div><div dir="auto">- MediaCodec seek delay</div><div dir="auto">- MediaCodec input/resolution changes</div><div dir="auto">- MediaCodec frame timing with DVD playback (probably applies to NVDEC as well)</div><div dir="auto">- VDPAU crash when seeking beyond the end of a video</div><div dir="auto">- proper rendering of 10bit NV12 NVDEC/CUDA frames</div><div dir="auto">- GUI freeze after rendering with NVDEC/CUDA</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I did invent my own deinterlace shader and test it with a simple program <br>
- I am sure it is inferior but I am trying out various things as a <br>
learning exercise.<br>
<br>
I suppose the main complex things that need to be done in shaders is <br>
deinterlace and conversion from various YUV encodings to RGB for <br>
display. I plan to look at the code and try to understand how those work.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The biggest issue is getting the data into textures in the most efficient way. The colour space conversion is a 'simple' matrix multiplication (simple for glsl) while the detail behind the actual matrix is in VideoColourSpace. There is more work to be done with HDR displays and gamma adjustment - but that is currently beyond my understanding.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At some point I hope to try integrating direct NVDEC display.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">As mentioned this is almost done.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Let me know if I should look into the issues reported above, and if I <br>
should make updates to the render branch. I don't want to step on what <br>
you are doing.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Feel free to get stuck in:)</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It seems that debugging a shader is not easy - you can't do printf in <br>
the code or trace through it with gdb to see where something is going wrong.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yup - I work on the basis that getting something on screen is a positive. If you have nothing to see, you have no idea where to start:)</div><div dir="auto"><br></div><div dir="auto">Thanks and regards,</div><div dir="auto">Mark</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div>