Streaming MPEG-4 with Linux
Starting from its fourth version, the Darwin Streaming Server does not stream only QuickTime movies but also MPEG-4 ones. The benefit is Darwin Streaming Server is completely free for non-commercial use, and it runs under Linux smoothly with a small load.
To get a copy of the streaming server, go to the Darwin project page. You are required to have a valid APSL (Apple Public Source License) registration in order to download the binary or the source. Follow the instructions on the web site for details on how to obtain an APSL registration. Get the server binary for Linux (the web site shows Red Hat Linux 7.x), and proxy if you need to serve clients behind firewall. Uncompress the package to a local directory and begin the installation:
tar zxvf DarwinStreamingSrvr4.1.2-Linux.tar.gz cd DarwinStreamingSrvr4.1.2-Linux ./Install
Make sure you have Perl installed for the web-based administration interface. Install also Net::SSLeay and OpenSSL with a valid certificate if you want SSL support. The installation script automatically copies the files to suitable places and displays where they are copied to. It then asks you for an administrative user name and password, which is used later to log in to the web-based administration interface, where you can access most of the server's features.
Next, launch the administration interface using the Perl script streamingadminserver.pl. It launches Darwin Streaming Server if it is not already running. Point your favourite browser to the video server's port 1220, 1240 if you enabled SSL support. Log in with the account you set during the installation. As this is your first time logging in, you are presented with the Setup Assistant. It guides you through the basic settings with detailed descriptions for each item. You need a valid SSL certificate to enable SSL support, unless you modify the script. After completing the Setup Assistant, you will have a running Darwin Streaming Server ready to flood the line with MPEG-4 videos.
Now you have an MPEG-4 clip on hand and ready to stream. One option is to stream it over HTTP; simply put the clip in a publicly accessible directory on your web server and point your player to the clip's URL. If you want to stream over RTSP, direct your player to rtsp://<server_name>/<clip_name>. (For example, rtsp://video.wyk.edu.hk/sample_100kbit.mp4 is a sample clip provided by Darwin Streaming Server.) Streaming over RTSP allows random seeking without waiting for the clip to be downloaded progressively.
If you want to create a playlist or make a live broadcast, you would need to create an SDP (session description protocol) file. To create one, log into your video server's administration interface and then go to the Playlists section. Create a new movie playlist and drag the accompanying media to the playlist. Give the playlist a name and a mount point, which is an SDP file. Save the list, and do not forget to start the list afterwards. Instead of pointing your player to the MPEG-4 file, supply the new URL, rtsp://<server_name>/<sdp_name> to receive the broadcast. Congratulate yourself! You have successfully created a streaming MPEG-4 system and your first MPEG-4 video clip.
If you want to stream live video from your capturing device, use mp4live which comes with MPEG4IP. You need a Video4Linux-compatible capturing device, Video4Linux and I2C support in the kernel for live broadcasting. The user interface of mp4live is quite self-explanatory. You can record the video to an MPEG-4 file or stream it to clients with unicasting or multicasting. Click the Generate button to generate an SDP file, and copy it to your video server's media directory.
If you are within a local LAN or enterprise, multicasting would be the best method. In this method (on both QuickTime, Real and gmp4player), you pass the SDP file directly to the program. Set up a web server on the broadcasting machine, then point the player to http://<server machine>/capture.sdp, where capture.sdp is the aforementioned generated SDP file. With unicasting, you would use rtsp://<server machine>/capture.sdp instead. The server machine must be running Darwin Streaming Server, and the result is the streams are unicasted and repeated. This should be used only where multicast is not available.
People who try encoding the video may complain about the video quality. The MPEG-4 codecs used in Windows and Linux are the same, so what is the difference? The key component that determines the ultimate quality of the video is the rate controller. The fact is rate controllers in Linux still need some work. I recommend using the famous VirtualDub (free and licensed under the GPL) if you can, because it is more powerful in video encoding and processing and significantly enhances video quality.
Most people prefer using QuickTime, RealPlayer or Windows Media Player to play streaming video. Starting with version 6, QuickTime has built-in support for MPEG-4, so what you need to do is upgrade your QuickTime Player. For RealPlayer and Windows Media Player, you must install the EnvivioTV plug-in, which can be freely downloaded and used. You may get your copy at www.envivio.com.
Many discussions of QuickTime 6's MPEG-4 support can be found on the Net. In short, a bunch of users cannot play streamed MPEG-4 with QuickTime 6, and sometimes they receive strange error messages. The problem lies in the implementation of MPEG-4 in QuickTime 6. It is known that MPEG-4 video encoded with GMC (global motion compensation), quarterpixels (qpel) and chroma motion cannot be played with QuickTime 6. QuickTime 6 also uses an MPEG quantizer, which improves cripsness and is better than H.263 for preserving quality. Extensive tests in my school show that MPEG-4 AAC audio with bit rates under 64 kilobits/second generate strange error messages in QuickTime 6. The players provided by MPEG4IP, however, do not have the same problems with QuickTime 6.
Friendly user interface.
Integrates with browsers.
Plays only some MPEG-4 files.
The Windows version player lacks a good user interface.
Not very well known to the public.
Manual input of URL is required.
Plays most MPEG-4 files.
- One Port to Rule Them All!
- Privacy Is Personal
- PHP for Non-Developers
- Secure Server Deployments in Hostile Territory
- Linux Kernel 4.1 Released
- Django Templates
- July 2015 Issue of Linux Journal: Mobile
- A Code Boot Camp for Underprivileged Kids
- Practical Books for the Most Technical People on the Planet
- Attack of the Drones