EN

STONE TFT LCD Module Video Play Function

The Intelligent TFT LCD Module provides simple and easy-to-use video play functions.which meet the requirements for video play functions in occasions like start-up videos, device maintenance videos, and advertisement and entertainment videos.

 

1. Start-up animations: It is a powerful means to show the device level and corporate image. At present, the animation is implemented by continuously displaying pictures. In this way, on the one hand, due to its limitation of the number of stored pictures, the play time is very limited, and on the other hand, the synchronous play of sound is impossible.

 

2. Device maintenance video: The videos that deal with the daily maintenance of the device, common failures, etc., can be embedded in the device, which can effectively improve the efficiency of daily after-sales service and reduce the costs.

 

3. Advertisement and entertainment videos: The advertisement videos such as retailing devices, self-service selling devices, fitness equipment, beauty equipment, medical instruments, etc., or entertainment videos can also be played during the working gap of the device.

 

Ⅰ. Video playback mode of Intelligent TFT LCD Module

 

The Intelligent TFT LCD Module provides the video control and the video register (0x60-6e) for playing AVI format video. The video files must be stored in the HMI if using the video control mode to play video; The video files can be stored in the Intelligent TFT LCD Module, or in the USB flash disk if using the video register mode to play video. When the Intelligent TFT LCD Module plays video, the variables on the current page will not be refreshed.

 

All models of STVI series support the register mode to play video without limitations of the size of video files; The firmware was released in November 2018 and later to supports video control mode to play videos.

 

The STVA series only supports video control mode to play video with the the size limitation not more than 2M bytes. The whole series does not support video register mode to play video.

 

 

 

Table 1 Comparison of the Characteristics between Two Video playback Modes

 

 

STVI

STVA

Video storage location

Suitable occasions

Video control

Updating

Partially support

Intelligent TFT LCD Module

Playing of fixed content such as start-up videos

Video Register

Support

Not support

Intelligent TFT LCD Module, USB flash disk

The playing of mode being flexible and diversified

 

Part models of the Intelligent TFT LCD Module can only display the images of videos and do not support the voice output, because there is no voice interface. Whether the voice interface is supported can be specifically inquired through the "Supported External Devices" of the product specification

 

Parameter

Data

Buzzer

Support

RTC(real-time clock)

Support

Audio and video

Support the picture playing and sound output with speaker power of 8 ohms and 2 watts.

Keyboard interface

Support the external matrix keyboards of up to 8 rows and 8 columns and should be used in conjunction with KAP02.

USB flash disk interface

Support. Used to download or copy user data offline.

USB flash disk -mini interface

Support. Used to download or debug online.

Storage space

128M bytes/ 1G bits(support the pictures in JPG format with the theoretical storage of up to 65,536 pictures).

Figure 1 List of Supported External Devices in Product Specification

 

Ⅱ. Video file format

The video files must be reformatted with the "Format Factory" software according to the format requirements of the Intelligent TFT LCD Module AVI video files before used, as shown in Figure 2. If the AVI format parameter does not meet the requirements, or the AVI files are generated by other video conversion software, the Intelligent TFT LCD Module may not play video normally.

 

In the video stream, the video is encode in mjpeg format, the resolution can be less than or equal to the actual resolution of the screen, the bit rate is recommended to select 1,024KB / S, and the number of frames per second is selected to be 15-18. The bit rate and the number of frames per second cannot be set too high. Otherwise the video file will be very large. When playing the video files in the USB flash disk, the bit rate of the video file shall not be greater than 4,096KB / S, otherwise, the USB transmission speed will be limited and get little stutters. In the audio stream, the audio is encoded in mp3 format with a sampling frequency of 16,000 HZ, a bit rate of 128 KB/ S, with two channels.

TFT LCD Module Video Play Function

Figure 2 Video Format Conversion Software "Format Factory"

 

In order to play video files in the Intelligent TFT LCD Module, the video files need to be added to the video file list first. As shown in Figure 3, the mouse points to the "Video File" position, the we can right-click, and add the video files. The video files need to be saved directly under the root directory of the USB flash disk, if they are required to be played directly.

TFT LCD Module Video Play Function

Figure 3 Add video files

 

 

Ⅲ. Playing Video by Video Control Mode

The control is to play certain specified AVI video at certain position on the display screen. The variable has only two values: One for the start value and the other one for the stop value. When the start value is written into the variable unit by the command 0x82, the video starts to play; When the stop value is written, the video stops playing.




TFT LCD Module Video Play Function

Figure 4  Video Control Attribute Settings

 

Set up as shown in Figure 4:

