YoLinux Tutorial - Video Streaming with Real Media/Video

This tutorial covers configuring your Linux server to stream Real video. The tutorial will also cover content creation and viewing.

Contents:

Related YoLinux Tutorials:

°Burn DVD on Linux

°Linux Video

°Systems Administration

°Network configuration

°Firefox Configuration / Plug-ins

°Ripping MP3s

°Streaming MP3s

°Internet Security

°Web site configuration

°Web Tricks

°YoLinux Tutorials Index




Free Information Technology Magazines and Document Downloads
TradePub link image


Real Media Server Installation and Configuration:

According to the Realnetworks web site, the Real Media systems video and audio server for Linux can only be installed on a system running the Linux 2.2 kernel. This is NOT true!!. I have used the Real server on Red Hat Linux 6.1, 6.2 and 7.1. Most of my experience has been with RH 6.1. Red Hat 7.1 uses the Linux 2.4 kernel and it works. When I upgraded a server from 6.1 to 7.2, no changes to the Real Video configuration were required. The free version is known as "RealSystem Server Basic" and supports up to 25 simultaneous users and is licensed for 12 months. The commercial ($1995.00) version is known as "RealSystem Server Plus". (your choice) There were no special hardware requirements. I advise lots of memory. This tutorial applies to Real Networks "RealSystem Server 8.01".

Also see:

Download Real Media Server:

Real Networks will then email you a license key required by the software, based on the information you gave them in the download form. They will also provide a URL from which the key may be downloaded.

When installing RealSystem server 8, you will be prompted for the name of the Key file.

Support:

Installation:

Execute the downloaded self extracting binary and follow the instructions: ./rs-8-01-linux-libc6.bin
(You may have to allow execute permissions on the file: chmod +x rs-8-01-linux-libc6.bin)
I accepted most defaults by hitting "Enter" after the displayed default. Note that while I used /opt/REAL/ as the directory for my installation, you are free to choose /usr/local/REAL/ or anything appropriate for your system.

Console display of installation:
-----------------------------------------------------------
Extracting files for RealNetworks installation......
Welcome to the RealServer Setup for UNIX
Setup will help you get RealServer running on your computer.

Setup will step you through the installation process by displaying
informational screens. Please follow the navigational controls
below:

Key Behavior
=== ========
N Next
P Previous
X Exit
F Finish (Express Installation)

Each input requires the execution of the key above
followed by the [ENTER] key. Enter [N]ext to continue:
-----------------------------------------------------------
If a RealServer license key file has been sent to you,
please enter its directory path below. If you have not
received a RealServer license key file, then this server
WILL NOT OPERATE until a license key file is placed in
the server's License directory. Please obtain a free
Basic RealServer license or purchase a commercial license
from our website at http://www.real.com/. If you need
further assistance, please visit our on-line support area
at http://service.real.com/, or contact our RealServer
technical support team at (206) 674-2681.
License Key File:

/opt/REAL/5259-12-13-010XXXXXXXXXXXX.lic ----------------------------------------------------------- Installation and use of RealServer requires acceptance of the following terms and conditions: Press [Enter] to display the license text... ----------------------------------------------------------- Choose "Accept" to accept the terms of this license agreement and continue with RealServer setup. If you do not accept these terms, enter "No" and installation of RealServer will be cancelled. (Default: Accept): ----------------------------------------------------------- Enter the complete path to the directory where you want RealServer 8.0 to be installed. You must specify the full pathname of the directory and have write privileges to the chosen directory [/opt/REAL]:
-----------------------------------------------------------
Please enter a username and password that you will use
to access the web-based RealSystem Administrator, the
RealSystem monitors, and RealSystem live encoders:
Username:
-----------------------------------------------------------
Give username/password for Real admin. Sample: realAdmin / secretPassword
-----------------------------------------------------------
Please enter a port on which RealServer will listen for
PNA connections. These connections have URLs that begin
with "pnm://": (Default: 7070)
-----------------------------------------------------------
Please enter a port on which RealServer will listen for
RTSP connections. These connections have URLs that begin
with "rtsp://": (Default: 554)
-----------------------------------------------------------
Please enter a port on which RealServer will listen for
HTTP connections. These connections have URLs that begin
with "http://": (Default: 8080)
-----------------------------------------------------------
RealServer will listen for RealSystem Administrator
requests on the port shown. This port has been
initialized to a random value for security. Please
verify now that this pre-assigned port will not interfere
with ports already in use on your system; you can
change it if necessary. (Default: XXX2X)
-----------------------------------------------------------
The installation program will choose a different
number for the admin port each time you install the Real
Server software. This is a security feature.
-----------------------------------------------------------
You have selected the following RealServer configuration:

