Login :       Password :       Remember me

Forum: Virtual DJ Plugins - Topic: Video Effect Examples?

Post here comments on the Virtual DJ Plugins (Audio effects, Video effects, Video transitions, Devices mapper, Tools, ...).
We remind that plugins are downloadable by registered PRO users only.
VirtualDJ forums
Virtual DJ Plugins
Video Effect...


Author - Topic: Video Effect Examples? -

SBDJ

VIP Member
Posted Mon 03 Sep 07 @ 6:26 am
Hi all,

I've been looking at writing some plugins for VDJ to implement a few things I would like. I've done a lot of dev work, but am not experienced with D3D at all!

I was wondering if anyone had any video effect source code using verticies they would be willing to share, so I can have a look through.

Basically - as a test I've written a standalone D3D app that implements a slideshow of pictures but scales them keeping the aspect ratio correct. I've taught myself a fair bit in doing this, it's actually a challenge I've enjoyed. The D3D interface has allowed me to explore options that allow you to easily scale and transform images quickly by implementing them as textures. The manager of one of my venues has asked if it's possible to do this when music videos aren't playing - obviously it is, but the current SlideShow plugin isn't really useable.

The standalone app works fine, and I've ported the code into a VDJ plugin. I'm only having one real problem at the moment - as soon as I present my scene it gets drawn over by a black box.

This has only happened when I render a scene using textures mapped, not when working with surfaces. I know it's something to do with my handling of the verticies, as after my plugin is activated it seems to have an impact on the verticies for other plugins. This is why I wondered if anyone had anything I could see, that dealt with verticies ;)

Thanks in advance,

Scott


halo_djk

VIP Member
Posted Tue 04 Sep 07 @ 2:45 pm
There are plugin source codes, on the site, under plugins, just in case you hadn't seen them.

SBDJ

VIP Member
Posted Tue 04 Sep 07 @ 5:35 pm
Unfortunately they are only available for Experienced users, and they also all seem to be audio effects :(

Probably going to have to not use music videos, and just run a seperate application on the TV output instead to do proper slideshow and video clips.

Hopefully I'll be able to get something sorted soon though - I've started writing an SMS plugin, it would be nice to have a better understanding of the video, and also if I can do anything in the configuration area of the effects panel to allow easier message handling. Would be much nicer than a seperate pop-up window :)

101010101

Professional edition user
Posted Wed 05 Sep 07 @ 10:34 pm
SBDJ wrote :
Unfortunately they are only available for Experienced users, and they also all seem to be audio effects :(


yeah same issue here, i'd like to write some plugin's as well and ran into status limitation.

i got VB6, C++ skills and alot of freetime ;-)

But it seems like the http://www.virtualdj.com/developers/ page is under construction, and it's looking like they dropping the level down :) YaY

SBDJ

VIP Member
Posted Wed 05 Sep 07 @ 11:26 pm
I'm making a bit of progress;

I can draw textures without them being overwritten. I've had to do the rendering myself though - my understanding was that OnDraw S_FALSE would make VDJ Render the modified texture. However this doesn't happen, so obviously I'm missing a step with what to do to enable VDJ to render it automatically. Setting it to S_OK and issuing the DrawPrimitiveUP myself successfully renders the scene.

101010101 have you managed to do any video coding yet? Feel free to give me a shout if you want to discuss anything or let me in on anything you've found ;) Video info seems to be rather hard to come by unfortunately :(

Still need to work out redrawing too - redrawing the texture on every OnDraw call will result in huge CPU utilisation - I only really need to redraw dirty areas. Further investigation required!!

Unfortunately I've never used D3D before, but I'm learning. Slowly ;)

Hence my initial request... :p

halo_djk

VIP Member
Posted Thu 06 Sep 07 @ 9:27 am
DJ Cel is awesome at this kind of thing, but hard pressed for time at the moment as far as I can tell. Here's hoping he'll chime in here soon.

SBDJ

