Embedded Streaming Media Player Design Based on Intel PXA270 Platform

Abstract: With the rapid development of car navigation systems, car terminals with video playback capabilities have gradually become new hotspots. Based on this requirement, this paper designs an embedded streaming media player based on the Intel PXA270 hardware platform and the embedded Linux software platform. It uses wireless Internet access to support ASF and RM format stream file decompression. MP1, MP2, MP3, WAV audio and advanced MPEG-4 video, and support for other formats through software upgrades.

Keywords: PXA270; MPEG-4; streaming media

Player overview

In the past two years, car navigation systems have quietly emerged in China. According to experts' predictions, the initial demand for the Chinese car market is about 550,000 units, equivalent to about 2.76 billion yuan. In the long run, the scale will reach 100 billion yuan. However, the video playback capabilities of current in-vehicle terminals are mostly weak, and only a few manufacturers capable of supporting new encoding formats such as MPEG-4. Moreover, due to the unique characteristics of the embedded system, the storage space of the vehicle product is generally small, and only the streaming file can be downloaded while playing to meet the playback requirements of the audio and video on the vehicle terminal, and the real-time information for the owner to play refresh. This product is an embedded streaming media player based on IP network. It can support MPEG-4 and mainstream streaming media formats, and can support future media formats through software upgrades.

The underlying development environment of the player
The hardware environment of the player includes: Intel PXA270 development platform Sophia (sophia board for short) and 10Mb/s wireless network card supporting 802.11a and USB interface. The sophia board is based on Intel's embedded processor PXA270, with 2700G multimedia acceleration chip for video acceleration and 3D acceleration. The hardware module of the system is shown in Figure 1: The network control module sends the data read from the network card to PXA270. Processed with the Intel 2700G module, the decompressed data is played on an LCD or RGB display.


Player partitioning
The embedded Linux kernel used by the sophia board is compiled from MontaVista linux based on the linux-2.4.20 kernel. The file system is a jffs2 file system for Flash unbuffered mechanism. At the same time, the developers of sophia board also provide a large number of software and hardware resources such as BSP and middleware. The network control module, decoding module and player module in the communication interface are the key to system development. The module partitioning of the entire system is shown in Figure 2: The bootloader performs the lowest level of booting on top of the hardware physical layer, which is part of the board support package BSP. The BSP is responsible for establishing direct contact with the underlying hardware devices, and it can also contain certain drivers. However, in Sophia's software system module, the NIC driver is dynamically loaded as one of the modules of the embedded system kernel. The embedded middleware is located in the middle of the operating system and the application, and provides the connection to the program module and the component library. The decoding module and the player module of the system are all developed on it.


Module implementation
System implementation can be divided into the following steps:
1) Migration and compilation of embedded Linux kernel, installation of file system;
2) implementation of the video image decompression module;
3) implementation of the playback module;

Migration of embedded Linux kernel and installation of file system and graphical interface system

The embedded Linux kernel working on the sophia board has a certain versatility similar to the development steps of the boot-loader, kernel, file system loading steps and cross-compilation environment. The specific establishment method can be referred to. literature. But there are two points to note:

1) When using make menuconfig to customize the kernel, let the kernel support the wireless network card. The specific steps are to select USB network devices in the USB Support configuration menu, and then select wireless in the submenu to add driver support for the USB wireless network card in the kernel. .

2) After compiling and installing the GUI system, pay attention to the gettext option in the option, otherwise the program will not compile smoothly.

Implementation of video image decompression module
The data acquired by the network control module exists in the form of stream data in the system. Therefore, the stream file is first decompressed. At the same time, in order to improve the transmission efficiency and improve the video image quality, the original video images transmitted on the network are compressed and encoded, so it is also necessary to perform corresponding decoding according to the encoding format. This system not only supports common MP1, MP2, MP3 and WAV audio file formats, but also decompresses advanced MPEG-4 video image compression encoded files.

Decompression of streaming files
According to the requirements of the car navigation network connected to the player, this solution should provide the decompression capability for the current mainstream stream file formats: ASF and RM.

ASF file decompression
The basic organizational unit of ASF files is called ASF objects. Each object consists of three fields: a 128-bit globally unique object identifier field, a 64-bit integer object size field, and a variable-length object data field. The high-level logical structure of an ASF file also contains three parts: a header object, a data object, and an index object. The header object is required and must be placed at the beginning of each ASF file. It contains a lot of global information, which must be received and interpreted by the receiver before the data object; the data object is also required and generally follows After the header object, all the data to be played is included; the index object is optional.

