Research on Home Video Server Based on ARM

Publisher:ShuangfeiLatest update time:2011-06-29 Keywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
With the continuous progress and development of science and technology, people have put forward higher requirements for the quality of life. As a new body, home network is getting closer and closer to people's lives. It joins the family unit as a node into the big family of the network. Among them, the home gateway, as a bridge connecting the home and the Internet, plays a pivotal role. The main functions of the embedded gateway are as follows:
Remote control: customers can access the server of the home network through the browser of any PC connected to the Internet; the status of the equipment in the home network will be displayed in the client's browser in the form of HTML files; customers can realize remote control of the equipment in the home network by clicking on the corresponding equipment on the HTML page, and the result of the operation will also refresh the client's browser in the form of HTML pages.
Remote monitoring: customers can access the server of the home network through the browser of any PC connected to the Internet, and realize the automatic download of video tools and automatic playback of the required video files by clicking the control button on the HTML page, so as to display the video information of multiple cameras.
Remote maintenance: when the background database of HomeNetServer needs to be maintained, or the HTML description file of the equipment in the home network is updated, or even the network management system of the system needs to be upgraded to a new version, the administrator can remotely maintain and update the server in the home network through the Internet.
Based on these basic requirements and the limited resources of the embedded system itself, the system selected the S3C4510 chip and expanded its peripheral circuits as shown in Figure 1:

Figure 1 Peripheral expansion circuit block diagram

Among them: Flash/ROM is used to store the embedded operating system, HTTP server, CGI gateway program, home network server and file system required for various services in the home gateway. The entire home gateway software platform is stored in Flash. When the system starts, the Bootloader will be run from Flash, the operating system will be decompressed and moved into SDRAM.
Ethernet: S3C4510 has an integrated network control interface and provides a DMA channel dedicated to network communication. Through the Ethernet module, S3C4510 can connect to the Internet. The Ethernet module completes the isolation of the chip from the network and the transmission and reception of data.
System: Other peripheral circuits required by S3C4510 include: power supply circuit, external clock (50MHZ) circuit, switch and reset circuit and JTAG debugging interface circuit.
The embedded operating system selected is uClinux operating system, which is specially designed for processors without MMU. The system mostly uses Romfs file system, which is a relatively simple file system that takes up less space. Under UCLINUX, there are three main WEB servers: httpd, thttpd and boa. httpd is the simplest WBE server with simple functions and does not support authentication and CGI. Both thttpd and boa support authentication and CGI and are rich in functions. Among them, boa1 is a single-task http server with open source code, high performance and less system resource occupation. When receiving a request, the boa server does not start multiple service processes to handle multiple requests, but processes all service requests in one process. For CGI programs, a new process will be generated to handle them. Considering the limited resources of the embedded system itself and the limited number of processes of the home gateway, the system chooses the boa server in the uCLinux system.
Since the current uCLinux does not support dynamic web page technologies such as ASP and PHP, the CGI2 technology is used to connect WEB pages and local programs under uCLinux to provide dynamic and interactive features.

Figure 2 System overall design diagram
1 Configure boa server
CGI program can not run smoothly just by putting it on the server. If you want it to run smoothly on the server and accurately process user requests, you must make necessary settings on the server used.
Boa configuration file boa.conf: boa is configured in boa.conf. Most of these configurations use default values. In this system, the root of the WEB server specified by Document Root is changed to /boas.
When configuring the kernel, select boa program and cgi.
Overwrite cgi.c and makefile in the cgi_generic folder to /usr/cgi_generic/ in the program package.
Overwrite hash.c in the boa folder to /usr/boa/src in the program package.
Overwrite the rc file to /vendor/Miectek/4510 in the program package.
The files in the ucLinux system in this system use ROMFS and EXT2 running in RAM. In order to update the web page through tools such as FTP, the rc file creates a folder cgi_bin under /boas, then copies index.html, boa.conf and mine.type to /boas, and copies the CGI program to /boas/cgi_bin. So far, the basic environment for boa operation has been established. You can run boa using the command ">boa c/boas/&".
2 System Design Description
In the design of the embedded gateway, the gateway program and the HTTP server of the home network and the internal server of the home network are located on the same physical device (based on the hardware platform of S3C4510), which is responsible for connecting the HTTP server with the background database and completing the information exchange between the HTTP server and HomeNetServer.
In the design of the home gateway, according to the functional description, the gateway should be able to provide remote monitoring, remote control, and remote maintenance functions. The internal workflow of the gateway is as follows:
● If the HTTP request sent by the client is received and parsed by the HTTP server, and it is learned that the device status information is required, the HTTP server takes the device status from the static file storing the device status information, and encapsulates it into an HTTP response message and sends it back to the client.
● If the HTTP request sent by the client is received and parsed by the HTTP server, and it is found that the requested message is for the setting (operation) of the device, the CGI function will convert the message content into the home network protocol and pass it to the home network server, which will manage and control the internal devices in the home, and pass the processing results in the form of messages to the CGI program, which will be encapsulated in the form of HTTP response messages and sent back to the client.
● If the HTTP request sent by the client is received and parsed by the HTTP server, and it is found that the requested page is to provide real-time video services, the HTTP server will call the CGI function to send a message to the video data processing module, and control the video compression card through the video data processing module to complete the functions of video data acquisition, compression and transmission.
● If the HTTP request sent by the client is received and parsed by the HTTP server, and it is found that the request message contains control commands for the pan-tilt device and lens, the HTTP server will directly send control instructions to the pan-tilt decoder through the CGI function to control the pan-tilt and lens.


