Introduction Video surveillance systems based on coaxial cables are complex in structure, have poor stability, low reliability, and are expensive. Therefore, remote web-based video surveillance systems such as embedded network cameras have emerged. This embedded network camera uses a high-performance ARM9 chip as its microprocessor and incorporates an embedded web server—Boa. It acquires camera video data through an embedded multi-tasking operating system—Linux. The video signal acquired by the camera is digitized and compressed using the MJPEG algorithm. The compressed video stream is then sent to the built-in web server via an internal bus. By embedding an image player in a webpage, users can directly view the camera images on the web server through a browser. Through the universal gateway interface (CGI), authorized users can also control the camera, pan/tilt unit, and lens, or directly configure the system via the web. 1. Embedded Network Camera System Principle and Composition The basic principle of the embedded network camera: The embedded Linux operating system incorporates the web server Boa. The camera acquires video signals, digitizes them, compresses them using MJPEG, and transmits them to the built-in web server. The video information is then published to the Internet through a web page. Because the embedded network camera is a fusion of a video acquisition terminal and a web server, users can directly view the video images captured by the camera through a browser, achieving the purpose of remote monitoring. The entire system consists of five parts: a video acquisition module, a video compression module, a web server, a universal gateway interface, and a web page. Its hardware structure is shown in Figure 1: [Figure 1: Embedded Network Camera Hardware Structure Diagram] The video acquisition module includes a central control and data processing center based on the S3C2410X, and a USB camera data acquisition unit. The central control and data processing center mainly controls the video acquisition terminal and compresses video images; the web server performs basic server functions, responding to HTTP requests and cooperating with the video acquisition and compression modules to publish image information; the universal gateway interface—CGI—can control the camera, pan/tilt unit, and lens based on user-input data or directly configure the system via the web. The embedded microprocessor is the "core" of the embedded system. The choice of microprocessor will have a decisive impact on the cost and performance of the entire embedded system. Currently, popular processors include PowerPC, MIPS, Intel, and ARM. ARM (Advanced RISC Machines) is a leading global provider of embedded microprocessor IP (Intellectual Property) cores. It designs a series of high-performance, low-power, low-cost, and high-reliability RISC processor cores, peripherals, and system-on-a-chip (SoC) application solutions. Currently, ARM microprocessor cores are widely used in embedded system solutions such as portable communication devices, handheld terminals, and multimedia digital consumer products. This design uses the S3C2410X 32-bit microprocessor based on the ARM920T core. This processor integrates a wealth of resources including an LCD controller, USB Host, USB Slave, NAND controller, interrupt control, power control, UART, SPI, SDI/MMC, IIS, GPIO, RTC, TIMER/PWM, and ADC. The operating system is the "soft core" of an embedded system. Early embedded systems, lacking the concept of an operating system, implemented their main functions in assembly language, resulting in poor compatibility, versatility, and scalability. With continuous improvements in hardware performance, the use of general-purpose operating systems in embedded systems has become a reality. After introducing an operating system into an embedded system, the development efficiency and resource reusability of the embedded system will be greatly improved by using the ideas of software engineering to guide the development of the embedded system. Currently popular embedded operating systems include VxWorks, Neculeus, Windows CE, and Linux. Compared with other commercial operating systems, Linux, an open-source network operating system, has the following unique advantages: (1) Low price. Under the premise of ensuring product performance, price is always one of the reusability factors that must be considered when designing a system. Since Linux comes from the open-source community, its price is almost zero compared with other commercial operating systems. (2) Rich documentation. Linux programmers all over the world are technical consultants, and anyone can get the documentation and help needed for their system from the open-source community. (3) Excellent network performance. Linux, which is in line with Unix, supports a variety of network protocols and can make the system run stably for a long time. (4) Knowledge innovation. Among domestic operating systems, embedded operating systems are considered to be the only operating systems that can catch up with foreign counterparts. Linux is a leader among operating systems. Anyone can release products containing their own intellectual property rights in accordance with the GPL rules, which can efficiently carry out knowledge innovation and avoid detours. Therefore, this design uses a high-performance ARM9 chip and an embedded Linux operating system. 2. Video Acquisition Module Design and Implementation The video acquisition module is one of the core modules of an embedded network camera. It completes video capture by scheduling V4L (video4linux) and the image device driver through the embedded Linux operating system. V4L is the foundation of Linux imaging systems and embedded imaging. It is a set of APIs in the Linux kernel that support image devices. With appropriate video capture cards and drivers, V4L can implement functions such as image acquisition, AM/FM radio broadcasting, image CODEC, and channel switching. Currently, V4L is mainly used in video streaming systems and embedded imaging systems, with a wide range of applications, such as distance learning, telemedicine, video conferencing, video surveillance, and videophones. V4L has a two-layer architecture, with the V4L driver at the top and the image device driver at the bottom. In the Linux operating system, external devices are treated as device files; therefore, operations on external devices are transformed into operations on device files. The video device file is located in the /dev/ directory, typically named video0. Once the camera is connected to the video capture terminal via a USB interface, video data acquisition can be achieved by calling V4L APIs to read the device file video0 in the program. The main process is as follows: 1) Open the device file: `int v4l_open(char *dev, v4l_device *vd) {}` Opens the device file of the image source; 2) Initialize the picture: `int v4l_get_picture(v4l_device *vd) {}` Gets the input image information; 3) Initialize the channel: `int v4l_get_channels(v4l_device *vd) {}` Gets the information of each channel; 4) Set the norm for the channel: `int v4l_set_norm(v4l_device *vd, int norm) {}` Sets the norm for all channels; 5) Device address mapping: `v4l_mmap_init(v4l_device *vd) {}` Returns the address where the image data is stored; 6) Initialize the mmap buffer: `int v4l_get_channels(v4l_device *vd) {}` v4l_grab_init(v4l_device *vd, int width, int height) {}; 7) Video capture synchronization: int v4l_grab_sync(v4l_device *vd) {}; 8) Video capture: int device_grab_frame() {}. Through the above operations, the camera video data can be captured into memory. The captured video data can be saved as a file or compressed and published to the Internet. This design adopts the latter method: compressing the captured video data using MJPEG to generate a video data stream and publishing it to the Internet. 3 Video Compression Module Design Since the amount of video data captured by the camera is large, directly processing it into video would place a heavy burden on video processing and network data transmission. Therefore, this design uses a high-performance ARM9 processor to perform MJPEG compression on the captured data. JPEG (Joint Photographic Experts Group) is an abbreviation for the Joint Photographic Experts Group. Its main goal is to study compression algorithms for images with continuous tones (including grayscale and color images), which is the basis of MJPEG. The JPEG algorithm has been identified as the international standard for static digital image compression. It is not only applicable to still image compression, but also to intra-frame image compression of television image sequences. Since JPEG compression uses the full-color image standard, its main processing steps include: color model conversion, discrete cosine-DCT transform, rearrangement of DCT results, quantization, encoding, etc. MJPEG is an abbreviation for Motion JPEG, which is dynamic JPEG. It combines animation playback with JPEG and uses the JPEG algorithm to compress video signals at a speed of 25 frames/second to complete the compression of dynamic video. 4 Web Server Design In embedded devices with limited resources, lightweight Web Servers that can be used include: httpd, thttpd, boa, etc. This design selects the open-source Boa Web Server that supports CGI. Its main porting process is as follows: (1) Download the latest software package from www.boa.org and decompress it to the relevant directory. (2) Set the default SERVER_ROOT path at the top of the defines.h file under the boa/src directory. (3) Select the cross-compilation tool. Use ./configure --host=i686-pc-Linux-gnu --target=arm-Linux in the boa directory to complete the configuration of boa. (4) After executing make to compile boa, the executable file boa will be generated in the src/ directory. (5) Configure the boa.conf file. Mainly complete the setting of the port number for boa to run, the server root directory, log files, html files, cgi file directories and the read and write temp directory. 5 Communication between browser and server - Common Gateway Interface (CGI) is a standard interface for external application extensions to interact with WWW servers. External extensions written according to the CGI standard can process the data input by the client browser, thereby completing the interaction between the client and the server and realizing dynamic Web technology. In this design, when a user sends control information (such as controlling the camera's pan-tilt-zoom (PTZ) movement through a browser, the server daemon starts the CGI module. The CGI module transmits control commands to the PTZ via a serial port, causing the PTZ to perform the corresponding actions. The flowchart is shown in Figure 2: Figure 2 Flowchart of CGI Controlling PTZ Movement 6 Web Page Design In this embedded network camera, the main function of the web page is to display the web page and dynamic video information. Since standard HTML web pages only have the function of displaying text and images, it is impossible to embed a window within a standard HTML web page to "real-time" view video images. One way to solve this problem is to embed "real-time" video monitoring software into the web page. Microsoft has developed the ActiveX specification, and any software that conforms to this specification can be embedded into a web page. To enable multiple users to simultaneously view video images "real-time," this design uses the standard ActiveX control—VgPlayerObject—to implement this function. 7 Conclusion This paper proposes an embedded network camera design based on ARM S3C2410X and Linux. This paper presents a complete network camera system solution. It utilizes an embedded Linux operating system for video capture and compression, and displays dynamic video via ActiveX controls. The system integrates embedded web server and CGI technology. Because it employs a high-performance embedded processor for main control, compression, and web processing, it boasts advantages such as simple structure, stable performance, and low cost. It has broad application prospects in fields such as real-time video monitoring of oil fields and oil and gas wells, smart communities, and mobile surveillance. The author's innovation lies in the successful application of CGI technology to an embedded network camera, enabling user interaction with the embedded system through a simple method. This network camera has broad application prospects in intelligent and mobile surveillance. References: [1] Cao Xiang. Research on QoS of real-time video transmission in MPLS network [J]. Microcomputer Information, 2006, 7-3: 58-60. [2] Chen Junhong. Embedded Linux Embedded System Principles and Practices [M]. Beijing: China Railway Publishing House, 2004. [3] Yang Daqian et al. Design and Implementation of Embedded Dynamic Web Technology Based on ARM9 and Linux [J]. Industrial Control Computer, 2006, 8.