问题

For school I need to set up an HTML5 live stream site. They have a flash stream-player they\'ve been using but now they want it to use HTML5 instead. How can I do this? I tried using the video tag but I can\'t get it working. Below is the code I have. Could someone point me in the correct direction?

Deltion Live Streaming

回答1:

A possible alternative for that:

Use an encoder (e.g. VLC or FFmpeg) into packetize your input stream

to OGG format. For example, in this case I used VLC to packetize

screen capture device with this code:

C:\Program Files\VideoLAN\VLC\vlc.exe -I dummy screen://

:screen-fps=16.000000 :screen-caching=100

:sout=#transcode{vcodec=theo,vb=800,scale=1,width=600,height=480,acodec=mp3}:http{mux=ogg,dst=127.0.0.1:8080/desktop.ogg}

:no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

Embed this code into a tag in your HTML page like that:

This should do the trick. However it's kind of poor performance and AFAIK MP4 container type should have a better support among browsers than OGG.

回答2:

Right now it will only work in some browsers,

and as far as I can see you haven't actually linked to a file,

so that would explain why it is not playing.

but as you want a live stream (which I have not tested with)

check out Streaming via RTSP or RTP in HTML5

and http://www.streamingmedia.com/Articles/Editorial/Featured-Articles/25-HTML5-Video-Resources-You-Might-Have-Missed-74010.aspx

回答3:

Live streaming in HTML5 is possible via the use of Media Source Extensions (MSE) - the relatively new W3C standard: https://www.w3.org/TR/media-source/

MSE is an an extension of HTML5 tag; the javascript on webpage can fetch audio/video segments from the server and push them to MSE for playback. The fetching mechanism can be done via HTTP requests (MPEG-DASH) or via WebSockets. As of September 2016 all major browsers on all devices support MSE. iOS is the only exception.

For high latency (5+ seconds) HTML5 live video streaming you can consider MPEG-DASH implementations by video.js or Wowza streaming engine.

For low latency, near real-time HTML5 live video streaming, take a look at EvoStream media server, Unreal media server, and WebRTC.

回答4:

Firstly you need to setup a media streaming server. You can use Wowza, red5 or nginx-rtmp-module. Read their documentation and setup on OS you want.

All the engine are support HLS (Http Live Stream protocol that was developed by Apple). You should read documentation for config.

Example with nginx-rtmp-module:

rtmp {

server {

listen 1935; # Listen on standard RTMP port

chunk_size 4000;

application show {

live on;

# Turn on HLS

hls on;

hls_path /mnt/hls/;

hls_fragment 3;

hls_playlist_length 60;

# disable consuming the stream from nginx as rtmp

deny play all;

}

}

}

server {

listen 8080;

location /hls {

# Disable cache

add_header Cache-Control no-cache;

# CORS setup

add_header 'Access-Control-Allow-Origin' '*' always;

add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';

add_header 'Access-Control-Allow-Headers' 'Range';

# allow CORS preflight requests

if ($request_method = 'OPTIONS') {

add_header 'Access-Control-Allow-Origin' '*';

add_header 'Access-Control-Allow-Headers' 'Range';

add_header 'Access-Control-Max-Age' 1728000;

add_header 'Content-Type' 'text/plain charset=UTF-8';

add_header 'Content-Length' 0;

return 204;

}

types {

application/vnd.apple.mpegurl m3u8;

video/mp2t ts;

}

root /mnt/;

}

}

After server was setup and configuration successful. you must use some rtmp encoder software (OBS, wirecast ...) for start streaming like youtube or twitchtv.

In client side (browser in your case) you can use Videojs or JWplayer to play video for end user. You can do something like below for Videojs:

Live Streaming

var player = videojs('#player');

You don't need to add others plugin like flash (because we use HLS not rtmp). This player can work well cross browser with out flash.

回答5:

It is not possible to use the RTMP protocol in HTML 5, because the RTMP protocol is only used between the server and the flash player. So you can use the other streaming protocols for viewing the streaming videos in HTML 5.

回答6:

You can use a fantastic library name Videojs. You will find more useful informations here. But with quick start you can do something like this:

id="Video"

class="video-js vjs-default-skin vjs-big-play-centered"

controls

preload="none"

width="auto"

height="auto"

poster="poster.jpg"

data-setup='{"techOrder": ["flash", "html5", "other supported tech"], "nativeControlsForTouch": true, "controlBar": { "muteToggle": false, "volumeControl": false, "timeDivider": false, "durationDisplay": false, "progressControl": false } }'

>

var player = videojs('Video');

player.play();

回答7:

Use ffmpeg + ffserver. It works!!!

You can get a config file for ffserver from ffmpeg.org and accordingly set the values.

回答8:

height="285" id="mediaPlayer" standby="Loading Microsoft Windows Media Player components..."

type="application/x-oleobject" width="360" style="margin-bottom:30px;">

height="285" id="mediaPlayer" loop="true" name="mediaPlayer" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"

showcontrols="true" showdisplay="0" showstatusbar="-1" showtracker="-1" src="mms://my_IP_Address:my_port"

type="application/x-mplayer2" videoborder3d="-1" width="360">

来源:https://stackoverflow.com/questions/5858936/html5-live-streaming

