Determining if rendering during live playback or into cache/output file

18 views
Skip to first unread message

Mike Woodworth

unread,
May 22, 2020, 7:49:43 PM5/22/20
to ofx-discussion
Is there a way to determine if the frame I'm asked to render will be for display or used for caching and/or rendered output?

My plugin needs to know if it is rendering the clip into the viewer (in which case we want to do something), while simply passing through the frame unaltered if being rendered for anything not "user interactive".

Most interested in solving this for Resolve at the moment.

Thanks,
mike

PierreJasmin_REVisionEffects

unread,
May 24, 2020, 3:05:05 PM5/24/20
to ofx-discussion

There is no such distinction. PropBackground is meant for distinguishing render-only licensing versus interactive sort of things.
You might be able to hack something via the Interact Suite - however in Resolve I think you have to explicitely ask via a menu to activate that so it's called - in combination with perhaps begin and|or end render action. As in you write in instance dataor an hidden parameter when you  pass through interact callback and you check in begin render if it has been set.

Pierre

PierreJasmin_REVisionEffects

unread,
May 24, 2020, 3:28:39 PM5/24/20
to ofx-discussion
Wait I lied never noticed that one:

Maybe I am doing it wrong here using -  kOfxImageEffectHostPropIsBackground for licensing purposes (should we use PropIsInteractive Instead?)

See below, what does Resolve return during a render versus an interactively generated frame?

//


kOfxPropIsInteractive

Indicates if a host is actively editing the effect with some GUI.

  • Type - int X 1

  • Property Set - effect instance (read only)

  • Valid Values - 0 or 1

If false the effect currently has no interface, however this may be because the effect is loaded in a background render host, or it may be loaded on an interactive host that has not yet opened an editor for the effect.

The output of an effect should only ever depend on the state of its parameters, not on the interactive flag. The interactive flag is more a courtesy flag to let a plugin know that it has an interace. If a plugin want’s to have its behaviour dependant on the interactive flag, it can always make a secret parameter which shadows the state if the flag.


kOfxImageEffectHostPropIsBackground

Indicates if a host is a background render.

  • Type - int X 1

  • Property Set - host descriptor (read only)

  • Valid Values - This must be one of

    • 0 if the host is a foreground host, it may open the effect in an interactive session (or not)

    • 1 if the host is a background ‘processing only’ host, and the effect will never be opened in an interactive session.


PierreJasmin_REVisionEffects

unread,
Jun 1, 2020, 5:28:59 PM6/1/20
to ofx-discussion
 I came up with a new word for you -  Interactive-Only 😊
 

Your case is a good example. Here’s table of 4 types of plug-in context with regards to licensing.
Rereading doc, doing it correctly license wise, note we do special case special case right column here...


Interactive-only – e.g. Divergent Media, monitoring only

Interactive front end with back-end server (e.g. BaselightX)

Interactive + render-only (command-line) – e.g. Nuke -I or Fusion GUI (dongle) with render nodes.

Render-only, example tuttleOFX no GUI software – command line only

Mike Woodworth

unread,
Jun 1, 2020, 5:39:21 PM6/1/20
to ofx-discussion
I'm confused by your table, we aren't an OFX host, but rather a plugin for other hosts. The goal is to pass frames from the users session into our app over interprocess communication to mirror the users video monitor. The issue we run into currently is that we'll see frames processed both under the playhead while playing, and any frame being rendered to cache in a background thread at the same time.

- mike

PierreJasmin_REVisionEffects

unread,
Jun 1, 2020, 6:07:38 PM6/1/20
to ofx-discussion

You shouldn't be in the table, that would perhaps be a device connected via HDMI/SDI or something running a plugin, the kOfxInteractive is the flag you would use assuming an host support that as you expect.
Right now there is no Interactive-Only hosts

