Video Playback on Teensy 4.0

ShelfCandies

New member
Hi everyone,

Teensy seems like the perfect solution to a project I'm working on. I want to play a short video clip with audio on a 2.2" screen. The video will start when the Teensy is powered, loop back from the beginning once the clip ends, and require no user input. I've been doing some reading on*the forums, ordered some supplies, and wanted to check in before I got started.

My questions:
  • Is this wiring correct?
  • What software can I use?
  • How can I drive a small speaker?

Here are my components:
  • Teensy 4.0
  • Audio Shield For Teensy 4.0
  • HiLetgo 2.2 Inch ILI9341 SPI TFT LCD Display 240x320
  • Micro SD card

For wiring, I have male headers on the Teensy already, and I'll solder female headers onto the audio shield. I'm planning to solder wires for the LCD on the opposite sides of the audio board headers unless there's a better way to do it. Is this the best way to wire it all up?

teensy_4_lcd_pinout.jpg

Kurt's ILI9341_t3n library seems perfect, but I don't see code for a video demo. There's this thread (https://forum.pjrc.com/threads/3670...een-DMA-Buffer-for-Teensy-3-5-Teensy-3-6-only), but what's the latest stack out there for video playback on the 4.0? Could someone link code for video and audio playback? I plan to use the Micro SD card slot on the audio shield, but I could wire up the slot on the LCD if need be. I understand that the Teensy isn't designed for video playback. It looks like the 4.0 has 1 MB of RAM. My video files are pretty small, but we'll see.*They're all 320x240 @30 fps. The longest is 3 minutes long, the highest filesize is 15 MB, the highest video bitrate is 805 kbps, and the audio bitrates are around 128 kbps. The smallest is still currently 3.75 MB. I can compress them to decrease the sizes and bitrates*further if necessary,*but it's still definitely a concern. Any intuition as to what the largest possible filesize/bitrate would be? I imagine I could chop videos up if the entire thing has to fit in RAM during playback and further compression doesn't help or reduces*quality too much. I could also switch to a*HiLetgo 2.2 inch ILI9225 SPI Serial Port 176x220 TFT LCD to reduce the resolution and bring the LCD price down from $17 to $12.

I'd like to connect a small speaker as well. I'll use the headphone jack on the audio shield to test, but I'm just looking ahead. Something like Adafruit's Mini Metal Speaker w/ Wires - 8 ohm 0.5W[ID:1890]. What else would I need to drive something like this, and are there other small speaker recommendations?

I'd also like to power a small LED while the Teensy is powered. How should I connect it (which pins are valid, should I add a resistor), and what should I do (if anything) in software to light it? Down the road, I may want to cycle through video clips and have a different LED light when each is playing.

Thanks for the advice, I'm looking forward to seeing what the Teensy can do.
 
Last edited:
Back
Top