Figure 3: Home gateway software structure diagram


3 Design of real-time video transmission
The HTTP-based boa server is responsible for receiving and responding to HTTP requests from the client. When the request is for video information, this request sends a message to the video data processing module through the CGI function, thereby sending an event to the video device to allow the real-time video sending task to enter the running queue. The
video data processing module mainly includes real-time capture of video images (completed with the help of MPEG-4 video compression card), dynamic storage and real-time playback. The real-time playback of images can be carried out simultaneously with the real-time capture and storage of images.
Initialize the video compression card:
M878Object*pObject=NULL;
For(int i=0;i {pObject=new M878Object(i,m_strDisk+m_str VideoDir);
If(!pObjectGetDataFormFile())
pObject->InitData();
m_obArray.Add(pObject);
}
Data acquisition:
for(i=0;i {
OpenDev(i); //Open the device with the specified card number and allocate corresponding system resources
pObject=(M878Object*)m_obArray[i];
OutMpegBuff(i,OnMpeg4Write); //Collect video data stream
RegisterViSaveExceptionProc(i,(ViSaveErrCallBack) ViErrCallBack);
pObject->SetParamToDevice(); //Set parameters
}
Stop device:
When the device is no longer used, call ViUnInit() to shut down the video compression capture card and unload system resources.
Data sending module:
OutMpegBuff(i, OnMpeg4Write);
Void CALLBACK OnMpge4Write(DWORD dwCard, BYTE *pbuff, DWORD dwSize,
BOOL isKeyFrom)
{
if(dwCard>=g_dwDevice)
return;
g_VStrmInfo[dwCard]+=dwSize/26;
MTAWriteVideo((BYTE)dwCard, pbuff, (LONG)dwSize, isKeyFrm)
}
The sending module is responsible for sending the encoded real-time video data to the address in the address table and modifying the information in the address table. The address table is used to save the IP address of the user requesting real-time video service. The video sending task sends the video packet according to the address in the address table.
Data receiving module:
This module mainly completes the reception, decoding and display of video data. Users monitor remote devices through browsers, and the information returned by the server is displayed through browsers. The browser can be Microsoft's Internet Explorer or Netscape's Netscape Navigator. Ordinary browsers can display ordinary text and pictures in GIF, JPEG and other formats supported by HTML files. However, for real-time video data, first of all, unlike HTTP links, it is received using datagram sockets instead of stream sockets, and then it needs to be decoded and displayed, which cannot be done by browsers. In order to enable users to watch videos through browsers, this system uses ActiveX controls embedded in WEB pages, and the ActiveX controls complete the reception, decoding and display of video data. An important aspect of ActiveX Internet technology is the safe downloading and installation of ActiveX controls and required supporting files. Microsoft Internet Explore automatically downloads and installs ActiveX controls by using the Internet Component Download method in HTML documents3.
(1) Embedding of client controls
Embed ActiveX properties in the HTML file of the WEB server. For the IE browser that is most commonly used by clients, the MFCControl control that can be used in the HTML code is as follows:


VideoPage



ID=〝Mpge4Control 〞
WIDTH=100
HEIGHT=51
CLASSID=CLSID:A119846-2E75-11D0-BDB2-000000000000〞
CODEBASE=http://www.myhome.com/videodisplay/MFCControl.ocx>#Version=1,0,0,1>





The ID tag names the control and provides the HTML code to access the control. The CLASSID tag is a unique UUID that assigns a value to the control, telling IE which object to load. To achieve automatic download of controls in HTML pages, use the CODEBASE attribute of the tag, which tells IE which version of the control to download and install and the address to find and download the control and its supporting files.
(2) Registration of client controls
After the control is written, it needs to be registered on the client side, and the information about the control is recorded in the registry. After the client receives the HTML page with the control embedded in it from the server side, it will use the corresponding space in the registry to complete the reception, decoding and display according to the information in the OBJECT tag.
4 Design of remote control part
In the design of the remote control part, based on performance optimization and real-time considerations, the control part is divided into two parts: the pan-tilt control part, which mainly communicates through the serial port; the information appliance remote control, which controls the corresponding equipment through the internal home network protocol, and the physical carrier of the control signal is the internal bus of the home network. (Due to limited space, this article only discusses the former).
Design of pan-tilt control module
This module is a relatively independent module, responsible for controlling the up, down, left, and right rotation of the pan-tilt and the adjustment of the focal length and aperture of the lens. When the request received by the server contains control commands for the pan-tilt device and the lens, it will send control instructions to the pan-tilt decoder through the CGI function to realize the control of the pan-tilt and the lens. Indoors, CDA2000 indoor universal decoder 4 is used to communicate directly with the embedded gateway through the RS-232 serial port. The pan/tilt control voltage is optional: ~24V, ~220V, and the lens control voltage can be adjusted steplessly between 5V-12V.

Figure 4 PTZ control system hardware connection diagram


In the cloud mirror control module, the decoder plays a core role. The main problem to be solved in designing the cloud mirror control module is to encode various operations such as up and down rotation, lens focusing, etc. However, the decoder used in this system encapsulates the writing of the underlying hardware program, so the work done is to use the protocol provided by the decoder developer to send instructions to the decoder through the RS232 serial port.
Linux operates the serial port through device files. You only need to open the corresponding serial port file, and then call the device-related functions to open the serial port (open()), set the serial port parameters (tcgetattr(), cfsetispeed(), cfsetospeed()), set the input and output mode (options.c_Iflag and options.c_Oflag), restore the serial port properties, and close the serial port (close()).

Figure 5 Serial communication process


5 Conclusion
The characteristic of this system is to provide video services to customers based on the limited system resources of embedded microprocessors. This system adopts the mode of "boa server + CGI + home network server" to realize the control of information appliances, but due to limited space, it will not be discussed. In view of the particularity of real-time video services, the mode of "boa server + CGI + video receiving and control module (video server)" is adopted to realize the capture, collection, and transmission of video data, and directly control the pan/tilt and lens through serial port communication. The problem of video reception has always been the focus of research. This system adopts the method of embedding ActiveX controls in WEB pages, and the ActiveX controls complete the reception, decoding and display of video data. The advantage of this is that the automatic download of controls and real-time playback of video files can be completed without any settings on the client.

Keywords:ARM Reference address:Research on Home Video Server Based on ARM

Previous article:LCD programming design based on ARM processor
Next article:Research on DVB-S2 Set-Top Box Solution Based on ARM9

Recommended ReadingLatest update time:2024-11-16 19:37

Modify the IP address of the arm development board
To modify the IP of the arm development board, if it is a yaffs2 file, you can 1. First, modify the /etc/init.d/rcS file in /sbin/ifconfig lo 127.0.0.0 Add a line /sbin/ifconfig eth0 192.168.1.20 up Note: 192.168.1.20 is just an example, you can change it to the IP address you want to modify It should work after thi
[Microcontroller]
Embedded ARM learning summary (VI) --S3C2440 system architecture learning summary
Platform introduction: mini2440 development board, S3c2440 main chip hardware information 1.130 IO ports, 289 pins 17*17, BGA package 2. Power supply Core: 1.25v Memory power supply: 1.8V GPIO: 3.3v 3. There is 4K bytes of SRAM space 0x40000000-0x40001000 inside the chip; 4.s3c2440 external Main frequency: 12M cryst
[Microcontroller]
How to define addresses using structures in header files of ARM microcontrollers
Below we use the header file lpc11xx.h of the ARM Cortex-M0 core microcontroller LPC1114 to illustrate. 1. A few words first The lpc11xx.h file is the header file included in the lpc11xx series of microcontrollers. The function of this file is the same as the reg51.h header file in the 51 microcontroller, both of whic
[Microcontroller]
How to define addresses using structures in header files of ARM microcontrollers
Synopsys and Arm continue to deepen cooperation to accelerate custom chip design for advanced nodes
The world's leading Synopsys IP solutions and AI-driven EDA comprehensive solutions are combined with "Arm comprehensive design" to significantly accelerate the time to market of complex SoC designs. Summary: Synopsys joins the "Arm Total Design" ecosystem and provides IP and chip design services, lowering the en
[Semiconductor design/manufacturing]
arm-linux-ld command
We compile each c or assembly file separately, but do not link them, and generate many .o files. These .o files are scattered first, and we must first consider how to combine them; secondly, these .o files have a call relationship with each other; thirdly, the bin file we finally generate is to run in the hardware, and
[Microcontroller]
The first 7-nanometer automotive chip R&D team moved into the "China Auto Capital"
"Lightweight, electrification, intelligence, networking, and sharing" are profoundly changing the product form and technical architecture, manufacturing process and service mode, industrial chain and value chain, consumption and usage pattern of traditional automobiles, making automobiles move from the "functional" er
[Automotive Electronics]
The first 7-nanometer automotive chip R&D team moved into the
Teaching Embedded Systems with the NI LabVIEW Embedded Module for ARM
  Through a series of laboratory practice courses and team projects for robot development, students from the School of Electronic Engineering and Computer Science are attracted to actively participate in embedded system design.   The Solution:   Using the NI LabVIEW Embedded Module for ARM microcontrollers to progra
[Test Measurement]
Teaching Embedded Systems with the NI LabVIEW Embedded Module for ARM
Learn ARM development(9)
Last time, I finished reading the boot assembly and prepared the C operating environment. Now I will start to learn the C source code and jump from the start.S file to the file lib_arm/board.c to run. /* The boot program jumps from the assembly start.S to here to execute. Cai Junsheng 2005/07/19
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号