1 person found this helpful
Getting the kVideoSegmentProperty_Media_StreamFieldType is the right approach. Are you using the actual media node ID, which is not the same as the clipID?
Also, since a single segment may contain more than one media, and there may be multiple instances of your effect applied to those media, the question can arise: which effect instance is the current effect? You can get the kVideoSegmentProperty_Effect_RuntimeInstanceID property, and compare that with the instanceID in the VideoRecord structure passed to the video filter.
This info is not retrievable using the AE API in Premiere Pro.
Thank you very much for your concise reply!
For the call to: ClipRenderSuite->GetClipFieldType(clipID, &fieldType) I use the clipID, should I use the medianodeID here?
For the call to: mSegmentSuite->GetNodeProperty(mediaNodeID,kVideoSegmentProperty_Medi a_StreamFieldType,&mediaFieldTypeString) I use the mediaNodeID (At least I assume as I simply modified the VideoParser code in the SDK code a bit, but I will double check.)
>Also, since a single segment may contain more than one media, and there may be multiple instances of your effect applied to those media, the
>question can arise: which effect instance is the current effect? You can get the kVideoSegmentProperty_Effect_RuntimeInstanceID property, and
>compare that with the instanceID in the VideoRecord structure passed to the video filter.
This I indeed noticed, thank you on the hint how to resolve this. I double check however with simple sequences which just contain one clip.
An addition to the API to simply retrieve the current clipID and medianodeID would simplify matters greatly and also increase performance (as I have to iterate over the entire segment structure now to get basic information about teh source material).
BTW. Do you happen to know how I can add a popup style UI element via the Premiere Pro SDK? (I found how to do a checkbox in one of the examples, although it uses numeric identifiers not part of the headers, but cannot figure out how to do a popup style element.)
In the sample VideoSequenceParser code, inside parseMedia(), I added a call to GetNodeProperty() with kVideoSegmentProperty_Media_StreamFieldType. It passes back a string that contains a prFieldType, defined in PrSDKTypes.h. Seemed to work well.
Popup menus are not available using the Premiere Pro filter API, unfortunately. All the effects that use popup menus are written using the After Effects API. If you provide a setup dialog during fsSetup, you can bring up your own dialog that contains any UI you want to provide using platform-specific UI calls.
nklem remaining Hi Zac.
Thanks for your efforts. Strange! I will try testing with more different sources.
BTW I figured out that you can call the media information API from inside an AE plugin. Only problem remaining is how to get a timelineID. The effect ID I can obtain via
VideoSegmentSuite->GetNodeInfo((csSDK_int32)FilterInstanceID,NodeType, &Hash, &Flags) I think.
I don't think there is any way to get a PrTimelineID from an AE effect plug-in running in Premiere Pro... That would make an interesting feature request.
That is a pitty, because then I could combine the best of both worlds.
In the mean time I have tested the GetNodproperty on more samples and indeed I get a proper field code, so apologies for asking a question for nothing. However the discussion was very worthwhile in other respects!
Thanks for all you assistance.
I found a work-around. It is a bit ugly, but it works. I simply scan all "timelineID" values below a certain limit (as I noticed that it are not pointers, but actually ID values with a fairly low number).
Then for all timelines I look for a matching effectID/filterID as you suggested.
// arbitrary end number: if too high too time consuming & crashes, too low: might miss sequences in large projects
for (int i=0; i<=0xffffff && !result; i++)
result=ParseSequence(VideoSegmentSuite, MemorySuite, FilterID, VideoSegmentsID);
Best regards, and thanks again,