html5 live,HTML5 live streaming相关推荐

  1. 兄弟连html5在线画板,IT兄弟连 HTML5教程 HTML5做到了与之前版本的兼容

    原标题:IT兄弟连 HTML5教程 HTML5做到了与之前版本的兼容 为了保证HTML5能与之前的HTML版本达到最大的兼容,HTML5对一些元素标记的省略.boolean值的属性,以及引号的省略这几 ...

  2. 对html5的了解,HTML5——对HTML5的认识

    首先非常感谢李刚老师出的这本书<HTML5/CSS3/JavaScript讲义>,今天读了第一章节的内容,趁热打铁,总结一下. HTML5的时代已经到来,它对所有的前端开发人员来说是一种福 ...

  3. html5发展前景-兄弟连,IT兄弟连 HTML5教程 HTML5的曲折发展过程 HTML5的诞生

    原标题:IT兄弟连 HTML5教程 HTML5的曲折发展过程 HTML5的诞生 十年磨一剑,正如我们所看到的一样,HTML5大潮正来势汹汹.但也正如我们所知道的一样,HTML5是一种技术标准,它的语义 ...

  4. 下列关于html5表单的多样输入方式,IT兄弟连 HTML5教程 HTML5表单 多样的输入类型1...

    原标题:IT兄弟连 HTML5教程 HTML5表单 多样的输入类型1 HTML5拥有多个新的表单输入类型,这些新特性提供了更好的输入控制和验证.并不是所有的主浏览器都支持新的input类型,不过我们可 ...

  5. 这不仅仅是html5的HTML5问题

    这不仅仅是html5的HTML5问题,它还关系到了我们应该如何工作这类原则性的问题,css working group更青睐于使用www-风格的输入.因为目标人群是web开发者,所以lea并不担心向后 ...

  6. css html5简介,HTML5 简介......

    HTML5 示例 实例 Your browser does not support the video tag. 什么是 HTML5? HTML5 简介 HTML5 是最新的 HTML 标准. HTM ...

  7. html5代码好学吗,0基础能学习Html5吗?Html5好学吗?

    原标题:0基础能学习Html5吗?Html5好学吗? 0基础可以学习Html5吗?这两年一直是被挂在嘴边的话题,随着人们对用户体验的要求越来越高,前端开发技术难度越来越大,所以对于IT从业者来讲,前端 ...

  8. 免费html5代码,HTML5(示例代码)

    一.什么是HTML5 1.1 HTML5 简介 万维网的核心语言.标准通用标记语言下的一个应用超文本标记语言(HTML)的第五次重大修改,作为新HTML语言,具有新的元素.属性和行为 XHTML可扩展 ...

  9. 200套工作室设计行业响应式Html5模板HTML5+CSS3设计网站模板简洁设计师作品展示响应式模板整洁扁平宽屏CSS3网站模板html5网页静态模板Bootstrap扁平化网站源码css3手机se

    200套工作室设计行业响应式Html5模板HTML5+CSS3设计网站模板简洁设计师作品展示响应式模板整洁扁平宽屏CSS3网站模板html5网页静态模板Bootstrap扁平化网站源码css3手机se ...

  10. 一个html基本写法,HTML5教程:HTML5的基础写法

    HTML5教程:HTML5的基础写法 对比一下XHTML 1.0 Transitional的规范,html5基本上没有XHTML 1.0 Transitional严格的要求,并且简化了很多东西. •文 ...

最新文章

  1. 用rand_7()实现rand_10()
  2. Vim - 文本替换
  3. JAVA碰撞检测无效_碰撞检测不适用于Pygame中的精灵
  4. hibernate连接mysql配置文件 分享
  5. 关掉内核线程linux,c – 如何在rmmod上停止Linux内核线程?
  6. CLR 4.0有哪些新东西? -- 状态错乱异常 Corrupted state Exception
  7. visio软件接口流程图_使用VISIO软件绘制系统框图及流程图的方法
  8. 【学习体会】Lighttools8.4.0:软件基本使用+光度学基本概念+系统初始设置
  9. 中国微电网市场趋势报告、技术动态创新及市场预测
  10. Eplan教学视频合集-百度网盘-收集于网络
  11. 蓝桥杯 基础练习 特殊回文数 JAVA
  12. 742. Closest Leaf in a Binary Tree的思路
  13. Python数据可视化Part 5-Matplotlib 3D图片与投影教学-代码详解
  14. 眨眼照片变名画,华为P20,创造着艺术,也是艺术本身
  15. Monkey测试教程
  16. jdk11手动安装jre
  17. 彻底卸载服务器上的Oracle
  18. iOS15上线图片翻译功能,能取代专业翻译软件吗?
  19. 计算机计划300字作文,计划作文300字七篇
  20. 生成微信支付接口的签名工具

热门文章

  1. JavaScript验证身份证号码(15位/18位)
  2. java queue GATK_GATK使用简介{转}
  3. Springboot集成Screw生成数据库表结构文档
  4. 10款微信公众平台相关的开源软件
  5. qt调用vc编写库文件的方法
  6. html5小猫钓鱼游戏思路,小猫钓鱼的游戏算法
  7. 过滤微信特殊字符名称
  8. 苹果电脑mp3转gif_用苹果电脑做gif动图的方法终于找到了...
  9. imac 升级 ssd_如何在较旧的2007-2009 iMac中安装SSD
  10. 使用fedora32桌面图标