Paul Scarborough
2013-09-11 02:24:33 UTC
Hello,
I am able to get 30 fps at 1920x1080 resolution out of the LifeCam Studio and Logitech C920 using the V4l2/uvcvideo under Ubuntu.
The frame size is about 200KB/s to 1MB/s.
If the frame size jumps from 200-400KB/s to around 1MB/s when I point the cameras out my window.(bright sunny day lots of vegetation - color)
Obviously when a lot of bright color is involved the jpeg compression isn't adequate enough to keep the pictures under 500 KB/s.
When this occurs on the beaglebone or the raspberry pi the dequeue of the buffer hangs until it reaches the maximum frame size and then the contents of the frame is just a bunch of jpegs incomplete. I believe this is from hitting the limits of the usb interface and so a lot of corrupted data is hitting the uvcvideo driver. On my pc I continue to receive the frames at 1MB/s without the frame hitting the maximum frame size but the jpegs are totally corrupted with half a picture here, half a picture there (jumbled up pictures).
Q:
Is there any way to tell the uvc mjpeg cameras to never send pictures this large so that usb 2.0 gets corrupted?
Maybe tricks with changing color or exposure so that it never reaches this threshold of intense color vs compressed size without reducing resolution?
I can reproduce this on 1280x720 as well on both cameras easily. 640x480 I have no yet just because they don't reach greater than 500KB.
I have even changed my code to read only one frame a second but even that one frame cannot be received without being returned as the maximum frame size and will contain a bunch of FFD8 (jpeg) headers inside it.
I started to doubt my code so I compiled and ran this today
linux-uvc.berlios.de/test.c
I pointed each camera out my window and it saved one frame that was the maximum frame size, corrupted, the same as my code.
09/10/2013 02:54 PM 1,843,200 frame-000000.bin. I can send if you are interested but I'm sure you already know what is going on.
If I point the cameras away from my window I get 30 fps and it looks great, I point it back at window and it hangs until it gets 1.8MB of corrupted jpeg frames and then again and then again. Point away, starts flying again at 30 fps at like 250-500KB/s lol.
I guess what really drives me crazy is why would they make USB 2.0 cameras support 30 fps in MJPEG mode when you can only use them when they don't have much color/light in the frame lol
I've also seen the same corruption of the jpeg pictures in Windows with Virtual Dub so that is when I finally realized it is obviously a USB transfer issue.
Thanks in advance
I am able to get 30 fps at 1920x1080 resolution out of the LifeCam Studio and Logitech C920 using the V4l2/uvcvideo under Ubuntu.
The frame size is about 200KB/s to 1MB/s.
If the frame size jumps from 200-400KB/s to around 1MB/s when I point the cameras out my window.(bright sunny day lots of vegetation - color)
Obviously when a lot of bright color is involved the jpeg compression isn't adequate enough to keep the pictures under 500 KB/s.
When this occurs on the beaglebone or the raspberry pi the dequeue of the buffer hangs until it reaches the maximum frame size and then the contents of the frame is just a bunch of jpegs incomplete. I believe this is from hitting the limits of the usb interface and so a lot of corrupted data is hitting the uvcvideo driver. On my pc I continue to receive the frames at 1MB/s without the frame hitting the maximum frame size but the jpegs are totally corrupted with half a picture here, half a picture there (jumbled up pictures).
Q:
Is there any way to tell the uvc mjpeg cameras to never send pictures this large so that usb 2.0 gets corrupted?
Maybe tricks with changing color or exposure so that it never reaches this threshold of intense color vs compressed size without reducing resolution?
I can reproduce this on 1280x720 as well on both cameras easily. 640x480 I have no yet just because they don't reach greater than 500KB.
I have even changed my code to read only one frame a second but even that one frame cannot be received without being returned as the maximum frame size and will contain a bunch of FFD8 (jpeg) headers inside it.
I started to doubt my code so I compiled and ran this today
linux-uvc.berlios.de/test.c
I pointed each camera out my window and it saved one frame that was the maximum frame size, corrupted, the same as my code.
09/10/2013 02:54 PM 1,843,200 frame-000000.bin. I can send if you are interested but I'm sure you already know what is going on.
If I point the cameras away from my window I get 30 fps and it looks great, I point it back at window and it hangs until it gets 1.8MB of corrupted jpeg frames and then again and then again. Point away, starts flying again at 30 fps at like 250-500KB/s lol.
I guess what really drives me crazy is why would they make USB 2.0 cameras support 30 fps in MJPEG mode when you can only use them when they don't have much color/light in the frame lol
I've also seen the same corruption of the jpeg pictures in Windows with Virtual Dub so that is when I finally realized it is obviously a USB transfer issue.
Thanks in advance