mplayer 实现H.264的rtsp流播放

一 系统

   ubuntu 12.04-destop

   GNome Mplayer


二 Mplayer

      Mplayer本身支持h.264。而要支持RTSP,则需要live555的支持。

      参阅 live555官网对Mpalyer支持,http://www.live555.com/mplayer/

The Open Source "MPlayer"media player can nowreceive and playstandards-compliantRTP audio/video streams,using the"LIVE555 Streaming Media"source code libraries.

  • For example, MPlayer can be used to view the MPEG/RTPstreams sent by the"testMP3Streamer","testMPEGVideoStreamer"or "testMPEGAudioVideoStreamer"demo applications, using the corresponding ".sdp" file(or, if the built-in RTSP server is enabled, using a "rtsp://" URL).
  • MPlayer can also play many other "rtsp://" streams, includingISMA-compliant MPEG-4 audio/video streams.

Note: We now recommend the use of theVLC media player.VLC, like MPlayer, uses the "LIVE555 Streaming Media"code for RTSP client support, but is generally more reliable than MPlayer.The VLC web sitealso has pre-built binary versions; you may not need to build it from source code.

Running the new MPlayer

MPlayer can be run just as before.However, it can now open "rtsp://" URLs:
    mplayer rtsp://<servername>/<filename>
  • To see details of the complete RTSP protocol exchange, addthe "-V" ('verbose') option.
Alternatively, using a "sdp://" pseudo-URL,MPlayer can read a SDP file that describes a RTP session:
    mplayer sdp://<SDP-filename>
(SDP files are usually used only for playing multicast RTP sessions.)

Streaming over TCP

By default, incoming data (RTP and RTCP packets) are streamed using UDP.If, however, you have a broken Internet connection that(for whatever reason) does not pass incoming UDP packets, then youcan ask that the incoming data be streamed 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'tbe 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<username> -passwd<password>" options.The program authenticates using RTSP "digest authentication";the passwordwillnot get sent in the clear over the net.Alternatively, you could try including the user name and password insidethe URL, as:"rtsp://<username>:<password>@<hostname>:<etc.>".(In this case, though, the passwordwill be sent in the clearover the net.)


本人在不确定已安装的Mplayer 是否支持rtsp的情况下 在shell 上运行:

$mplayer -rtsp-stream-over-tcp rtsp://192.168.30.222:554 -user admin -passwd 12345
 视频显示出来!默认情况下mplayer是支持rtsp的!

PC机上实现了rtsp流播放,那么arm板上也应该可以实现!



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值