Admin Username: realAdmin Admin Password: secretAdminPassword Monitor Password: secretMonitorPassword Encoder Username: realEncoder Encoder Password: secretEncoderPassword PNA Port: 7070 RTSP Port: 554 HTTP Port: 8080 Admin Port: XXX2X Enter [F]inish to begin copying files, or [P]revious to go back to the previous prompts: RealServer installation is complete. ----------------------------------------------------------- The RealSystem Administrator allows you to configure and maintain RealServer through an intuitive web-based interface. Please note that RealServer must be running in order to use the Administrator. Would you like to start RealServer now and launch the RealSystem Administrator? (Default: Yes) NO if remote!! ----------------------------------------------------------- If at any time you should require technical assistance, please visit our on-line support area at http://service.real.com/, or contact our RealServer technical support team at (206) 674-2681. Starting RealServer... Please Wait... Sending RealSystem Administrator URL to browser...
[Potential Pitfall]: If installing the server remotely accross a network, answer "NO" to the question "Would you like to start RealServer now...". This is because it will try to launch the Netscape browser on the local console.
Typical error message if you try to start the server remotely and launch a browser:
Cleaning up RealServer installation files...
Please Wait...

...
..
Error: Can't open display:

[Potential Pitfall]: The install order of operation is faulty as given by the Real Media instructions. After installation, copy the license key file /opt/REAL/5259-12-13-010XXXXXXXXXXXX.lic to /opt/REAL/License/5259-12-13-010XXXXXXXXXXXX.lic. The Real server will NOT run without this. The file cannot be installed in this directory until after the server software is installed.

Typical error message if the license file is in the wrong directory:
Cleaning up RealServer installation files...
Please Wait...
[root@node1 REAL]# shell-init: could not get current directory
job-working-directory: could not get current directory
job-working-directory: could not get current directory
job-working-directory: could not get current directory
...
..

You may now start and administer the system.

Start Server:

You must be in the "REAL" install directory to initiate the command: cd /opt/REAL

Start the server: Bin/rmserver --ignore-etc-hosts-problems rmserver.cfg -m64 &

[Potential Pitfall]: The option -m 64 (>=32) was required on a system with 128 meg. The default took too much memory.

[Potential Pitfall]: System configuration note for file: /etc/hosts.deny Comment out entry with a "#" if it exists #ALL:ALL

[Potential Pitfall]: If you get the following error trying to start the server it means that you may already have on instance of the server running.

Error:
E: could not open <127.0.0.1:7070> - Address already in use
Use the "socklist" or "ps -auwx | grep rmserver" command to find the server processes. They seem to be hidden from "pstree".
Kill process with kill command or: killall rmserver.

Administer the Server:

The administration of the Real Media Server is through a web fron-end. It basically controlls the contents of the configuration file: rmserver.cfg. The administrator may configure ports used, logging, IP address bindings, MIME types for media file types, users, broadcast protocols, multicast (private networks), cache, security, insertion of advertising and make system queries all through a user friendly web front-end. (or do what I did, do nothing and use the defaults)

Point your browser to: http://your-domain.com:AdminPortNumber/admin/index.html
You will be prompted for the administrator's "Admin Username" and password.

The "AdminPortNumber" was assigned during installation and is random so it is different for each installation. Be carefull to remember the new number if you re-install!

If you do not know the admin port number it may be retrieved from the configuration file: grep AdminPort /opt/REAL/rmserver.cfg

The entry in the rmserver.cfg file will look like: <Var AdminPort="XXXXX"/> Where XXXXX is the "admin port number".

Configuration file rmserver.cfg note:

