This Handheld Device Uses an ESP32 to Play Videos
Alex was able to design a compact video player that supports MJPEG video formats and MP3 audio files while using off-the-shelf parts.
A source of inspiration
Released in the early 2000's, HitClips was a digital audio player ecosystem that relied on cartridges containing a mere 60 seconds of music, hence the name. So after discovering a DIY project that aimed to allow users to play multiple hours of music with an original HitClips player and microSD card, Alex from the YouTube channel Super Make Something was inspired to make a portable video player. Similar to the previously mentioned HitClips mod, his system would store videos on an SD card for later playback and incorporate the far-cheaper ESP32, rather than using a complex Raspberry Pi-based solution.
Designing a video player
Two of the main goals regarding this project were to allow for nearly anyone to build it without the need for advanced soldering skills and/or equipment, and contain modular components for easy modifications. Three configurations were planned, including video only, video and audio, and one that adds a large battery to the back for ultimate portability. All of these designs were also based off of a single PCB and nearly identical components.
The components
As stated before, this system uses an ESP32 to decode video files and play them. To make things easier to solder, Alex went with the popular ESP-WROOM-32 development kit that already contains a USB-to-serial conversion IC for easy programming. Audio is produced from either the onboard 8 ohm speaker or the 3.5mm headphone jack, both of which are powered by a single PAM8403 audio amplifier module that receives its signals from the ESP32's built-in DAC. Last of all and most importantly, videos are viewed on a 1.8" ST7735 LCD with a resolution of 160x128 pixels. Inputs are read from a pair of potentiometers at the base or the two momentary pushbuttons on the side.
How to display videos
Nearly all modern video formats rely on advanced codecs such as H.264/265 or AV-1 since they reduce the file size while simultaneously maintaining most of the image quality. Although these are great for streaming, their need for ample processing means lower-powered devices are unable to meet the required framerate. To get around this, Alex opted to use the MJPEG codec instead. It works by compressing each frame of the video into a single, lossy JPEG image, which is then stitched together with all of the other compressed frames to make the video. Even though the file size is larger compared to H.264 at the same bit-rate, its lower requirements for decoding makes it ideal in this application.
PCB creation and assembly
Alex began by laying out each component in an Altium Designer schematic and connecting them together with virtual 'nets'. From here, he laid them out within the boundary of an appropriately-sized mobile player and routed the traces. Once Alex received the fabricated boards, he assembled them by hand using a special technique for connecting the through-holes of the ESP32 development kit to the SMD pads due to its lack of castellated edges.
Using the device
To test this creation, Alex used FFMPEG to quickly convert a video file from the combined MP4 format into separate MP3 and MJPEG files for playback on the ESP32. Once booted, the mini video player worked exactly as intended, as he could both see and hear the media files stored on the SD card. For more information, you can watch Alex's video here on YouTube.