- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I'm developing UVC 2.0 host firmware which receives mjpeg video stream from the webcam. The video is 640x480 30fps in mjpeg format.
When I analyze the stream received from the webcam, I found that SOI(Start of Image, 0xff 0xd8) and EOI(End of Image, 0xff 0xd9) does not match exactly. When a SOI is found then there should be a matching EOI to complete a picture. But in my case it was not. (See below)
As a result, when I played the stream received in the host firmware, video generated by VLC player resulted in broken images like below. (Camera is showing the ceiling of my office, btw)
I think this could be resulted from the bandwidth issue but I don't know what to tune at this moment. I tried to change DMA buffer size etc but ends up same results so far.
The host firmware handles mjpeg stream in manual mode (by dedicated receiving thread). I'm curious whether this is fast enough to handle the video(640x480 30fps mjpeg) or not.
Any comments will be highly appreciated.
Regards,
Rossi
Solved! Go to Solution.
- Labels:
-
USB Superspeed Peripherals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi AliAsgar
Thank for your advice.
By the way, I solved the issue in another way. The dedicated thread was not very responsive so, I changed it in callback method which turned out to be lot more faster.
Regards,
Rossi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rossi,
Could you let us know which device (FX3 or CX3) is used for your application and the webcam?
640*480 @ 30 fps is well within the bandwidth. Hence there should be no bandwidth issues.
Could you share the modifications done to the default firmware for your application?
Also share the UART debug prints and wireshark traces when the issue is seen.
Best Regards,
AliAsgar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello AliAsgar
I'm using FX3. As your comment, yes, there should be no bandwidth issue. For your information, I attached the firmware(host.zip) and uart log(host full dump2.zip) which dumps all data received from the webcam to make sure the stream is valid or not. (As you can read in my previous report, non matching SOI, EOI issue can be find in the dump file) Dump is done in the following code.
void
UvcRecvThread(uint32_t Value)
{
CyU3PDebugPrint(4,"UvcRecvThread starts\r\n");
for (;;)
{
...
if(status==CY_U3P_SUCCESS){
//FULL DUMP received stream
CyU3PDebugPrint (4, "[%d] ",prodXferCount);
for(uint32_t i=0;i<prodXferCount;i++) CyU3PDebugPrint(4,"%x ",buffer[i]);
CyU3PDebugPrint(4,"\n");
...
}
}
}
After the dump, I did soi,eoi comparisons in the attached pictures(soi_search.png, eoi_search.png).
Regards,
Rossi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rossi,
Could you remove the :
AliAsgar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi AliAsgar
Thank for your advice.
By the way, I solved the issue in another way. The dedicated thread was not very responsive so, I changed it in callback method which turned out to be lot more faster.
Regards,
Rossi