<List Name="IPBindings">
<Var Address_01="0.0.0.0"/>
</List>
I added this entry to the end of the config file. The address 0.0.0.0 binds the Real Server to all IP addresses available on this machine. This may be configured with the web front-end.

Directories:

/opt/REAL/Bin/
/opt/REAL/Content/   - Place content here.
/opt/REAL/Logs/
          
Test sample video: http://your-domain.com:8080/ramgen/real8video.rm

Notes:

  • If the Real Systems server is an http server can't I just use apache? Well I tried it and it worked with both a hyperlink (to the file-name.rm) and with a plug-in. The Real Systems server has many advanced features specifically for streaming media but apache worked fine on a 20 second video clip. You also bypass firewall problems when you stream on port 80. Many corporations limit outside access to port 80 only. I'm sure that there is alot I do not understand about video streaming and the inner workings of the Real Systems server and it's technology, but I tried a short video clip with apache and it worked.

Links:


Real Producer Installation and Configuration:

Real Producer will generate the Real video and audio content for streaming. This tutorial covers using Real Producer 8.51 on Red Hat 7.1 using the Linux 2.4 kernel. The Real networks web site states that the Linux 2.2 kernel is necessary. This is NOT true and in fact I could not get it to run under Red Hat 6.2 using either the original kernel or using the 2.2.19 kernel!!! (and man, did I ever waste loads of time trying to make it work!!!) I think that this is due to the superior Linux 2.4 kernel support of my Hauppauge model 447 WinTV PCI video capture card. (See the YoLinux video tutorial and use of the Hauppauge WinTV card with Linux)

RealSystem Producer Basic:

The free version of Real Producer was used for this tutorial. This is known as "Real Producer Basic 8.51" for Linux and creates content for 2 connections speeds of your choice. (The "Plus" version supports 8)

Download:

http://www.realnetworks.com/products/producer/basic.html

This download will result in the self-extracting binary: rp8_linux20_libc6_i386_cs2.bin
or realsystemproducer_8.51_linux.tar.gz

Installation:

cd /opt/REAL-Producer
tar xzf realsystemproducer_8.51_linux.tar.gz
./install
Default install path: /usr/local/realproducer-8.5
I chose /opt/REAL-Producer during install.

When prompted for a serial number enter "free".

Console display of installation:
-----------------------------------------------------------------------
RealProducer for Unix (C) 1995-2000 RealNetworks

Welcome to the RealProducer for Unix installation program. Please specify
the directory in which the RealProducer is to be installed.

NOTE: It is recommended that you uninstall the G2 Linux RealProducer
before installing the 8.5 Beta Linux RealProducer.

Path : [/usr/local/realproducer-8.5] /opt/REAL-Producer Directory "/opt/REAL-Producer" does not exist. Should I create it? yes Analyzing space requirements for RealProducer RealProducer requires 40 MB of disk space for installation. ----------------------------------------------------------------------- If you have a serial number provided by RealNetworks for RealProducer Plus, please enter it now. Otherwise, enter "free" serial number (enter "free" for free RealProducer): free Would you like the installer to create symlinks to the RealProducer products? y Where would you like to install the symlinks? [/usr/local/bin] /opt/bin Would you like the installer to create more symlinks to the RealProducer Plus products? no Would you like to take a look at the README file? no -----------------------------------------------------------------------

List commands and instructions with the command: realproducer --help
[Potential Pitfall]: This is important as changes are often made to the software without updates to the documentation. I got burned by following a README file included with the software which was out of date!!

