4 Replies Latest reply on Jan 14, 2015 3:56 AM by jkulaga

    Empty pix pointer while accessing transmitter

    j.kulaga

      Hi,

       

      I've troubles with accessing frame data via transmitter api. I've used Transmitter sample and in PushVideo method I'm trying to get inFrame pix data, but it is empty.

       

      Code looks like this:

       

      tmResult TransmitInstance::PushVideo(

        const tmStdParms* inStdParms,

        const tmInstance* inInstance,

        const tmPushVideo* inPushVideo)

      {

      /*sample code*/

       

      // Dispose of the PPix(es) when done!

      for (int i=0; i< inPushVideo->inFrameCount; i++)

      {

           PPixHand inFrame = inPushVideo->inFrames[i].inFrame;

       

           char *pBuffer = nullptr;

           prSuiteError result = mSuites.PPixSuite->GetPixels( inFrame, PrPPixBufferAccess_ReadOnly, &pBuffer );

      }

       

      pBuffer is empty and inFrame member "pix" also. Buffer access flag does matter, but I tried all possibilities and still doesn't work. "result" is 0. Premiere Pro version is CC 2014.

       

      Am I doing sth wrong?

       

      Please, help.

        • 1. Re: Empty pix pointer while accessing transmitter
          Zac Lam Adobe Employee

          How/where are you checking the value of pBuffer and inFrame.pix?  Could it be that the variables you've declared have gone out of scope?

          • 2. Re: Empty pix pointer while accessing transmitter
            jkulaga

            In Transmitter project, in TransmitterPlugin.cpp there is PushVideo() and iteration across inFrames and before Dispose will be called on PPixSuite I'm checking PPixHand's pix member:

             

            // Dispose of the PPix(es) when done!

              for (int i=0; i< inPushVideo->inFrameCount; i++)

              {

                 const tmLabeledFrame &frame = inPushVideo->inFrames[i];

             

              mSuites.PPixSuite->Dispose(frame.inFrame);

              }

             

            empty pix.PNG

             

            Also when I was trying to access buffer as in first post (prSuiteError result = mSuites.PPixSuite->GetPixels( inFrame, PrPPixBufferAccess_ReadOnly, &pBuffer );) result is same.

            • 3. Re: Empty pix pointer while accessing transmitter
              Zac Lam Adobe Employee

              What do you have set in Project Settings > General > Video Rendering and Playback?  Do you have CUDA or OpenCL rendering on?  And in QueryVideoMode, do you have set outPixelFormat = PrPixelFormat_Any?

               

              If so, then the frames are being rendered on the GPU, and PPixSuite->GetPixels() will not retrieve the frames.  Instead, for GPU rendering, you should set outPixelFormat to one or more of the uncompressed formats in PrSDKPixelFormat.h, such as PrPixelFormat_BGRA_4444_8u, PrPixelFormat_BGRA_4444_32f, PrPixelFormat_RGB_444_10u, etc.

              • 4. Re: Empty pix pointer while accessing transmitter
                jkulaga Level 1

                outPixelFormat is set to PrPixelFormat_Any. When I've changed it to PrPixelFormat_BGRA_4444_8u frame buffer is no longer empty.

                 

                Thanks for help