Mplayer supports RTSP/RTP streaming media files

Source: Internet
Author: User

Hostzhu comment: mplayer's support for streaming media allows you to use Linux to view live webcast. The promotion of multimedia applications in Linux is not measurable.

RTSP/RTP streaming support for mplayer
The Open Source "mplayer" Media Player can now receive and play standards-comp
Liant RTP audio/video streams, using the "live555 Streaming Media" source code
Libraries.
* For example, mplayer can be used to view the mpeg/RTP streams sent by th
E "testmp3streamer", "testmpegvideostreamer" or "testmpegaudiovideostreamer" d
Emo applications, using the corresponding ". SDP" file (or, if the built-in RTS
P server is enabled, using a "rtsp: //" URL ).
* Mplayer can also play audio other "rtsp: //" streams, including Isma-compl
Iant MPEG-4 audio/video streams.
Note: We now recommend the use of the VLC Media Player. VLC, like mplayer, use
S the "live555 Streaming Media" Code for RTSP client support, but is generally
More reliable than mplayer. The VLC web site also has pre-built binary versio
Ns; you may not need to build it from source code.
Building mplayer to support RTSP/RTP streaming
Please do the following steps, in order:
1. Download and build the "live555 Streaming Media" libraries. You may wish
To move the resulting "live/" directory to "/usr/local/", "/usr/local/lib /",
Or "/usr/lib/". (Note: if you do this, you must move the entire "live/" direct
Ory-not just the library files .)
2. Download the newest version of The mplayer source code.
3. If, in step 1, you moved the "live/" directory to "/usr/local/", "/usr/L
Ocal/lib/", or"/usr/lib/", run
CD mplayer *;./configure -- enable-live
Otherwise, run
CD mplayer *;./configure -- enable-live -- With-livelibdir =
4. Now, build and install mplayer as usual-I. e .,
Make; make install
(Note that you must build mplayer with the same version of "GCC" That yo
U used to build the live555 Streaming Media Code .)
Running the new mplayer
Mplayer can be run just as before. However, it can now open "rtsp: //" URLs:
Mplayer rtsp :///
* To see details of the complete RTSP protocol exchange, add the "-V" (VE
Rbose) option.
Alternatively, using a "SDP: //" pseudo-URL, mplayer can read a SDP file that D
Escribes a rtp session:
Mplayer SDP ://
(SDP files are usually used only for playing multicast RTP sessions .)
Audio/Video Synchronization
Mplayer s "A-V:" Display (at the bottom of the console window) shows the curre
Nt time difference (in seconds) between the audio and video streams. mplayer W
Ill automatically attempt to synchronize audio and video-I. e., to bring
"A-V:" number close to zero-using information provided by incoming RTCP "Sen
Der Report "packets. Sometimes, however, mplayer s default synchronization MEC
Hanism can be slow to respond. If you need to make it respond more aggressivel
Y, try adding the option
-MC 10
Mplayer s principal author has also written an informative article that discus
SES techniques for tuning the performance of mplayer.
Streaming over TCP
By default, incoming data (RTP and RTCP packets) are streamed using UDP. If, h
Owever, you have a broken Internet connection that (for whatever reason) does
Not pass incoming UDP packets, then you can ask that the incoming data be stre
Amed over TCP instead. (It will use the same TCP connection as RTSP .)
To do this, add the option
-RTSP-stream-over-TCP
To mplayer. (Note that TCP streaming can be used only with "rtsp: //" URLs; it
Can t be used with sessions that are specified using a SDP file .)
Streaming access-controlled RTSP sessions
Some RTSP servers require user authentication (via a name and password) before
A session can be streamed. to stream such a session, use the "-user-passwd" options. The program authenticates using RTSP "Digest Au
Thentication "; the password will not get sent in the clear over the net.
Alternatively, you cocould try including the user name and password inside the u
RL, as: "rtsp: //: @:". (in this case, thoug
H, the password will be sent in the clear over the net .)
Playing SIP (IP telephony) sessions
Mplayer can also open and play sip IP Telephony sessions-I. e., those specifi
Ed by a "SIP:" url. Of course, because mplayer is a receive-only application,
You can listen in on such sessions-but you won t be able to talk back. (
Two-way communication on a sip session, you shoshould instead use a dedicated sip
Softphone application, such as Linphone .)
A note about RealAudio and realvideo sessions
Note that the live555 streaming media libraries do not support RealAudio and/o
R realvideo streams-even those described by a "rtsp: //" url-because these
Streams do not use RTP for transport. (Instead, these streams use RealNetworks
Proprietary "RDT" protocol .)
Recently, however, mplayer was updated so that it can play RealAudio/realvideo
"Rtsp: //" streams. It does this by first checking whether the URL ends"
. Rm "or". Ra ". If it does, it handles it as a special case, not using the live
555 streaming media support. Otherwise, it uses the live555 streaming media Su
Pport, as usual.
Support
General questions about mplayer shoshould be posted to one of the mplayer mailing
Lists. However, questions specifically about the RTSP/RTP streaming support (
Could t for playing RealAudio or realvideo streams) shocould be posted instead
The "live555 Streaming Media" developers mailing list.
Work still to be done...
* Support additional RTP media types. At present, the following media type
S are known to work:
Audio: MPEG-1 or 2 elementary streams (including Layer III-I. e., "MP3"
); MPEG-4 (AAC) Audio; PCM (u-law or a-Law); GSM; AC-3; qcelp
Video: MPEG-1, 2 or 4 elementary streams; H.263 +; motion-JPEG
* Use the RTSP "pause" and "play" commands to support the pausing and seek
Ing of RTSP-initiated streams.
* Handle video RTP multicast sessions that contain more than one video sou
RCE (multiplexed by rtp ssrc)-e.g., sessions such as the mbone "places all o
Ver the world ". For example, mplayer might pop up a separate video window
Each such source.

Play Network File Information
2 playing rtsp: // gnu-linux.3322.org/test.3gp.avi.
3 resolving gnu-linux.3322.org for af_inet...
4 connecting to server gnu-linux.3322.org [58.41.179.173]: 554...
5 rtsp_session: Unsupported RTSP server. server type is 'laim1. 123 '.
6 resolving gnu-linux.3322.org for af_inet...
7 connecting to server gnu-linux.3322.org [58.41.179.173]: 80...
8 server returned 404: not found
9 No stream found to handle URL rtsp: // gnu-linux.3322.org/test.3gp.avi

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.