SRS部署環境之HDS(HTTP Dynamic Streaming)

SRS部署環境之HDS(HTTP Dynamic Streaming)

  • 拉取gitbub源碼:
    git clone https://github.com/ossrs/srs &&
    cd srs/trunk
  • 編譯:
    ./configure --with-hds && make
  • 修改配置conf/srs.conf,在 defaultVhost 添加如下配置
vhost __defaultVhost__ {

    hds {
            # whether hds enabled
            # default: off
            enabled         on;
            # the hds fragment in seconds.
            # default: 10
            hds_fragment    10;
            # the hds window in seconds, erase the segment when exceed the window.
            # default: 60
            hds_window      60;
            # the path to store the hds files.
            # default: ./objs/nginx/html
            hds_path        ./objs/nginx/html;
    }
}
  • 運行srs可執行程序
    ./objs/srs -c conf/srs.conf
  • 用推流工具推流,推流地址如下:
    ffmpeg -re -i ss.flv -acodec copy -vcodec copy -f  flv "rtmp://127.0.0.1:1935/live/livestream"
  • 在播放器播放器地址,添加播放地址,然後點擊播放即可看到效果。
    http://127.0.0.1:8080/live/livestream.f4m
發佈了29 篇原創文章 · 獲贊 39 · 訪問量 17萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章