diff --git a/02-Note/DAWA/ASoul/流程笔记/VJ播放.md b/02-Note/DAWA/ASoul/流程笔记/VJ播放.md index 56f5339..c431d34 100644 --- a/02-Note/DAWA/ASoul/流程笔记/VJ播放.md +++ b/02-Note/DAWA/ASoul/流程笔记/VJ播放.md @@ -146,4 +146,44 @@ UNDIMediaReceiver::CaptureConnectedVideo => DisplayFrame NDIlib_frame_format_type_progressive NDIlib_FourCC_video_type_UYVY => -DrawProgressiveVideoFrame \ No newline at end of file +DrawProgressiveVideoFrame + +## 解决方案 +[NDI plugin质量问题](https://forums.unrealengine.com/t/ndi-plugin-quality-trouble/1970097) + +I changed only shader “NDIIO/Shaders/Private/NDIIOShaders.usf”. +For example function **void NDIIOUYVYtoBGRAPS (// Shader from 8 bits UYVY to 8 bits RGBA (alpha set to 1)):** + +_WAS:_ + +```c++ +float4 UYVYB = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerB, InUV); +float4 UYVYT = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerT, InUV); +float PosX = 2.0f * InUV.x * NDIIOShaderUB.InputWidth; +float4 YUVA; +float FracX = PosX % 2.0f; +YUVA.x = (1 - FracX) * UYVYT.y + FracX * UYVYT.w; +YUVA.yz = UYVYB.zx; +YUVA.w = 1; +``` + +_I DID:_ + +```c++ +float4 UYVYB = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerB, InUV); +float4 UYVYT0 = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerT, InUV + float2(-0.25f / NDIIOShaderUB.InputWidth, 0)); +float4 UYVYT1 = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerT, InUV + float2(0.25f / NDIIOShaderUB.InputWidth, 0)); +float PosX = 2.0f * InUV.x * NDIIOShaderUB.InputWidth; +float4 YUVA; +float FracX = (PosX % 2.0f) * 0.5f; +YUVA.x = (1 - FracX) * UYVYT1.y + FracX * UYVYT0.w; +YUVA.yz = UYVYB.zx; +YUVA.w = 1; +``` + +Small changes but result is seems much more better. +Of course, I added a bit of sharpness to the material after I changed the shader, but even without that, the result looks better than in the original version. +## UYVY(YUV422) +- https://zhuanlan.zhihu.com/p/695302926 +- https://blog.csdn.net/gsp1004/article/details/103037312 +![](https://i-blog.csdnimg.cn/blog_migrate/24b41fd36ff7902670e11a8005afb370.jpeg) \ No newline at end of file