microcreat

microcreat

0个粉丝

36

问答

0

专栏

0

资料

microcreat  发布于  2013-01-07 08:59:41
采纳率 0%
36个问答
8189

live555移植笔记一 ubuntu下live555+SMplayer在本机搭建rtsp服务器并验证

 

[i=s] 本帖最后由 microcreat 于 2013-1-7 09:05 编辑 [/i]

环境:

ubuntu-11.04-desktop-amd64.iso

一,前期准备:

1,下载live555 下载源码:http://www.live555.com/liveMedia/public

可以下载最新的,我下载的版本是:live.2012.12.24.tar.gz

2,安装live555

root@microcreat:/workdir/private# ls live555-latest.tar.gz root@microcreat:/workdir/private# tar -zxvf live555-latest.tar.gz

root@microcreat:/workdir/private# ls live live555-latest.tar.gz

root@microcreat:/workdir/private/live# ls BasicUsageEnvironment config.freebsd config.solaris-32bit Makefile config.aix config.iphoneos config.solaris-64bit Makefile.head config.alpha config.irix config.sunos Makefile.tail config.armeb-uclibc config.linux config.uClinux mediaServer config.armlinux config.linux-64bit configure proxyServer config.avr32-linux config.linux-gdb COPYING README config.bfin-linux-uclibc config.macosx fix-makefile testProgs config.bfin-uclinux config.macosx-32bit genMakefiles UsageEnvironment config.bsplinux config.macosx-before-version-10.4 genWindowsMakefiles win32config config.cris-axis-linux-gnu config.mingw genWindowsMakefiles.cmd win32config.Borland config.cygwin config.openbsd groupsock WindowsAudioInputDevice config.cygwin-for-vlc config.qnx4 liveMedia root@microcreat:/workdir/private/live# ./genMakefiles linux

root@microcreat:/workdir/private/live# make

这样就编译完成了。

3,安装SMplayer

sudo add-apt-repository ppa:rvm/smplayer sudo apt-get update sudo apt-get install smplayer smtube smplayer-themes

注:如果下面的错误:

root@microcreat:/workdir/private# sudo apt-get install smplayer smtube smplayer-themes Reading package lists... Error! E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_natty_restricted_i18n_Translation-en E: The package lists or status file could not be parsed or opened.

解决方法是:

sudo rm /var/lib/apt/lists/* -vf sudo apt-get update

这样SMplayer就安装OK了。

可以用"Applications -> Sound & Video -> MPlayer Movie Player"来运行mplayer。

二,用本机搭建RTSP服务器

2.1其实很简单,就是利用刚刚编译成功的live555的源码。

root@microcreat:/workdir/private/live/mediaServer# pwd /workdir/private/live/mediaServer root@microcreat:/workdir/private/live/mediaServer# ls COPYING DynamicRTSPServer.hh in.264 live555MediaServer.cpp Makefile Makefile.tail DynamicRTSPServer.cpp DynamicRTSPServer.o live555MediaServer live555MediaServer.o Makefile.head version.hh 在此项目中放入一个in.264的文件,然后启动服务器:

root@microcreat:/workdir/private/live/mediaServer# ./live555MediaServer LIVE555 Media Server version 0.75 (LIVE555 Streaming Media library version 2012.09.27). Play streams from this server using the URL rtsp://192.168.196.128:8554/ where is a file present in the current directory. Each file's type is inferred from its name suffix: ".264" => a H.264 Video Elementary Stream file ".aac" => an AAC Audio (ADTS format) file ".ac3" => an AC-3 Audio file ".amr" => an AMR Audio file ".dv" => a DV Video file ".m4e" => a MPEG-4 Video Elementary Stream file ".mkv" => a Matroska audio+video+(optional)subtitles file ".mp3" => a MPEG-1 or 2 Audio file ".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file ".ts" => a MPEG Transport Stream file (a ".tsx" index file - if present - provides server 'trick play' support) ".wav" => a WAV Audio file ".webm" => a WebM audio(Vorbis)+video(VP8) file See http://www.live555.com/mediaServer/for additional documentation. (We use port 8000 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).) 2.2 另外开一个终端:来启动SMplayer

root@microcreat:~# mplayer rtsp://192.168.196.128:8554/in.264 mplayer: Symbol `ff_codec_bmp_tags' has different size in shared object, consider re-linking MPlayer 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.

Playing rtsp://192.168.196.128:8554/in.264 Resolving 192.168.196.128 for AF_INET6... Couldn't resolve name for AF_INET6: 192.168.196.128 Connecting to server 192.168.196.128[192.168.196.128]: 8554... rtsp_session: unsupported RTSP server. Server type is 'unknown'. STREAM_LIVE555, URL: rtsp://192.168.196.128:8554/in.264 Stream not seekable! file format detected. Initiated "video/H264" RTP subsession on port 48870 demux_rtp: Guessed the video frame rate as 30 frames-per-second. (If this is wrong, use the "-fps " option instead.) VIDEO: [H264] 0x0 0bpp 30.000 fps 0.0 kbps ( 0.0 kbyte/s) open: No such file or directory [MGA] Couldn't open: /dev/mga_vid open: No such file or directory [MGA] Couldn't open: /dev/mga_vid [VO_TDFXFB] This driver only supports the 3Dfx Banshee, Voodoo3 and Voodoo 5. [VO_3DFX] Unable to open /dev/3dfx. Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory [vdpau] Error when calling vdp_device_create_x11: 1

Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)

Audio: no sound Starting playback... Movie-Aspect is undefined - no prescaling applied. VO: [xv] 160x128 => 160x128 Planar YV12 V: 17.4 592/592 1% 1% 0.0% 0 0 Exiting... (Quit)

这样rtsp服务器就搭建完成!

我来回答
回答4个
时间排序
认可量排序

yinhao683

0个粉丝

11

问答

0

专栏

0

资料

yinhao683 2013-04-01 09:35:16
认可0
SMplayer的安装不是很清楚,求安装包下载地址

路人甲

0个粉丝

3

问答

0

专栏

0

资料

路人甲 2013-06-08 17:39:07
认可0
[quote]yinhao683 发表于 2013-4-1 09:35 [url=forum.php?mod=redirect&goto=findpost&pid=2961&ptid=1621][img]static/image/common/back.gif[/img][/url]
SMplayer的安装不是很清楚,求安装包下载地址[/quote]

可以用vlc player

z12oo

0个粉丝

5

问答

0

专栏

0

资料

z12oo 2015-04-29 16:14:09
认可0
各位师哥好,这个可以调通h.264的播放,MP3播放没问题,但是想问下如何实现.h264文件的播放?

ebaina

0个粉丝

0

问答

0

专栏

6

资料

ebaina 2013-01-07 13:12:59
认可0
辛苦了:)
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区