Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Spout for Virtual DJ - Page: 4

This part of topic is old and might contain outdated or incorrect information

Can we have native Spout and NDI support please?
 

Posted Mon 04 Jan 21 @ 4:35 pm
Hello all.
on Adion's advice I have included the VDJFLAG_VIDEO_OUTPUTRESOLUTION flag in the receiver visualisation plugin and created a new v2004 release for the GitHub repository. Hopefully this will solve the resolution issues.
 

Posted Tue 05 Jan 21 @ 12:07 am
OK thanks I will give it a try.

[later] yes that seems to have solved the problem. Now if only Resolume would stop crashing every time I use Spout output.

[edit] Oh wait a moment. The problem seems to be linked to the camera input somehow. If I enable the camera, the Spout image shrinks.
 

Posted Tue 05 Jan 21 @ 11:50 am
OK maybe you can narrow it down. For Resolume, make sure that the "DX9" option is OFF in SpoutSettings. I have noticed some sort of memory leak.
 

Posted Tue 05 Jan 21 @ 12:39 pm
DX9 off seems to have solved the Resolume crashing, but still have major issues with the Spout image size in VDJ.

It seems totally random whether I get a full size image, a small one or nothing at all.


[later] The VDJ video output window seems to be an issue. If I enable the Spout input with just the preview window active on the skin, I get a full screen Spout feed.

Enable the video output window and the Spout feed in both the preview and output windows shrinks.

Changing the size/shape of the output window really messes with the image in both windows.
 

Posted Tue 05 Jan 21 @ 1:23 pm
NicotuxHome userMember since 2014
DX11 is the only one avaiable with 2004..
i tried VDJFLAG_VIDEO_OUTPUTRESOLUTION and other VDJFLAG_VIDEO_OUTPUTASPECTRATIO for a long time
They never changed anything but a better resolution when preview size is small

this is clearly a VDJ SDK issue, maybe a misuse,
this is not specific to Spout plugin only "Cover" is not affected

sure it's something like draw() is done too early or does not apply where it should
because it apply to something VDJ is reworking by itself

The plugin is using the correct sizes VDJ is giving, the result differ depending on many internal factors
deck or decks loaded, original size of videos and video crossfader and size of preview window
none should matter, specially with global master overlays already at final size

interesting about size of preview : test with MULTI TOUCH V2 skin, it have 3 types of previews
or VB_8decks, with preview in a resizeable window...
used as master depending on preview size and tracks loaded you can see the received shader fullscreen big medium or small or almost invisible
as a deck plugin depending on track and loaded in masterfx slot too (no need to activate) it can be small tiny almost invisible or fullscreen (possibly with format error)... BSOD
 

