http://www.jollen.org/linux/video_Streaming/streaming-6.html
Linux Application - Video streaming (6) Chen Junhong www.jollen.org will be the end of our series of video streaming columns, the most important task of this issue, of course, is inevitable to be systematic, and then The application of Video Streaming is a brief introduction to the theory that is most discussed. Video Streaming System Overview A complete video streaming system should contain four parts:
Content (such as images, sounds, Coded materials) Server Client Data NetWork (such as Internet, or any media of any connection Server-Client) So do we have those in this series of video streaming themes? From the beginning of the name, the image capture, the RTP communication protocol, we will focus on Contente and Data NetWork. Of course, our series of themes are "Linux applications", the most critical place is how to design image capture in the Linux environment. For Data NetWork, some of the key topics of Video Streaming are also described with Linux, but also introduced this set of JRTPLIBs to everyone, and the part underneath will also add nsync to Toolkit. The Server side seems to be a place where we are ink, but it doesn't matter. In this last article, we have added a supplement in the theoretical aspects, we will face the topic facing the practice in practice with video conferencing. Make a solution, including: Solid storage of multimedia materials, OS-EDF, to do your search for your search. In Client, we demonstrate how to take advantage of SDL on the screen in the final full version of the model. Here, the MMAP extracted method described here will also be combined to fill the image data into the SDL DISPLAY structure. Video Streaming We have introduced it in the beginning, Video streaming is a technology that is discharged from the audio file via the Internet. Video "streaming" basic concept is "Download one side", we call "Play As Received" . If you want to watch a movie file of the remote server, the most primitive is "Download, then dial", which is to download the entire file to the local end via FTP or HTTP, and then use the dial program to use the dial. We call it "Play After Download". For the simplest case, you may want to listen to the content of music before downloading MP3, and the way to download the music piece is not friendly. If you use the video streaming technology to let your netizens audio, not only convenient, not to waste Time to download the music you don't like. In addition, everyone is most familiar to playing the real player of the movie on an instant online. Real Video Product Introduction Real Video is the product of Real Networks, REAL VIDEO mainly supports the functionality of Video-On-Demand * 1. Real video allows us to play stream images (streaming video) via our website. Since our ultimate goal is to make a soft video streaming software, we will be asked as a marking in REAL VIDEO, and designed video streaming software based on Linux. There are several sets of open original code software that is worthwhile to play. We have also mentioned on the other classic STREAMIN. Vic and Videolan are absolutely excellent teaching examples. VIC VIC is also a software belonging to Open Source. VIC is full named video conferencing, so the name is the soft body of a video conference. VIC is developed by the NetWork Research Group from Berka University, California.
VIC is considerable to study the Open Source software for VIDEO streaming, mainly because VIC has almost contained video streaming related technologies. VIC is worth our research because VIC supports the features listed below: IPv6 uses Video4Linux image capturing function H261, H263 and H263 CODEC Software JPEG and BVC Code RAW YUV Packetiser / CODEC RTIP / RTP Communication Agreement THE IP MULTICAST Backbone (MBONE) Support Video4Linux Mmap These features have almost included the techniques you should have, based on these features, VIC's original program code is quite attractive, so it is intentional to study the programer code of VIDEO Streaming should read the original code of Vic. . VideoLeolan VideoLan is a software that can make MPEG and DVD spread (Broadcast) playback, and Videolan is divided into two parts, one is VLAN Server, and the other is the VLC user playback program. VLAN Server uses the MPEG image with the Broadcast to spread to the area network, and the user receives the package and played with the VLC. The advantage of this is to reduce the revived I / O action, and VLAN Server has expanded the image, and the user on the area network will use the VLC to receive the package and play. VideoLAN support X11, SDL, Linux Framebuffer, GGI, Beos API, Macos X API playback mode, and supports DVD and AC3 (Dolby Sound Effect). Image Coding Technology Introduction (CODED) Currently, the academic community has developed a number of technologies (CODECs) for processing image signal compression and encoding, talking about these technologies, the most widely used coding standards below:
H.261 H.263 JPEG, MJPEG MPEG This article is to make a brief introduction to these four coding technologies. Data NetWork's Technical Topics Video is doing streaming, there are three ways to apply: Broadcasting, Unicasting, Multicasting. The way Broadcasting is relatively simple. He lifted one of the image packets directly on the LAN (Server), and then retrieved the package on the Internet from the Internet. However, there are still many problems that need to be considered on the hardware layer of the network, such as when the Shared Non-Switch Enthernet is on the Shared Non-Switch Enthernet. All Unicasting and Multicasting are also a transmission mode that belongs to IP. Unicasting takes 1 pair of direction transmitted images to the distal end, called video-on-demand (VOD), Multicasting is a 1-to-many transmission mode, called Near-Video-On-Demand (NVOD). Future IPv6 will support IP Multicasting, so Video Streaming will be more extensive. In terms of communication agreement, we also introduced RTP. RTP is fully named Real-Time Protocol, RTP plus 10 BYTES's packet before the UDP package, which records information such as time, serial number, compression type. RTP is the communication agreement currently used by most video streaming software. RTP can be used to do streaming for a variety of different multimedia formats, because we break the image into several RTP packets and then transfer, therefore will encounter problems that many network technologies often encounter. For example, because the package delivery time is different, it is not smooth when playback, and therefore, it is necessary to use a buffer (playout buffer) to temporarily store and process the package accepted on the network. The image packet received by the Internet is different due to the time interval arriving at each other (Synchronous Data Packets), so the buffer must be buffered to make these packets to make the time interval between each other (Isochronous Data Packets). Other important communication agreements are SIP, or FEC (Forward Error Correction), which is the topic of research. Image capture card design image capture under Linux, of course, must be equipped with a suitable image capture card. We have introduced to everyone is Osprey 100 this image capture card. Osprey 100 is recommended by Real Networks, a video capturing card, with its products, with Osprey 100 and RealNetworks products. We can use Broadcast or ON-Demand to achieve live broadcast (Live) features. Osprey 100 can support 30 screens per second (FPS - Frame Per Second) on hardware and support NTSC and PAL input. However, in practice, the author does not use Osprey 100. The image capture card used by the author is that this card is more than "custom" card, but it is also good because it is easy to install on Linux. Taking this card as an example, use the BrookTree Corporation card, so as long as the BTTV module is installed, the BTTV module will also use I2C-Old and VideoDev two modules under Linux Kernel 2.2.17. Therefore, it is also necessary to install it.
Under the command, install these three modules command to: Linux # Insmod I2c-oldlinux # Insmod VideoDevlinux # Insmod BTTV
Of course, you have to determine that Linux Kernel has the support of these three modules, and then add these three modules to /etc/modules.conf (Red Hat 7.0). The modules to be installed different versions are not necessarily the same! Please also note that such as the I2C-related module is. The image captured card available on Linux is in http://www.linhardware.com/db/searchproduct.cgi?_catid=17 webpage you can find a few images captured in Linux. The more popular image capture card on Linux is Hauppauge, and the author is also the card of Hauppauge. You can find the next six cards on the Linhardware website:
Hauppauge 401 WinTV-radio dbx-TV stereo Hauppauge WinTV PCI TV Card Hauppauge WinTV-GO PCI TV Card Hauppauge WinTV-PCI Hauppauge Hauppauge WinTV-Radio NICAM Hauppauge WinTV / PCI TV Card Chinese documents on Linux for video capture card support ( HOWTO can get on the CLDP website:
http://www.linux.org.tw/cldp/hardware-howto-22.html
Most image capturing cards supported by image capturing cards will have a set of video input terminals, the S-VIDEO (Y / C) terminal or the Composite terminal. The standard in Taiwan is of course NTSC system. In general, we want an image capturing card to support more video systems, including: NTSC / PAL / PALN / PLAM / SecAM. The video device that can be used has a relatively common CCD, or the home V8, Hi8 can be used. In general, we also hope that an image capturing card can receive more video devices. BT 878 wafer follows the subject matter after the image capturing card is of course the introduction of BT878 wafers, because support BT 8x8 wafer's BTTV trick is our design image to capture the nuclear power of the software! At present, most of the digital image capturing cards are captured by the BT878 single wafer for the image. The BT878 mode of operation is to perform image decompression in software. The BT878 wafer is responsible for posing the image to Linux to do image processing, and BTTV is the BT878 wafer trigger of Linux Kernel. Since the image is used to make an image processing after being captured by the BT878, it will naturally be a difference in processing performance. If it is transmitted via a network, we will use the image compression technology (H.261 / H.263 ..., etc.) to do image processing. What is BTTV BTTV is the triumph of BT848 / 849/878/879 wafer on Linux, and the main function is the interception of the page frame (Frame Grabber). BTTV is an important trunk program in video4linux, which is currently divided into two versions:
0.8.x Development Version 0.7.x Stable Version BTTV Related App Software - XAWTV Official Website: http://bytesex.org/xawtv/index.html Installation:
Linux # ./configure linux # make dependlinux # Makelinux # make install
If you have the Red Hat Linux 7.1 PowerTools CD, you can also install the XAWTV kit directly from the PowerTools CD:
Linux # rpm -ivh xawtv-3.34-1.i386.rpm
Installing XAWTV Requires Libjpeg and Libjpeg-Devel Kit, if you use Red Hat Linux 7.1, you should install two kits: libjpeg-6b-15.i386.rpm (DISC 1) libjpeg-devel-6b-15.i386. RPM (DISC 2) XAWTV The entire architecture can be divided into 7 parts as follows:
XAWTV: Optical part. FBTV: The TV application of Linux Console mode, using Linux Kernel 2.2.x FrameBuffer. Set-TV: The tool for command column mode is used to set the parameters of Video4Linux. STREAMER: The tool for command column mode is used to capture motion pictures and avi images. Radio: RADIO application. Webcam: Uploaded the image to the web server side to design a tool for Web instant images in FTP. Alevtd: web server for VideText Pages. Xawtv's video4linux XawTV is a very good textbook for video4linux, and we will recommend the reader to study the original code of the XAWTV's video4linux part. After the original program code of the XAWTV will be removed, you can see the file of GRAB-V4L.C in the libng / directory, and there is a file of GRAB-V4L2.c, which is the version of Video4Linux2 (Version 2). Before the XAWTV's video4linux theme, we introduced the basic design method of Video4Linux, followed by XAWTV, and further explained the classic - MMAP capture skills of Video4Linux after XAWTV. So the one of the three-phase contents is complete? In fact, there is no, but please rest assured, this issue we will list all the programs that we have introduced, of course, the complete actual code! Video4Linux uses the device files related to Video4Linux with the Video4Linux using it:
/ Dev / video Video Capture Interface / dev / radio AM / FM Radio Devices / dev / vtx Teletext Interface Chips / dev / vbi Raw VBI Data (Intercast / teletext) video4linux programmer and image capture in addition to providing related API, but also support Other radio devices. Next, introduce the video4linux design, the Linux Kernel version used is 2.2.16. This article will briefly introduce the way to active Video4Linux, so please prepare the Documentation / V4L / API.html file under the original code of Linux Kernel and learn what's video4linux. Video Streaming Other Key Topics The next theme will introduce you other topics worthy of research, and we will finally raise the reason because these topics will not affect our previous program, but in design full video When a streaming system, it is necessary to consider it. The importance of Video Conferencing Application Video Conferencing is important in multimedia design, the most important reason is because Video Conferencing 渉 and the technical topics include:
The problem of the real-time systems problem, the problem of Latency and THROUGHPUT issues, of course, first, on the issue of network bandwidth, due to a large number of frequencies, but also network The quality of the video conference is also susceptible to the quality and frequency of the network, so this is one of the issues worthy of our research. Video Conferencing Another charming place is to provide a good Person-to-Person environment in Video Conferencing. Video Conferencing Application Software is designed in multimedia, and is often considered one of the "killer" applications. It can be seen that the importance of Video Conferencing applications. Video Conferencing Applications Video Conferencing current application fields are: Distance Learning Systems, Remote Consultation Systems, Games ... and more. Just as we have previously told, solve the network, and the transmission problem is the key to the next generation of communication applications. The same is true in the support of the software, of course, many solutions are to design a new multimedia Operating Systems to resolve. Because we want to implement the technical technology, it will involve the topic of the network, so the level to consider will be more. In addition to online related issues, it will also discuss all other major big problems. Video streaming The first question encountered by Video Conferen is how to deliver (Video Streams), which is to take into account the management of streams, and Internet Internet (Real-Time) Over the Internet problem. One of the important cries of Video Conferencing is how to effectively shorten the latency. So we must also look for an effective and convenient to adapt to a wide range of different network-wide environments. Video Streaming Information Storage Questions The problem with the application is also the problem to consider is the selection of the Storage device (STORAGE). Video streaming applications must have a good storage environment to store multimedia data of various types, including: text, images, sounds, pictures, etc., each data is different. Filesystem is also one of the management of multimedia objects, which must have a file system that can quickly access and effectively manage multimedia objects to meet the needs of performance. The monitor of the working system is stored at this stage Video Streaming to the design of the multimedia application, and the disk schedule for OS support is also included in the project we consider research. Traditionally, we will choose the SCAN or SSTF algorithm when we design OS, but these traditional disk scheduling algorithms cannot meet our needs. The more advanced disk scheduling algorithms should take into account the application of VIDEO and AUDIO, and currently more commonly selected to design the MultiMedia I / O system is the SCAN-EDF algorithm. The SCAN-EDF calculation is a solution that combines SCAN and EDF, SCAN is a well-known Seek Optimizing disk scaff algorithm; the EDF (Earliest Deadline First) is a REAL-TIME SCHEDULING algorithm. The impact of the disk scheduling for the VIDEO streaming application introduces the importance of the SCAN-EDF disk scanning algorithm that we must support Real-Time Request, the scope of its influence includes:
Maximum allowable streams reponse time scan-edf has been analyzed and confirmed to improve the above performance, then for the current popular Linux, because SCAN-EDF has already been within the scope of the actual application, we can SCAN-EDF disk scaffinal algorithm is added to Linux Kernel. As a result, Linux is also an important efficient improvement in the video streaming application. Video Conferencing Synchronization Problem When we do multiple (N-Way) video conference, the program will not allow each person to see the image screens! Even if you can't really do the same time for each person, it is also possible to control within a reasonable acceptable range. Synchronization (Synchronization) Problem is mainly in building interactive multimedia applications, synchronous problems need to be quite more time and spirit, so there is currently a heavyweight Toolkit for us, that is Nsync (in-sync). Nsync has a total of two parts: Synchronization definition language run-time presentation management system System, of course, our video conferencing application can also need nsync's help! Under the program, we will supplement two simple functions for readers. This two functions are not directly related to our paradigm, but may have the opportunity to use when testing:
JPEG.C: The captured image data is used to store the JPEG file with libJPEG. PPM.c: Write the captured image into a PPM file.
Some files in JPEG: JPEG.H / ** JOTV - Video streaming systems * (c) 2001 jollen line_length) jpeg_write_scanlines (& jcfg, & line, 1); jpeg_finish_compress (& jcfg); jpeg_destroy_compress (& jcfg); fclose (fp); return 0;} calling method functions as follows, added directly to the sample of the main program was to: write_jpeg ( " JOTV.JPG ", IMG, Default_Width, default_height, 75, false / * not grey * /); winning the bid = PPM file partial file: ppm.c / ** jotv - Video streaming systems ** ppm.c - Output image to the ppm file * (c) 2001 jollen