用flv.js播放直播视频流http-flv,不知该用什么服务器啊?

服务器我用的srs,不过没找到跨域的配置,而flv.js需要播放跨域的flv直播视频流,不知大家都用的什么技术

阅读 15.7k
3 个回答

https://github.com/gwuhaolin/...

https://github.com/gwuhaolin/...

livego

live streaming server write in pure go, simple efficient and can run in any platform.

Support

Transport protocol
  • [x] RTMP

  • [x] AMF

  • [x] HLS

  • [x] HTTP-FLV

File container
  • [x] FLV

  • [x] TS

AV coder
  • [x] H264

  • [x] AAC

  • [x] MP3

Install

Download Bin

releases

Docker

TODO

Install System Service

TODO

Build From Source code

  1. run git clone https://github.com/gwuhaolin/livego.git

  2. cd to livego dir then run go build

Use

  1. run livego to start livego server

  2. push RTMP stream to rtmp://localhost:1935/live/movie, eg use ffmpeg -re -i demo.flv -c copy -f flv rtmp://localhost:1935/live/movie

  3. play live stream form:

    • RTMP:rtmp://localhost:1935/live/movie

    • FLV:http://127.0.0.1:7001/live/movie.flv

    • HLS:http://127.0.0.1:7002/live/movie.m3u8

使用nginx 反向代理 来添加允许跨域的头信息
两边端口不能冲突
location ^~ /live/ {

    add_header 'Access-Control-Allow-Origin' '*'; 
    add_header 'Access-Control-Allow-Credentials' 'true'; 
    add_header 'Access-Control-Allow-Methods' 'GET'; 
    proxy_pass http://127.0.0.1:8502/live/;
    

}

你是利用http-flv做的html5直播吗?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进