In host that do memory caching this might not work as advertised as you say. You could though request a frame in Instance Changed perhaps in combo with Interact Callback to know you are in focus -- mileage vary on this -  and anyhow pass that frame collected on UI thread to your process, and do a no op in render call (copy input in output) - you would be checking the PropType. PropReason in Instance Changed action for reason you are being called back so you don't over tax the system when nothing changed, you can like that trap time has changed...

Pierre

Adams, Dennis

unread,
Jun 1, 2020, 7:07:03 PM6/1/20
to ofx-dis...@googlegroups.com

Maybe two concepts are being merged here.

 

One concept was knowing “render only / non-interactive” for licensing purposes (i.e., you pay different rate for interactive instances versus render farm instances). This is mostly handled already with kOfxPropIsInteractive, but maybe not all hosts use it.

 

The other concept is that for a given kOfxImageEffectActionRender, it would be nice to know if it was for:

  1. Interactive frame the user is currently viewing, that will be replaced by another very soon (needs to be fastest possible rendering, using lower quality if necessary). This happens, for example, when a slider is changing value, or the timeline position is scrubbing.
  2. Interactive frame the user is currently viewing, last one for now (this could be better quality than #1).
  3. Interactive frame that will be cached (should be best “preview” quality as it might stick around for a while and be used instead of calling plug-in again). Might not be at current position for hosts that build up a frame cache in the background.
  4. Render frame (best quality)

 

For 1—3 an additional flag could indicate if playback is paused, scrubbing, or in playback.

 

That’s my take on it. What about other folks?

 

///d@

--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ofx-discussion/0ed36b3f-56b3-4a81-84b9-e2a7d4b6730b%40googlegroups.com.

Mike Woodworth

unread,
Jun 1, 2020, 7:53:08 PM6/1/20
to ofx-discussion
This actually highlights a possible problem for us. Do any hosts cache for playback such that we won't even be called when the moment of playback occurs? I have yet to see that occur in the hosts we test with, but thinking about it now it seems an obvious optimization.

-mike

To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.

PierreJasmin_REVisionEffects

unread,
Jun 1, 2020, 8:09:56 PM6/1/20
to ofx-discussion
There is a draft flag already

There is also
kOfxImageEffectPropInteractiveRenderStatus

All that maybe is not covered is while moving a slider the sequence of renders are not sandwiched between begin and end render so you don't get natural cue if you want to keep a temporary / intermediate buffer while tweaking values.

Pierre

On Monday, June 1, 2020 at 4:07:03 PM UTC-7, Dennis Adams wrote:

To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussion+unsubscribe@googlegroups.com.

PierreJasmin_REVisionEffects

unread,
Jun 1, 2020, 8:16:42 PM6/1/20
to ofx-discussion

Yes possible in many hosts, since you initially mentioned Resolve, what do you think happens (if it's repaired now) when you select Render Cache OFX Filter.(pix below). Some hosts have automatic persistent cache, you are not called unless a parameter or something you are slaved to changes.  For your case you can only rely on InstanceChanged action to collect frames I think,

PierreJasmin_REVisionEffects

unread,
Jun 1, 2020, 9:45:56 PM6/1/20
to ofx-discussion

Dennis

You are right that I confused PropIsInteractive and EffectPropInteractiveRenderStatus, not something I ever used.
Another idea is to create a Preview button and use that to set
kOfxParamPropCacheInvalidation if supported or via an hidden param you change each time you pass through Instance Changed to do the invalidation -  this way one could maybe rely on EffectPropInteractiveRenderStatus to send frames out or not.

Pierre

On Monday, June 1, 2020 at 4:07:03 PM UTC-7, Dennis Adams wrote:

To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussion+unsubscribe@googlegroups.com.

Paul Miller

unread,
Jun 11, 2020, 9:26:31 AM6/11/20
to ofx-dis...@googlegroups.com

Sorry Mike - finally catching up here with some email.

Silhouette does this - if the frame is in the cache no render functions are called.

But here is a thought - could you not create a custom Interact and fetch the frame from there?

To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ofx-discussion/aa7aedd6-3022-4628-aeba-8fe928ee75ed%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages