Skip to main content
igorr60572095
Inspiring
January 17, 2018
Answered

Can I get inFrames[1] on Effect Plugin like on Transition Plugin?

  • January 17, 2018
  • 3 replies
  • 1851 views

Hi, everyone!

I hope you are going well.

I am going to make plugin with gpu accelerated. so I have checked some SDK sample plguins.

          ....

prSuiteError Render(

const PrGPUFilterRenderParams* inRenderParams,

const PPixHand* inFrames,

csSDK_size_t inFrameCount,

PPixHand* outFrame)

{

     if (inFrameCount < 2 || (!inFrames[0] && !inFrames[1]))

     {

          return suiteError_Fail;

     }

     ....

I am sure inFrame[0] and outFrame indicate same address.

I'd like to make outFrame that is related to several pixcel of inFrame.

for example: outImg.x( or r) = (inImg[x - 5].x + inImg.x) / 2;

                    outImg.y( or g) = (inImg[x - 4].y + inImg[x - 1].y) / 2;

                    outImg.z( or b) = (inImg[x - 10].z + inImg[x - 3].z) / 2; // it is not correct code.

But If I change some pixcel data on before render, it is used changed pixcel data in the next render because inFrames[0] and outFrame indicate same address.(here I used inFrames[0] for inFrame)

So, I used inFrames[1] for inFrame data.

inFrames[1] and outFrame indicated different address together and I got correct result.

But it is only when the plugin is transition plugin. I cannot get inFrames[1] if plugin is Effect plugin.

Debugging result:

----------- effect plugin -----------

     inFrameCount => 1,
     inFrames[0] => exist.     inFrames[1] => no exist.

----------- transition plugin -------

     inFrameCount => 2,

     inFrames[0] => exist.

     inFrames[1] => exist.

How can I get two frames ( inFrames[0], inFrames[1]) on Effect Plugin like on Transition Plugin?

Regards,

Igor.

This topic has been closed for replies.
Correct answer Zac Lam

Hi, Zac.

I set GetFrameDependencies following as:

Please check outSequenceTime here.

prSuiteError GetFrameDependencies(

const PrGPUFilterRenderParams* inRenderParams,

csSDK_int32* ioQueryIndex,

PrGPUFilterFrameDependency* outFrameRequirements)

{

  outFrameRequirements->outDependencyType = PrGPUDependency_InputFrame;

  outFrameRequirements->outSequenceTime = inRenderParams->inSequenceTime * 2;

  return suiteError_NoError;

}

now it is working correctly, but I don't know what outSequencetime means.

Anyway I expanded it twice.

outFrameRequirements->outSequenceTime = inRenderParams->inSequenceTime * 2;

Would you explain about that?

Regards,

Igor.


Some effects depend on frames from earlier or later in the clip.  Using outSequenceTime, you can specify if the effect needs such frames.  For example, let's say inSequenceTime (the current frame) is n.  A video echo effect may use frames n-1, n-2, n-3.  You can specify the n-1 frame dependency by setting outSequenceTime to be PrGPUFilterRenderParams->inSequenceTime - PrGPUFilterRenderParams->inRenderTicksPerFrame.

Other effects use layer parameters, where an input is the frame at the same time, but from a different layer.  In that case, outSequenceTime should be inSequenceTime.  You specify a different layer by setting outTrackID to the track specified by the layer parameter.

3 replies

igorr60572095
Inspiring
January 22, 2018

Hi, Zac.

Thanks for your replay.

I am testing it in Premiere Pro.

Regards,

Igor.

Inspiring
January 22, 2018

Effects/transitions should let the host know of the frames it needs in response to iterative calls to GetFrameDependencies().  Each time that function is called, the plug-in should describe one of the frames it needs in the PrGPUFilterFrameDependency struct.  To receive another call to describe another frame dependency, the plug-in needs to increment the query index param before returning from GetFrameDependencies().

igorr60572095
Inspiring
January 23, 2018

Hi, Zac.

Thanks for your replay.

I tried to understand what you mean, but it is not clear because of my bad knowledge. ( )

virtual prSuiteError GetFrameDependencies(

     const PrGPUFilterRenderParams* inRenderParams,

     csSDK_int32* ioQueryIndex,

     PrGPUFilterFrameDependency* outFrameRequirements)

     {

          return suiteError_NotImplemented;

     }

What should I increase here?

Regards,

Igor.

Inspiring
January 22, 2018

Hi Igor, are you testing this in Premiere Pro, or After Effects?

igorr60572095
Inspiring
January 20, 2018

Hi, everyone!

Can I get any news?

Regards,

Igor.