Mac 搭建RTSP服务器

环境

  • Mac 10.12

搭建DDS失败,安装上之后,网页打开不开

方案

live555 Media Server(Mac) VLC(iOS Client)

步骤

  1. live555 Media Server下载
  2. 变成可执行文件
chmod 777 live555MediaServer
  1. 创建个文件夹,把live555MediaServer放进去,执行命令,看到一堆信息
➜  Live55Server ./live555MediaServer 
LIVE555 Media Server
    version 0.89 (LIVE555 Streaming Media library version 2016.05.16).
Play streams from this server using the URL
    rtsp://192.168.123.244: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
    ".265" => a H.265 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
    ".ogg" or ".ogv" or ".opus" => an Ogg audio and/or video file
    ".ts" => a MPEG Transport Stream file
        (a ".tsx" index file - if present - provides server 'trick play' support)
    ".vob" => a VOB (MPEG-2 video with AC-3 audio) file
    ".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).)
  1. 找个.264文件或者其他支持的格式放在跟live555MediaServer同目录下
  2. iphone打开VLC
    图标是这个
    u=712259638,775584750&fm=58.jpeg

    输入Macip地址,地址来源于上边的Play streams from this server using the URL之后的地址
    Mac 搭建RTSP服务器_第1张图片
    ScreenShot_20170112105017.png

    打开网络串流,iPhone7等了大概5-10秒,视频开始播放。

很多使用第三方或者其他Demo生成的h264裸流后缀是.h264,记住要改成.264才能被live555MediaServer识别。

你可能感兴趣的:(Mac 搭建RTSP服务器)