How to Smoothly Play Videos Using MCU?

This article guide

The Cortex-M7 processor is fundamentally a microcontroller, yet it boasts a main frequency of up to 600MHz, high-density 512KB TCM SRAM, and 16MB of high-speed SDRAM. Its ultra-fast real-time response and strong processing capabilities enable the RT1052 to perform video encoding and decoding.

For video applications, when the processor lacks a GPU unit, the decoding of video files requires the CPU to provide fast computational power and a large amount of memory as a buffer. This is the main reason why traditional microcontrollers cannot handle video applications, leading to the use of application processors like the M6Y2C Cortex-A7 and M6708 Cortex-A9.

The M1052, as a cross-border core board based on the Cortex-M7 core, has advantages such as small size, low power consumption, ease of use, and low cost. But can it also provide strong audio and video encoding and decoding capabilities?

How to Smoothly Play Videos Using MCU?

Figure 1 M1052 Cross-border Core Board

Support for Video Applications by i.MX RT1052

Although the i.MX RT1052 adopts an MCU core, it is based on the architecture of application processors, which allows it to achieve high performance and rich functionality of application processors while retaining the ease of use and real-time low power operation characteristics of traditional MCUs, filling the gap between high performance and usability.

The core of the i.MX RT1052 runs at speeds of up to 600MHz, has built-in high-density 512KB TCM SRAM, and can achieve ultra-fast real-time responses with interrupt latency as low as 20 nanoseconds. It supports SEMC interfaces for mounting SDRAM as memory expansion. The eLCDIF peripheral can easily drive displays, and the built-in SAI audio interface and MQS sound card provide good support for audio and video applications.

How to Smoothly Play Videos Using MCU?

Figure 2 RT1052 Framework Diagram

M1052 Video Application Development

While the M1052 core board is primarily focused on industrial control applications, it can also be used for multimedia applications, aiding in product diversification. The M1052 core board comes with 16MB SDRAM, providing a large buffering space, and can mount TF cards, USB drives, NAND, and QSPI Flash to provide large-capacity storage expansion for system applications. It supports ultra-high resolution 1366X768 LCD displays and hardware floating-point operations, with a refresh rate of up to 80 frames per second. Its rich resources and strong performance lay a solid foundation for video application development.

The M1052 core board is paired with the AWorks SDK software package, which has already configured the peripheral drivers related to video application development for users, allowing them to start developing video applications without concern for low-level peripheral drivers. It also provides a video player demo program as a reference for users in video application development.

How to Smoothly Play Videos Using MCU?

Figure 3 Video Player Example

Integrated Professional Codec Libraries

libjpeg is an open-source JPEG compression/decompression library known for its high stability, strong compatibility, and fast decoding speed. The decoding library is entirely implemented in C, making it very easy to port to different platforms. Given the performance and resources of the i.MX RT1052, using libjpeg for the decoding library is an excellent choice. Therefore, the video player demo program uses libjpeg to implement JPEG format AVI video decoding.

How to Smoothly Play Videos Using MCU?

Figure 4 Supporting libjpeg Codec Library

Diverse Video Playback Methods

The video playback demo program implements a relatively complete video player framework. The GUI interface task is responsible for image display and touch processing, while the control state machine manages state transitions for playback logic. The audio and video decoding and playback tasks work in coordination, achieving good audio-visual synchronization, as shown in the program design framework.

How to Smoothly Play Videos Using MCU?

Figure 5 Video Design Framework

The video player supports reading video files from TF cards, USB drives, and NAND Flash, and supports functions such as file list preview, file selection, and playback progress control. With audio and video synchronization, it can smoothly play 480 X 272 resolution video at 25 frames per second, with a CPU usage of about 35%. It is evident that the i.MX RT1052 can fully meet the demands of video applications.

Interactive Moment

ZLG

Introduction to Zhiyuan Electronics

Guangzhou Zhiyuan Electronics Co., Ltd. was established in 2001 and is a national high-tech certified enterprise, as well as the Guangdong Provincial Engineering Technology Research and Development Center for high-end industrial control measuring instruments.

Vision:To become a leading enterprise in the industrial Internet ecosystem

Utilizing “Chip + AWorks Software Platform” to design high value-added modules, boards, and high-end measuring instruments. Through wired and wireless interfaces, connect to the ZWS IoT cloud for big data processing, forming an industrial Internet ecosystem.

Mission:To advance the process of China’s industrial Internet with leading technology

Values:Professionalism and focus achieve dreams

How to Smoothly Play Videos Using MCU?

Leave a Comment