Copy link to clipboard
Copied
I am trying to write a filter for which the field type (e.g. lower field first, upper field first or
progressive of the SOURCE material is important.
I am guessing the following should do the trick, but it always returns 0 (while source material is lower field first PAL DV)
VideoSequenceParser videoSequenceParser(SPBasic,0,0,0,0);
videoSequenceParser.ParseSequence((*theData)->timelineData,0);
PrClipID clipID=videoSequenceParser.FindClipIDAtTime(10000);
ClipRenderSuite->GetClipFieldType(clipID, &fieldType);
I also tried :
returnValue = mSegmentSuite->GetNodeProperty(mediaNodeID,kVideoSegmentProperty_Media_StreamFieldType,&mediaFieldTypeString);
But with the same result always 0.
BTW (I am using the Premiere SDK and not the After Effects SDK, because I thought I will be able to obtain more details. If it is possible with the After Effects SDK all the better.)
Can anybody help me with this an explain how I can obtain the field type of a source clip?
Thanks in advance,
Arjan
Hi Arjan,
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.
Thanks,
Zac
Copy link to clipboard
Copied
Hi Arjan,
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.
Regards,
Zac
Copy link to clipboard
Copied
Dear Zac,
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.)
Best Regards,
Arjan Mels
Copy link to clipboard
Copied
Hi Arjan,
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.
Regards,
Zac
Copy link to clipboard
Copied
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.
Best Regards,
Arjan
Copy link to clipboard
Copied
Hi Arjan,
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.
Thanks,
Zac
Copy link to clipboard
Copied
Hi Zac,
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.
Arjan
Copy link to clipboard
Copied
Dear Zac,
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.
E.g.:
// 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++)
{
if (PrSuiteErrorSucceeded(VideoSegmentSuite->AcquireVideoSegmentsID(i,&VideoSegmentsID)))
{
result=ParseSequence(VideoSegmentSuite, MemorySuite, FilterID, VideoSegmentsID);
VideoSegmentSuite->ReleaseVideoSegmentsID(VideoSegmentsID);
}
}
Best regards, and thanks again,
Arjan Mels