fps too slow when using direct draw (WEC7 on i.MX53) RRS feed

  • Question

  • I'm using a freescale i.MX53 with all the freescale codec installed under WEC7.
     I need to use an USB camera to viualize a video and to record a video.
     I use the USB WebCam driver from codepkex ( ) compiled under WEC7.
     When I try to visualize the video stream using DirectDraw all it's fine, but when I try to stast to record a video, The fps is around 3/5 Fps and the CPU usage rise up at 100%.
     I notice that the IOCTL that take the buffer from the USB driver is called every 300 milliseconds.
     If I try to call directly the IOCTL, I can read the buffer immediately, so it seems that the problem is between direct draw and the codec.

    Any help is appeciated!

    Beppe Platania Windows Embedded MVP

    Monday, January 27, 2014 2:31 PM

All replies

  • Hi Beppe,

    Are you using the VPU codecs for recording the video or just using the Microsoft wmv software encoder?

    Please mark it as answer or vote as helpful if my reply helps.



    Tuesday, January 28, 2014 6:14 AM
  • Hi Prabu,<o:p></o:p>

    I used both, but with more or less the same results.<o:p></o:p>

    I'm afraid the VPU codecs do not use the graphics HW accelerator because the CPU consuming is high.<o:p></o:p>

    Beppe Platania Windows Embedded MVP

    Tuesday, January 28, 2014 12:27 PM
  • Hi Beppe,

    If i understand correctly,usually freescale provides the VPU encoder as a DirectShow Filters.But cewebcam driver is a Stream interface driver,so your application also might be IOCTL based.

    How did you make sure to use the VPU encoder for recording? Are you integrating the VPU APIs in your camera application?

    Please mark it as answer or vote as helpful if my reply helps.



    Tuesday, January 28, 2014 12:58 PM
  • Hi Prabu,

    i wrote a program that use directshow.

    I use as encoder the mx53_vpu_enc_dshow.dll that is configured in the registry as follow:

        @="FSL VPU Encoder DMO"


    Then I use the filter in this way (these are some snippets) :

    GUID encoder = {  0x27CC5ADB, 0x44F3, 0x4ab8, 0x84, 0xBA, 0x32, 0xE6, 0x95, 0xCA, 0x7D, 0x41};

    pVideoEncoder.CoCreateInstance( encoder, NULL, CLSCTX_INPROC);


    pFilterGraph->AddFilter(pVideoEncoder, TEXT("Video Encoder Filter"));


    pCaptureGraphBuilder->SetFiltergraph( pFilterGraph );



    I hope this can help you to understand how the encoder is used.

    In my tests I add a RETAILMSG in the IOCTL_CS_BUFFERS and I see that is called more less every 300 milliseconds.

    Beppe Platania Windows Embedded MVP

    Monday, February 17, 2014 11:56 AM
  • Hello everybody,

    we have been struggling for a while with the WEC7 Freescale MDK for i.MX53 with no relevant result. The demo applications included in the MDK are not working on our platform and unfortunately there's no source code include in the MDK, so we are getting a bit confused.

    Our primary target is to capture compressed video and store it to a file, but so far any tentative to use the VPU encoder within a DirectShow graph led to no result - we are always getting E_NOINTERFACE when trying to query the interface for either the DMO wrapper filter or the encoder (we are currently working with a port of the CameraApp from CE 6.0 R3)

    Sure our knowledge of DirectShow is still too basic and probably we are missing some important point in the procedure of building a graph. Can anyone please help us in bringing to life the VPU-accelerated encoder (mx53_vpu_enc_dshow.dll)contained in the MDK?

    Thank you in advance and best regards,

    Stefano Voulaz

    Friday, June 6, 2014 1:22 PM
  • Hi Stefano,

    To use the Dshow encoder filter on your application,it should be first registered in the OS using the registry.I had taken the below registry from the freescale default BSP. Verify in your platform whether this kind of registry is included.

    ; MX53 VPU Encoder Filter 
    	;Register "FSL VPU Encoder DMO", can be done by "regsvr32.exe mx53_vpu_enc_dshow.dll"
        @="FSL VPU Encoder DMO"
    	@="FSL VPU Encoder DMO"
    	;"InputTypes"=hex \
    	;Add a wrapper filter for our VPU encoder DMO
    	@="FSL VPU Encoder DMO wrapper filter"
        ; MEDIATYPE_Video\MEDIASUBTYPE_MP4V;          
    	;Register the wrapper as a filter
    	@="FSL VPU Encoder DMO wrapper filter"
        ;VPU encoder only support Not interleved format		
        "EnableCbCrInterleavedOutput"=dword:0  ; FALSE		

    Please mark it as answer or vote as helpful if my reply helps.



    Wednesday, June 11, 2014 3:17 PM