VIP Member
Posted Thu 06 Sep 07 @ 4:15 pm
Hopefully, all tips are gratefully recieved ;)

Like I said in my last message, I've managed to work things out, so have textures rendering now which was my big issue...

SBDJ

VIP Member
Posted Sat 08 Sep 07 @ 6:48 pm
Thanks fella, I'd pretty much managed to get it sorted anyway. Good idea to stick the examples for easy reference though, thankyou :)

djcel

Senior Team
Posted Sat 08 Sep 07 @ 10:42 pm

101010101

Professional edition user
Posted Sun 09 Sep 07 @ 6:40 pm
SBDJ wrote :


101010101 have you managed to do any video coding yet? Feel free to give me a shout if you want to discuss anything or let me in on anything you've found ;) Video info seems to be rather hard to come by unfortunately :(

Still need to work out redrawing too - redrawing the texture on every OnDraw call will result in huge CPU utilisation - I only really need to redraw dirty areas. Further investigation required!!

Unfortunately I've never used D3D before, but I'm learning. Slowly ;)

Hence my initial request... :p

yeah i'm still stepping into the video aspect of coding, been editing audio VST plugins though on a limitation through an outside source and feel i'm missing a few key elements, but yeah i'm totally interested in video coding, you can find my msn in my blog, i'm on usually when im bored n got nothing better to do :)

djej

VIP Member
Posted Fri 05 Oct 07 @ 5:59 pm
My head hurts reading this.....ouch. Wow a lot goes into these great plug ins. Keep up the great work.

djcel

Senior Team
Posted Wed 16 Jan 08 @ 11:53 am
Here is an example of .cpp file for a Video effect on Windows


#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "VdjVideo.h"

//#include <d3d9.h>
//#pragma comment(lib,"d3d9.lib")

// you can also use instead (for D3DX...) :
// #include <d3dx9.h>
// #pragma comment(lib,"d3dx9.lib")