When 1 is written into unit 4000, the file "0.AVI" will be played which will be switched to Page 0 after playing is finished.

Send commands: A5 5A 05 82 40 00 00 01

A5 5A: Frame header

05: Command byte length, 82 40 00 00 01 (5 bytes in total) 

82: Write variable memory commands

40 00: The variable address set, as shown in the variable attribute in the figure above

00 01: The start value set

 

When 0 is written in

When 0 is written into the unit 4000, the video stops playing.

 

When other values are written into the unit 4000, it is Invalid and no operation is performed.

 

Tips:

 Use the video control to play video "0.AVI" automatically on the device when it starts up.

If the initial value of the variable in Figure 4 is set to 1, it is possible to automatically play video "0.AVI" whenstarting up.

 

Ⅳ. Playing Video by the video register mode

Table 2 Video Play Register

 

Register

Address

Definition

R/W

Byte

length

Commands

0x60-0x67

Play _ Avi _ Set

R/W

1

0x5A: Apply for setting player parameters

Avi _ Type

W

1

0x00: Single play the videos in Intelligent TFT LCD Module (Default mode)

0x01: Single cycle play the videos in Intelligent TFT LCD Module

0x02: Playing the videos in Intelligent TFT LCD Module in sequential cycles

0x03: Single play the videos in the USB disk

0x04: Single cycle play the videos in the USB disk

0x05: Playing the videos in USB disk in sequential cycles

Note: The video file extension must be * .avi;

The files must be named as Arabic numerals when single played, such as "123.avi";

The file can be named as alphabetic + numeric when playing sequentially, such as "wuhan123.avi."

Play _ Position

W

4

Coordinate position of the upper left corner of the video window (XH, XL, YH, YL)

Note: (0, 0, 0, 0) indicates a centered display.

Play _ Avi _ Num

W

2

The video track is selected to play through the video file name with a maximum of 65,536 videos;

Only for single play, not valid for sequential play.

0x68-0x69

Vol _ Adj _ En

W

1

0x5A: Apply for adjusting the volume of playing video

Vol

W

1

Volume value of playing video, range from 0x00 to 0x3F, power-on default value being 0x3F.

0x6a

Play _ Control

W

1

0x5A: Play/Pause

For single play mode, after playing the current video, the system automatically jumps back to the current picture interface.

0x6b

Play _ Stop

W

1

0x5A: Stop it

After it is executed to stop playing video, the system will automatically jump back to the current picture interface, or jump according to the button.

0x6c

Play _ Next

W

1

0x5A: Play the next song

0x6d

Play-Prev

W

1

0x5A: Play the previous song

0x6e

Play _ Status

R

1

0x00 = Idle; 0x01 = Playing; 0x02 = Pause.

 

The video playback can be controlled by user command control and touch control.

Mode 1: User command control mode

 

The user writes the register 0x60 - 0x6d through the command 0x80 to implement the functions of playing, pausing, continuing and stopping of avi video.

 

For example, in the video register application, to play video 01 singlely in the USB flash disk on the position of the display screen (10, 10):

First send play parameter             A5 5A 0A 80 60 5A 03 00 0A 00 0A 00 01,

And then send the playing command    A5 5A 03 80 6A 5A

 

Mode 2: Touch mode

Register 0x61 - 0x6e is mapped to variable memories 0xff01- 0xff0e. That is, the user variable memory 0xff01 - 0xff0e can be operated to implement the same function (mainly used for touch-control to play avi video without intervention of user MCU command). Design the buttons such as play / pause, stop, next tune and volume adjustment on the playing interface, and the variable memory 0xff01-0xff0e (register 0x61-0x6e) can be modified by the "Button Key Value Return" control so as to play the avi video without intervention of the user MCU;

Tips: Use the video register to automatically play the video "0. AVI" when the device starts up.

 

By the Intelligent TFT LCD Module development Tools, a data variable control is design at the unit 0xff0a, the initial value is set to 0x5a, and the file name of the start-up animation video is set to 0.avi. After the HMI is powered on, the start-up animation “0. Avi” will be played automatically.

 

Ⅴ. Operation commands of the format factory

Download address of the format factory : http://www.pcfreetime.com.

TFT LCD Module Video Play Function

Figure 5 Format Factory Main Interface Selection AVI

TFT LCD Module Video Play Function

Figure 6 Add Video Source File

TFT LCD Module Video Play Function

Figure 7 Set the Output Video Format

 

TFT LCD Module Video Play Function

Figure 8 Converting and Viewing Video

 

TFT LCD Module Video Play Function

Figure 9 Output Video File