Streaming via RTSP or RTP in HTML5

后端 未结 8 2210
时光说笑
时光说笑 2020-11-22 16:05

I\'m building a web app that should play back an RTSP/RTP stream from a server http://lscube.org/projects/feng.

Does the HTML5 video/audio tag suppo

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 16:34

    This is an old qustion, but I had to do it myself recently and I achieved something working so (besides response like mine would save me some time): Basically use ffmpeg to change the container to HLS, most of the IPCams stream h264 and some basic type of PCM, so use something like that:

    ffmpeg -v info -i rtsp://ip:port/h264.sdp -c:v copy -c:a copy -bufsize 1835k -pix_fmt yuv420p -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1 /var/www/html/test.m3u8
    

    Then use video.js with HLS plugin This will play Live stream nicely There is also a jsfiddle example under second link).

    Note: although this is not a native support it doesn't require anything extra on user frontend.

提交回复
热议问题