//------------------------------------------------------------------------
class CMyplugin : public IVdjPluginVideoFx
{
public:
HRESULT __stdcall OnLoad();
HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
HRESULT __stdcall OnParameter(int id);
ULONG __stdcall Release();
HRESULT __stdcall OnDXInit();
HRESULT __stdcall OnDXClose() ;
HRESULT __stdcall OnStart();
HRESULT __stdcall OnStop();
HRESULT __stdcall OnDraw(IDirect3DTexture9 *texture,TVertex *vertices);

private:
// Usefull for the example of controls
int SliderValue;
int mode;
char st[128];
};
//--------------------------------------------------------------------------------------------
HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject)
{
// This is the standard DLL loader for COM object.
// You don't need to change anything in this function.
if(memcmp(&rclsid,&CLSID_VdjPlugin,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
if(memcmp(&riid,&IID_IVdjPluginVideoFx,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
*ppObject=new CMyplugin();
return NO_ERROR;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnLoad()
{
// Examples of controls
DeclareParameter(&SliderValue,VDJPARAM_SLIDER,0,"Slider",1024);
DeclareParameter(&mode,VDJPARAM_SWITCH,1,"Switch button",0);
DeclareParameter(st,VDJPARAM_STRING,2,"Text",sizeof(st));

OnParameter(0);
return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnGetPluginInfo(TVdjPluginInfo *infos)
{
infos->Author="DJ CEL";
infos->PluginName="Myplugin";
infos->Description="here is your description";
// infos->Bitmap=LoadBitmap(hInstance,MAKEINTRESOURCE(100)); //if you want to add a picture
infos->Flag=0;
return S_OK;
}
//---------------------------------------------------------------------------------------------
ULONG __stdcall CMyplugin::Release()
{
delete this;
return 0;
}
//--------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnParameter(int id)
{

return S_OK;
}
//--------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnDXInit()
{

return S_OK;
}
//--------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnDXClose()
{

return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnStart()
{
return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnStop()
{
return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnDraw(IDirect3DTexture9 *texture,TVertex *vertices)
{
// Clear the video screen
// D3DDevice->Clear(0L, NULL, D3DCLEAR_TARGET, D3DCOLOR_RGBA(0,0,0,255), 1.0f, 0L);

// Write your code here

return S_FALSE;
}

djcel

Senior Team
Posted Wed 16 Jan 08 @ 12:11 pm
Here is an example of .cpp file for a video transition on Windows


#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "VdjVideo.h"

// #include <d3d9.h>
//#pragma comment(lib,"d3d9.lib")

// you can also use instead (for D3DX...) :
// #include <d3dx9.h>
// #pragma comment(lib,"d3dx9.lib")

//------------------------------------------------------------------------
class CMyplugin : public IVdjPluginVideoTransition
{
public:
HRESULT __stdcall OnLoad();
HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
HRESULT __stdcall OnParameter(int id);
ULONG __stdcall Release();
HRESULT __stdcall OnDXInit();
HRESULT __stdcall OnDXClose() ;
HRESULT __stdcall OnStart(int chan);
HRESULT __stdcall OnStop();
HRESULT __stdcall Compose(int crossfader,HRESULT(__stdcall *RenderSurface[2])(),TVertex *vertices[2]);
HRESULT __stdcall OnCrossfaderTimer(int *crossfader);

private:
// Usefull for the example of controls
int SliderValue;
int mode;
char st[128];
};
//--------------------------------------------------------------------------------------------
HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject)
{
// This is the standard DLL loader for COM object.
// You don't need to change anything in this function.
if(memcmp(&rclsid,&CLSID_VdjPlugin,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
if(memcmp(&riid,&IID_IVdjPluginVideoTransition,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
*ppObject=new CMyplugin();
return NO_ERROR;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnLoad()
{
// Examples of controls
DeclareParameter(&SliderValue,VDJPARAM_SLIDER,0,"Slider",1024);
DeclareParameter(&mode,VDJPARAM_SWITCH,1,"Switch button",0);
DeclareParameter(st,VDJPARAM_STRING,2,"Text",sizeof(st));

OnParameter(0);
return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnGetPluginInfo(TVdjPluginInfo *infos)
{
infos->Author="DJ CEL";
infos->PluginName="Myplugin";
infos->Description="here is your description";
// infos->Bitmap=LoadBitmap(hInstance,MAKEINTRESOURCE(100)); //if you want to add a picture
infos->Flag=0;
return S_OK;
}
//---------------------------------------------------------------------------------------------
ULONG __stdcall CMyplugin::Release()
{
delete this;
return 0;
}
//--------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnParameter(int id)
{

return S_OK;
}
//--------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnDXInit()
{

return S_OK;
}
//--------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnDXClose()
{

return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnStart(int chan)
{
return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnStop()
{
return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::Compose(int crossfader,HRESULT(__stdcall *RenderSurface[2])(),TVertex *vertices[2])
{
// Clear the video screen
// D3DDevice->Clear(0L, NULL, D3DCLEAR_TARGET, D3DCOLOR_RGBA(0,0,0,255), 1.0f, 0L);

// Write your code here
// RenderSurface[0]();
// RenderSurface[1]();

return S_OK;
}
//---------------------------------------------------------------------------------------------
HRESULT __stdcall CMyplugin::OnCrossfaderTimer(int *crossfader)
{
return GetInfo("AutoVideoCrossfader",crossfader);
}



Site map
(C)opyright Atomix Productions 2008

Software
Hardware
VirtualDJ Pro
VirtualVinyl
Numark CUE
AtomixMP3
VDJ HomeEdition
DJC Edition
eJay DJMixStation
DJ-Box
Features
Screenshots
Trial Version
Plugins
Software Updates
Press Material
Developer SDK
Timecode CD
Skins
Sound Effects
Video Effects
Samples
Languages
Grafx
Tools & Drivers
Forums
Users Network
Wiki
Radio
Atomix Productions
VIP DJs
Disclaimer
Ask a question
View your tickets
Wiki