Shop OBEX P1 Docs P2 Docs Learn Events
streaming VGA video over Parallax WX ESP8266 WiFi Module... is it possible? — Parallax Forums

streaming VGA video over Parallax WX ESP8266 WiFi Module... is it possible?

I'm exploring the potential to make a simple dedicated video phone terminal between two P2 (or even P1) over internet. Expecting to use these low res cameras, OV7670 640x480 0.3Mpixel VGA, which I see have been used with P2 already.
I'd appreciate any tips from anyone here on a project like that.
Thanks.

Comments

  • roglohrogloh Posts: 5,786
    edited 2022-12-11 21:00

    You'll probably need a way to compress/decompress the video stream at both terminals or only work with low frame rates and/or resolution. P2 has no floating point so you'll want to find/use a lightweight compression algorithm using integer math only. Buffering memory will be limited if you only use internal memory and the serial interface and wifi sustained bandwidth using an ESP8266 might limit the speed as well.

    Some numbers: 320x240x25fps@4:2:2 is already 30Mbps uncompressed.

    Would be an interesting project to see what is achievable with a P2.

  • Might consider a higher resolution unit like OV5642. It has a JPEG encoder. But JPEG doesn't compress as much as the MPEG codecs normally used for video.

  • Thanks.

    I chose the low res VGA specifically to lower the amount of data, and probably even 256 color is ok. though a 20+fps is desireable.
    Just now thinking about the audio channel, each frame (@ 20fps) needs to sync with 50ms of audio at some passable bit-rate for voice.
    yeah, I think I'll end up needing to be clever with explicit data shuffling, and may involve the 32MB version of the P2 Edge.

    I see adafruit has an ESP32 wifi coprocessor that'll take data over SPI with 8MHz clock. Does anyone ever hook Propeller to Ethernet cables? Probably homebrew Propeller MODEM over copper phone land-lines is folly. what about cellular? But, who'm I kidding. That's what makes it fun... pushing these to their limits. I used to stream video on OS/2 and BeOS on 8MB ram and ONE 180MHz 32bit processor. It seems like 8 x 32bit processors at much faster clock speeds and DMA smartpins should be able to manage it somehow.

  • roglohrogloh Posts: 5,786
    edited 2022-12-12 05:05

    I expect something should be achievable with a P2, it's just a matter of the final output quality obtained. A JPEG decode object in PASM would be really handy if the video camera can do the encode for you and might let you have much higher quality and resolution. Hopefully the HW encode, and final decode latency isn't too bad on the P2.

    There is an external PSRAM driver available that I wrote. It's pretty good for total bandwidth on the P2-Edge with reasonably sized blocks being transferred like 64 bytes or more, obviously less so for small blocks or individual items, but would still be enough. You can also use it as the main video display buffer which can save on HUB RAM if you use my video driver (or write one that uses its documented mailbox interface).

    The ESP8266 can also take in data via SPI. I'm actually thinking of making a single wide breakout soon that will use a ESP-12F and wire up the SPI pins as well as the serial uart, plus reset/shutdown and GPIO0. This may allow experiments with higher speed SPI transfers if the uart maxes out earlier.

    Give it a go, it'll be a fun project. :smile:

  • RaymanRayman Posts: 14,640

    I'm not sure P2 is the best choice for this, but I think it could be done with some help.

    I'd also recommend using a camera with a jpeg mode.
    Then, I'd use an LCD module that had an EVE2 or better chip on it to decode and display the jpeg.

    I posted some jpg decode code for p2 a long while ago, but I don't think it would be fast enough for this...

    Guess there are a few wifi options. I just started messing around with a Sparkfun ESP32 board yesterday, think it'd work.
    Or, just use the Parallax wifi module...

  • Thanks again. we'll see how it goes! it'll be a good exploration of limits and all around learning for me, relatively new on the Propeller.

  • jmgjmg Posts: 15,173

    @ngeneer said:
    streaming VGA video over Parallax WX ESP8266 WiFi Module... is it possible?
    I'm exploring the potential to make a simple dedicated video phone terminal between two P2 (or even P1) over internet. Expecting to use these low res cameras, OV7670 640x480 0.3Mpixel VGA, which I see have been used with P2 already.

    If you want best data speeds, you are best to change to a faster WiFi platform
    Google finds this
    https://espressif-docs.readthedocs-hosted.com/projects/espressif-esp-faq/en/latest/software-framework/peripherals/sdio.html

    that says

    What is the maximum speed supported by the SDIO interface?

    • The maximum clock speed supported by ESP32 SDIO is 50 MHz, and ESP32 SDIO supports the Quad mode at the maximum.
    • The maximum clock speed supported by ESP32-S3 SDIO is 80 MHz, and ESP32-S3 SDIO supports the Octal mode at the maximum.
    • The practical speed is influenced by the read and write speed of storage media at the same time.
      Does the hardware SDIO interface support SD cards?

    • Please note that the SDIO hardware only supports the device or slave profile, i.e. it cannot act as a host to control SDIO devices such as SD cards.

    So that suggests the EDP32-S3 is a better fast link platform. P2 can run 4 bit and 8 bit streamers.

  • this https://www.adafruit.com/product/4729 looked interesting, but using the S2 version not S3. still, it was not an impressive speed, even locally on the device - which I chalk up to the code.
    In any case, I'll take this a step at a time, start with the camera, see what refresh and resolution I'll tolerate then assess the necessary datarate.

Sign In or Register to comment.