Examples:

  • Convert from a Quicktime video file: realproducer -i quicktime-file.mov -o real-media-file.rm -t 0,1 -v 0 -f 1 -b "My Clip"
    (Example from README. I have not tried this.)

  • Capture 20 seconds of TV or video:
    realproducer -l 0,4:0 -x 000:00:20 -o crestedbutte-2001.rm -ow -t 0,1 -v 0 -f 1 -y 0 -z 1 -vx 320,240 -g 6 -vc RV200 -b "Crested Butte 2001" -h "Greg" -c "(c) 2001 by Greg"

    • -t: Basic/free version only allows two target audiences. You have to buy for more.
    • -l: Live feed. -l 0,0 (primary and default) (tricky!!!) The README file misled me!!! Use "realproducer --help"
    • -v: video quality. -v 0 (default)
    • -y: audio 0-no 1-yes
    • -z: enable video recording 0-no 1-yes
    • -vx: width, height -vx 320,240 Other options: (160,120) (240,180)
    • -g: Player compatability. Most everyone is G2 compatable. (5 really old) (G2: choose value 6)
    • -vc: Codec RV200 - RealVideo G2 (for compatability reasons. Newer codecs are better but not everyone has the player/plug-in.)
    • -ow: Allow overwrite of output file.

    This command requires a video capture card. The input is a live feed to the card and not from a file.

    [Potential Pitfall]: I was capturing a video feed from my camcorder broadcasting on channel 3 through a cable TV connection. For this to work the tuner of my Hauppauge WinTV must be set to channel 3. For this I used kwintv. See the YoLinux video tutorial and use of the Hauppauge WinTV card and kwintv. I would start kwintv and set the tuner to channel 3 and test the video input from my camcorder. One MUST then quit out of kwintv. Only one program application may access the device at a time. With the tuner set to channel 3, I could then run realproducer and capture the camcorder video input to the card. There are other TV viewing programs, my favorite is kwintv.

  • Same as above but add a soundtrack from a CD: realproducer -l 2:2,4:0 -x 000:00:20 -o crestedbutte-2001.rm -ow -t 0,1 -v 0 -f 1 -y 0 -z 1 -vx 320,240 -g 6 -vc RV200 -b "Crested Butte 2001" -h "Greg" -c "(c) 2001 by Greg"

  • Using the video camera that came with my Hauppague video capture card: realproducer -l 2:0,4:2 -x 000:00:10 -o VideoTest.rm -ow -t 0,1 -v 0 -f 1 -y 1 -z 1 -vx 320,240 -g 6 -vc RV300 -b "test" -h "Greg" -c "(c) 2001 by Greg"
    [Pitfall]: While I am sure the video camera is indeed a color video camera because when viewed with kwintv or Zapping I get full color from S-Video input (video camera), realproducer will often capture the video in black and white. (??? It seems to be a random problem. Capture card related??? Software???) Capture from my camcorder using TV input on channel 3/4 always results in a full color video. Sound input came from an external microphone.
    [Pitfall]: European PAL (Phase Alternation Line) users - You MUST set your VCAP_FORMAT environmental variable to PAL in order to capture color. Default is NTSC (National Television Standards Committee) Bash shell: export VCAP_FORMAT=PAL, tcsh: setenv VCAP_FORMAT=PAL

  • Composite video feed, audio source is line-in: realproducer -o /tmp/testing.rm -t 7 -a 3 -v 0 -f 0 -b "Testing Video" -h "Greg" -c "Personal" -vc RV300 -l 2:1,4:1
    Higher quality:
    • -t: 7 = 384K DSL/Cable Modem
    • -a: Audio format. 0=Voice Only
    • -vc: RV300 = RealVideo 8.0 Latest codec.

  • Generate an audio file for streaming: realproducer -i test-in.wav -o test.rm -b "My Test" -h "Greg" -c "(c) 2001 by Greg" -t 1 -a 2 -f 0

    • -t: Target Audience (7 = Cable bandwidth)
    • -a: Audio Format (3 = Stereo Sound)
    • -v: Video Quality (0 = Normal Video)
    • -f: File Type (0 = Single Rate Video)
    • -b: Video Title
    • -h: Author Information
    • -c: Copyright Information
    • -vc: Video Encoding (RV300 = Real Player 8, RV200 = Real Player 7)

  • Shell script to encode a captured stream: (Based on submition by "Flare")
    #!/bin/sh
    export VCAP_FORMAT=NTSC

    #set the channel
    /usr/bin/v4lctl -c /dev/video0 setstation 2

    # Turn the speakers off
    /usr/bin/v4lctl volume mute off

    #call realproducer
    realproducer -l 2:1,3:0 -s 192.168.1.101:4040/test.rm -u user -p password -td /data -t 4 -v 1 -f 1 \
    -vx 320,240 -g 6 -b "Test 2002" -h "Test" -c "(c) 2002" -a 1