Posted Tue 05 Jan 21 @ 1:42 pm
AdionPRO InfinityCTOMember since 2006
I think I see where the mistake is with the spout plugin. (although I don't see the spout64 receiver source on github)
It tries to update the plugin input texture, and then have VirtualDJ render it to the output.
The input texture size will depend on the previous plugin, or the video loaded to the deck though, so this is indeed not guaranteed to be in any resolution.
It also seems to ignore the width/height of the plugin, and use the input image texture instead.

What VDJFLAG_VIDEO_OUTPUTRESOLUTION does is make sure the output of the plugin is the same resolution as the video window/screen/recording.
In order to properly use this, the plugin should create its own texture from its source (and if it has control over the spout sender prefer that the sender sends in the resolution as set by the plugin width/height properties), and then draw that texture itself to the output and return S_OK, instead of having VirtualDJ draw the original input texture.
 

Posted Tue 05 Jan 21 @ 2:45 pm
I've just had complete system lock-up on my PC when feeding Resolume into VDJ and then broadcasting to Twitch.

Everything still on screen (PC desktop) but had no mouse or keyboard control. Windows wasn't responding to anything, so had to power off the PC.

I won't be doing that again without further testing!
 

Posted Tue 05 Jan 21 @ 3:10 pm
NicotuxHome userMember since 2014
@Adion the spout64 receiver source on github is in the Beta Branch only (and it is small)
However you are totally right on what it is doing

"then draw that texture itself to the output" is something hard to figure out, VDJ overwriting everything everytime
 

Posted Tue 05 Jan 21 @ 3:43 pm
AdionPRO InfinityCTOMember since 2006
It is indeed a little bit involved from scratch in DX11 since you can't really access the shaders VDJ already has available.
So basically
-Set shader, blendstate, texture to use and sampler
devContext->PSSetShader
devContext->OMSetBlendState
devContext->PSSetShaderResources
devContext->PSSetSamplers

-Create and update vertex buffer (can be cached between frames if the same)
d3dDev->CreateBuffer
devContext->Map
devContext->Unmap

-Select vertex buffer
devContext->IASetVertexBuffers

-draw
devContext->IASetPrimitiveTopology
devContext->Draw

If DX11 is new, although the MSDN docs are quite helpful, you can probably have a look at some tutorials such as
http://www.rastertek.com/dx11tut05.html
as well
 

Posted Tue 05 Jan 21 @ 4:10 pm
Thanks Adion,

For the old DirectX 9 plugin we could stretch the received texture to the VirtualDJ one, then we needed to know the size the texture. But that's not possible here so I have done the best I can. There is potential for high speed transfer to other programs and I would like to solve it for people to use. But, like Nicotux, I have not been able to work out what to do with it.

Unfortunately this is where I have to leave the project because it has become too complicated.

All the source is open if anybody wants to have a go at it. Go to here (https://github.com/leadedge/SpoutVDJ) for the master branch that has the sender, where you see "Master", drop that down and switch to the beta branch for the receiver. The receiving part is reliable, so it's only the drawing part that needs attention.

The sender is solid from all reports.
 

Posted Tue 05 Jan 21 @ 11:48 pm
SBDJPRO Infinity Member since 2006
I can have a look at it if you want mate, I recall someone asking me to before. As Adion says, you'll need to render the texture yourself. It looks more complicated than it is :)
 

Posted Wed 06 Jan 21 @ 1:17 am
NicotuxHome userMember since 2014
Thanks SBDJ :}
with infos and all knowledge about VDJ video I think you are the one being able to achieve this correctly with ease
maybe more complicated than it is but with no info it looks hard to figure out what to do !
 

Posted Wed 06 Jan 21 @ 2:02 am
SBDJPRO Infinity Member since 2006
Fixed :)

 

Posted Wed 06 Jan 21 @ 2:45 am
SBDJPRO Infinity Member since 2006
I'll put a pull request back into the repo and you can look at my changes. I made some other changes too - I thought it was better to cache instead of constantly create - it also looked to me like it was leaking too.

Feel free to take what you want from my changes. The only thing I won't push back is the project file because it had to be upgraded to work with my VS. Only project changes are:

* Removal of unused D3DX11 library as a linker dependancy
* Added PixelShader.hlsl (Pixel Shader, Model 4, Level 9_3, Header Variable Name PixelShaderCode, Header File Name PixelShader.h, Object File Name <Blank>)
 

Posted Wed 06 Jan 21 @ 3:07 am
SBDJPRO Infinity Member since 2006
Pull request submitted, feel free to hack it apart and make it your own :)
 

Posted Wed 06 Jan 21 @ 3:14 am
Hey Scott.

many thanks from everybody I am sure. It was too much for me and your experience shows through. I certainly won't make it mine because it's always been for everyone using VirtualDJ, but I will add to the receiving part as that is improved.

I will create a new release as soon as I can so that people can use it.

Edit : it looks like we need "PixelShader.h" or have I missed something.
Edit again: I think I have figured it out.
Edit again again : Release uploaded(https://github.com/leadedge/SpoutVDJ/releases/tag/v2005 )

I hope I got it right. It works OK from what I can tell. Any problems we just keep going till it does.





 

Posted Wed 06 Jan 21 @ 6:48 am
Excellent! Thanks everyone.
 

Posted Wed 06 Jan 21 @ 8:13 am
Newsflash!

I think I know why running Resolume -> Spout -> VDJ caused my whole system to freeze up yesterday.

When using the Spout receiver, you can see in Task Manager the amount of memory VDJ is using gradually creeps up and up, even just sitting there not being used.

Earlier I had Resolume feeding VDJ the Spout signal and left it running in the background. Next thing I know, VDJ has shut down and restarted. Presumably it ran out of resources and keeled over.

It's now slowly climbing again. Something is amiss.

 

Posted Wed 06 Jan 21 @ 10:07 am
Good detective work.

Yes I can see it with Task Manager. It's CPU memory. What I will do is remove things until it stops, then try to narrow it down. I will also test GPU memory.

I don't think we are entirely out of the woods anyway. If I double click on the display to go full screen, then return to windowed, it is blank until I stop the plugin and start it again.

 

Posted Wed 06 Jan 21 @ 12:21 pm
44%