Converting MJPEG USB example from MJPEG to YUV2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Converting MJPEG USB example from MJPEG to YUV2

1,553 Views
tamir_michael
Contributor IV

Hello,

I have tried to convert the SDK example "evkmimxrt1064_dev_video_virtual_camera_bm" to use YUV2 instead of MJPEG. Basically I have changed the format and frame descriptors (see attachment), and provided a YUV2 image source instead of the MJPEG source provided with the example. In addition I changed the dimensions of the image to 640x512 and updated the bit rate, and no longer using the function "USB_DeviceVideoPrepareVideoData". Device enumerates correctly.

Problem is no video is streamed when connected my device to a windows 10 host (also Linux hosts don't work). I know this because the function "USB_DeviceVideoStreamIn" is never called (but "USB_DeviceVideoControlIn" is).

UPDATE 1:

I tried to only change the descriptors in the example expecting the host to display noise (because of MJPEG data clockouted out as YUV2), but despite of "USB_DeviceVideoStreamIn" being called this time, I don't think the host receives anything at all.

UPDATE 2:

Adding the UVC header, kernel module logging indicates data transfer but I don't see any image. Is there a NXP sample out there demonstrating how to stream data using YUV2?

UPDATE 3:

Make sure you send the expected number of bytes to the host - then it works.

Can you help me figure this out? I have attached my configuration descriptor.

Thank you.

Labels (2)
0 Kudos
Reply
1 Reply

1,402 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Tamir,

Hope you are doing well.

I apologize for the delayed response. Unfortunately there is not an NXP example for the USB video class working with the format you mention. The CSI examples do have the parameters to change from RGB to YUV422, however it is with the CMOS Sensor interface module, not usb. 

The documents that may be useful for your reference are:

https://www.nxp.com/docs/en/application-note/AN12110.pdf 

https://www.nxp.com/docs/en/application-note/AN12103.pdf 

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos
Reply