Notes:

  • Some people have had some success using the Video4Linux command set. i.e.: v4lctl volume mute off
    I have not had any success with this command.
  • Test file with: realplay encoded-file.rm This requires installation of the media player. See next section.

RealProducer 8.51 options:

Note: This is not complete and subject to change. Use the command: realproducer --help for a complete list of options.
Option Default Description
-i none Input File Name
-o input file with .rm extention Output File Name
-ow no overwrite Allow overwrite of output file
-td current directory Temporary File Directory Name
-l 0,0 - Bad default!! Live Audio/Video Input audio,video
-vx none Video Capture Size: Width,Height
-x continous Maximum Encoding Duration in hhh:mm:ss
-b none Title
-h none Author
-c none Copyright
-q none Description
-n none Keywords
-s none
Port default: 4040
Server: server:port/file
-u none Server Username
-p none Server Password
-f 1 File type:
0 - Single Rate
1 - SureStream
-g 6 Player compatibility:
(SureStream encoding only: "-f 1")
5 - RealPlayer 5.0 or later
6 - RealPlayer G2
-v 0 Video quality:
0 - Normal Motion Video
1 - Smoothest Motion Video
2 - Sharpest Image Video
3 - Slide Show
-t 0 Target audience:
0 - 28 Kbps Modems
1 - 56 Kbps Modems
2 - Single ISDN
3 - Dual ISDN
4 - DSL/Cable Modem
5 - Corporate LAN
6 - 256K DSL/Cable Modem
7 - 384K DSL/Cable Modem
8 - 512K DSL/Cable Modem
-a 0 Audio Format:
0 - Voice Only
1 - Voice with Background Music
2 - Music
3 - Stereo Music
--help
List command options.
--version
Display Version Information

Links:


Real Player Installation and Configuration:

Real Media has supported Linux with the Real Player from the beginning. Real Player 5, 7, 8 and 9 (RealOne Alpha release) work with linux. These can work as a Netscape/Mozilla plug-in or as a stand-alone media player.

Download:

  • Real Player 8: (Basic) [Download from Real.com]
    OR: http://scopes.real.com/real/player/unix/unix.html

  • RealOne player alpha release:

    (RP9)Requires:

    ~/.kde/share/applnk/Multimedia
    ~/.kde/share/mimelnk/application
    ~/.kde/share/mimelnk/audio
    ~/.kde/share/mimelnk/image
    ~/.kde/share/mimelnk/text
    ~/.kde/share/mimelnk/video
    Mime configuration (Preferences):
    • File extension: RM RAM SMI
    • MIME type: audio/x-pn-realaudio
    • Application to use: /usr/bin/realplay9 %s

Installation:

Links:


HTML and the URL:

HTML:

  • Link: <A HREF="http://your-domain:8080/ramgen/video-file.rm">Text to display</A>
    This link when selected will launch the Real Media Player application as a new and separate program in it's own window.

  • Use Audio plug-in: <EMBED WIDTH=300 HEIGHT=60 SRC="http://your-domain.com:8080/ramgen/Audio-file.rpm" type=audio/x-pn-realaudio-plugin autostart=true controls="ControlPanel,StatusBar" nojava=true>

    This displays the Real Media Netscape plug-in within the HTML page. If this is not visible, then you do not have the Real Media Player plug-in.

  • Use Video plug-in: <EMBED WIDTH=280 HEIGHT=260 SRC="http://your-domain.com:8080/ramgen/Video-file.rpm" type=audio/x-pn-realaudio-plugin autostart=true controls="ImageWindow,ControlPanel,PositionSlider,StatusBar" nojava=true>


    [ Requires RealPlayer - download here ]

    This displays the Real Media Netscape plug-in within the HTML page. If this is not visible, then you do not have the Real Media Player plug-in. Extra HTML was used to generate the table border and the RealPlayer download link.

URL:

  • MP3 Audio URL issued from Real Player: rtsp://your-domain:8080/song.mp3
  • Real Audio URL issued from Real Player: rtsp://your-domain:8080/song.ram
  • URL links in a web: http://your-domain:port-number/ramgen/audio-file.rm

Links:


Links:

   

    Bookmark and Share


Advertisements





 

Copyright © 2001, 2002 by Greg Ippolito