I've been struggling to get my Exporter plugin to work with any of the new planar PrPixelFormats (adobe Premiere Pro 6.0.3):
My plugin uses an input format not natively supported by the SDK: "NV12"
NV12 contains the same pixel/chroma information as YV12; the difference is in the chroma-plane packing. In YV12, each of the Cb and Cr planes is stored as a solo plane (at half-height x half-width). In NV12, each Cb+Cr sample is grouped into a 16-bit value, then packed into a single plane. The same information is there, the only difference is that YV12 has 2 chroma-planes (each with total bytesize '1/4 Y'), and NV12 has 1 chroma-plane (with total bytesize '1/2 Y'.)
so far I've only been successful using a 4:4:4 YUV PrPixelFormat, then having my user-plugin manually convert the 4:4:4 into a NV12 format.
(PrPixelFormat_VUYX_4444_8u). When I try any of the sequenceRenderSuite->RenderVideoFrame(...), I get garbled pixeldata.
The Y (luma) plane is correct, but the Chroma-data appears to be missing.
For example, I expect PrPixelFormat_YUV_420_MPEG4_FRAME_PICTURE_PLANAR_8u_709 to store the Cb/Cr plane immediately after the Y plane. However, it looks like renderVideoFrame( PrPixelFormat_YUV_420_MPEG4_FRAME_PICTURE_PLANAR_8u_709 ) simply returns the 'Y' plane repeated 3 times.
The SDK documentation doesn't go into detail about the new planar pixel formats? Is there an online reference or other doc?
Ok, I see what I did wrong.
I used the sample plugin project that came with the CS6 SDK. In their sample code (SDK_File.cpp), they use the following call to access a packed-pixel framebuffer:
mySettings->ppixSuite->GetPixels( ... ); // only works for PackedPixel formats (not planar!)
It turns out that the standard PrPixSuite only supports the packed-pixel formats (non-planar.) For the 'new' planar formats (PrPixelFormat_YUV_420_*), you must use the new PrPix2Suite. It's briefly mentioned in the SDF User's Guide:
"PPix 2 Suite
A call to get the size of a PPix. Starting in version 2 of this suite, introduced in CS4, there is a new
GetYUV420PlanarBuffers call to get buffer offsets and rowbytes of YUV_420_MPEG2 pixel formats. See PrSDKPPix2Suite.h."
After changing the struct "mySettings", to acquire & store the 'kPrSDKPPix2Suite' suite, I changed the above call to this:
mySettings->ppix2Suite->GetYUV420PlanarBuffers( ... ); // for planar PixelFormats only!
After this change, my plugin properly reads the 3 separate Y/U/V pixel-planes!