Just wondering
knivd
Posts: 103
in Propeller 2
Does P2 have enough processing power to accept feed from camera and encode it for Ethernet in real time?
Comments
I'd hazard to guess yes. It'll just come down to resolution, frame rate and which input device and compression type as to what exactly is realizable with a P2. If you are wanting 4k/HD from USB-2 and MPEG/H.264 compression, then no, but something like motion JPEG or even SD video capture with some 4:2:2 coding and decimation over 100Mbps link is probably achievable. @SaucySoliton has done some USB + analog video capture & encoding projects already, and I've been able to capture some HDMI streams to the P2 (with an external TMDS to parallel capture board). Other projects have had Ethernet working on the P2 via an RMII interface.
Pretty easy if use camera module with jpg output. Think did that with P1 and WiFi module before. “Real time” may be subjective though …
1 cog can JPEG compress about 5 MB/sec of image data at 320MHz. With a very well optimized PASM2 JPEG encoder. That is 32.7 fps at 320x240 with UYVY 4:2:2 input. It varies based on the content of the image. Compression ratio for my testing was about 7:1.
Here is NTSC to USB video class at 320x240 30fps. https://forums.parallax.com/discussion/comment/1564107/#Comment_1564107 Note that this code does not meet 30 fps if the image has a high amount of detail. Some of the other ones I posted have RGB16 input.
For 640x480 30 fps we would be looking at 4 cogs for JPEG encoding. If sent as uncompressed 4:2:0 it would be 14MB/sec, annoyingly just over the 11MB/sec maximum for 100baseT.
The USB ports on the P2 are a serious limitation whether input or output. If you use a USB camera with JPEG encoding, the USB 1 port on the P2 will bottleneck it to 640x480 x30fps at best. (4:2:2 video compressed at 19:1 or 4:2:0 compressed at 14:1) UVC specifies 4:2:2 encoding only.
Higher resolutions are definitely possible but will have a corresponding frame rate decrease.