Skip to main content
Participant
December 6, 2023
Answered

How to get the decoded data stream of the video source In AE plugin

  • December 6, 2023
  • 2 replies
  • 272 views

I'm developing an AE plugin that supports face detection.

I want to get each raw video frame in the order in which it is decoded. It can helps me design the cache and improve the detection efficiency.

But I don't find any suite handle works on it. The only ways to checkout frame is in "PF_Cmd_SMART_RENDER", but it is called no in decoded order.

Thanks for reading hope you can help me out. Any starting point to achieve this goal will be appreciate.

This topic has been closed for replies.
Correct answer shachar carmi

technically, you can request any project item's image at any time and in any order you wish. take a look at AEGP_RenderAndCheckoutFrame sepcifically, and AEGP_RenderSuite4 in general.

 

that being said, i'll rephrase on what Mylenium said. AE's work scheme revolves around rendering frames randomly, and only on demand. rendering something sequentially and in advance plays against the whole of AE's "user experience". HOWEVER, some effect require that, and taking the the user's experience into account, some solutions were found that recocile that. for example, AE's camera tracker does it's sequential processing in the background while letting the user know of the progress without blocking the ui and allowing the user to continue working in the mean time. "lockdown" does something similar, and a few other plugins do their own thing to achive some "sequential pre-processing".

 

so you should decide what's best for your users:

1. fast sequential pre-processing at the cost of usage intuitiveness.

2. slower, "random access" kind of processing, while gaining simplicty without waiting for the whiole pre-process to finish.

2 replies

shachar carmiCommunity ExpertCorrect answer
Community Expert
December 6, 2023

technically, you can request any project item's image at any time and in any order you wish. take a look at AEGP_RenderAndCheckoutFrame sepcifically, and AEGP_RenderSuite4 in general.

 

that being said, i'll rephrase on what Mylenium said. AE's work scheme revolves around rendering frames randomly, and only on demand. rendering something sequentially and in advance plays against the whole of AE's "user experience". HOWEVER, some effect require that, and taking the the user's experience into account, some solutions were found that recocile that. for example, AE's camera tracker does it's sequential processing in the background while letting the user know of the progress without blocking the ui and allowing the user to continue working in the mean time. "lockdown" does something similar, and a few other plugins do their own thing to achive some "sequential pre-processing".

 

so you should decide what's best for your users:

1. fast sequential pre-processing at the cost of usage intuitiveness.

2. slower, "random access" kind of processing, while gaining simplicty without waiting for the whiole pre-process to finish.

Mylenium
Legend
December 6, 2023

To my knowledge there's no simple "forceSequential" or any such flag since the AEIO will handle most of that automatically in conjunction with the caching system and everything else is handled at the comp time level, not the source. It seems you may have to build your own code like forcing to check the frame order with AEIO_InqNextFrameTime() or similar and building a custom data structure to hold the info about the correct sequence. I would assume it will be slow as hog, though, since you're basically working against AE. Maybe you need to rethink your strategy and fetch the already cached frames.

 

Mylenium