RM file decompression
The basic components that make up the RM file are blocks, each block consisting of three fields: a four-character code that indicates the block identifier, a 32-bit value that defines the size of the data in the block, and a block portion. The block identifier is used to uniquely identify each block. Similarly, the high-level logical structure of the RM file is also composed of three parts: the file header part, the file data part, and the file index part. Because the RealMedia file format is a flagged file format, the order of the blocks is not explicitly specified, but the RealMedia file header must be the first block of the file.

Decompression of MPEG-4 video images
In several open source MPEG-4 decoding software, the author chose xvidcore as the core algorithm for the video image decompression module in the system. Xvid is an efficient and portable encoding software that uses the latest version of xvidcore- 1.1.0. Xvid supports SimpleProfile and Advanced Profile, supports I/P Frames, B-Frames, Interlacing and GMC, and is currently the popular MPEG-4 encoding software. Cross-compilation of xvidcore- 1.0.1 has the following main steps:

1) Unzip the xvidcore source code tar-zxvf xvidcore- 1.1.0.tar;
2) Set the environment variable export xvidcore= “the path of xvidcore”;
3) Generate makefile ./configure- - host=localhost- - build=arm- linux- gcc;
4) compile the source code make; make install;

Copy the cross-compiled library file libxvidcore.so.* into the ./local/lib subdirectory of the cross compiler working directory, which provides programming interfaces for other modules of the system.

Scalability of the decoding format
The more file formats supported by the player, the more powerful it is. The PXA270 embedded processor and 2700G multimedia acceleration chip provide powerful hardware support for media playback. Through software upgrade, you can theoretically support any media. format. The solution of this scheme is to implement an index table class in the player, and register it into the index table as a separate class according to the newly added coding format in the future. The linux-based c++ decoding class source code can be downloaded from the online open source decoder website. The decoding of MP1, MP2, MP3 and WAV in the system is implemented by this method.

Playback module implementation

File input
In the player system, there are two kinds of files: they are played by the network card after being read into the memory or written to the memory through other data transmission channels, and played directly in the memory. The sophia board provides the driver module for the NIC. It can be dynamically loaded using the modprobe usbcore and modprobe usbwlnc commands to provide a full-duplex channel for data from the NIC to the playback process via the operating system. The processing of the data is done by the stream input class in the player.

Streaming media protocol
There are two ways to implement streaming: real-time streaming and sequential streaming. The system uses real-time streaming and requires a standardized streaming protocol to ensure communication between the client and the dedicated streaming server. According to the functions of the streaming media protocol, it can be divided into two categories:

Basic network protocol
Provide basic network service support for media transmission. Because TCP requires more overhead, it is not suitable for transmitting real-time data. In the implementation of streaming, RTSP/TCP is used to transmit control information, and RTP/UDP is used to transmit real-time sound and image data.

Transfer Protocol
The transport protocol includes RTP, RTCP, RTSP and RSVP. RTP and RTCP control the transmission of end-to-end network data. RTSP provides voice control. RSVP is optional. It applies for a part of network resources on the network for the playback process. Bandwidth), to a certain extent, provides special quality of service QoS for the transmission of streaming media over the Internet. The protocol stack designed for streaming media is shown in Figure 3. The packet obtained from the UDP/TCP layer is processed to obtain a packed RTP data stream, and the timing and synchronization information and the serial number of the packet are separated by the RTP/RTCP/RTSP layer. The read stream file is handed over to the ASF and RM decoding modules.


Media playback
The player is based on free software mplayer, and the processing flow is shown in Figure 4:

1) If the data is obtained from the network card, call the stream input module for processing. The Stream input module communicates with the multimedia server according to the streaming media protocol, and the input stream data is put into the buffer pool and decompressed by ASF or RM according to the format of the stream file;

2) The decompressed file looks up the index table according to the type of the file. Calls different decoding classes to convert the data into a unified intermediate format raw, and generates the corresponding file, which is played by the player main function. If the file has been saved in memory, you can skip the first step and go directly to the second step.

summary

This paper proposes an implementation scheme of streaming media player system based on Intel PXA270 embedded microprocessor and embedded Linux. The unique index table structure enables the player to add new encoding format through software upgrade. The implementation of pure software is greatly reduced. The development cycle. After testing, the system has a frame loss rate of 5% for CIF (352×288) video format, QCIF (176×144) video format and audio format under the condition of bandwidth 50Kb/s to 100Kb/s and buffer 256k. In the following, the playback is smooth, which satisfies the requirements of embedded streaming video playback in the current vehicle terminal.

references:

[1]. MP1 datasheet http://
[2]. MP2 datasheet http://


:
0 times
Window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": " 0", "bdSize": "24" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "Share to:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren" , "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share. Baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

Dvi Cable

Dvi Cable,Dvi Fiber Optic Extender,Hdmi Bluetooth Adapter

Ningbo Aurich Electronics Co.,Ltd , http://www.powercordset.com

Posted on