当前位置:网站首页>Livego + ffmpeg + RTMP + flvjs to realize live video
Livego + ffmpeg + RTMP + flvjs to realize live video
2022-04-23 20:16:00 【_ Carpediem】
1. download livego
Packed livego Binary executable
Baidu SkyDrive ( Extract password :1234
Opening service ( double-click livego.exe)
Enter... In the browser http://localhost:8090/control/get?room=movie Get a room channelkey(channelkey For streaming ,movie Customizable , For playing ). Copy channelkey
Start pushing
2. download ffmpeg
Configure environment variables
Enter the command :
ffmpeg -re -i { Videos to push } -c copy -f flv rtmp://localhost:1935/{appname}/{channelkey}
eg:ffmpeg -re -i demo.flv -c copy -f flv rtmp://localhost:1935/live/rfBd56ti2SMtYvSgD5xAV0YU99zampta7Z7S575KLkIZ9PYk
4.flvjs
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>flv.js demo</title>
<style>
.mainContainer {
display: block;
width: 1024px;
margin-left: auto;
margin-right: auto;
}
.urlInput {
display: block;
width: 100%;
margin-left: auto;
margin-right: auto;
margin-top: 8px;
margin-bottom: 8px;
}
.centeredVideo {
display: block;
width: 100%;
height: 576px;
margin-left: auto;
margin-right: auto;
margin-bottom: auto;
}
.controls {
display: block;
width: 100%;
text-align: left;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<div class="mainContainer">
<video id="videoElement" class="centeredVideo" controls autoplay width="1024" height="576">Your browser is too old which doesn't support HTML5 video.</video>
</div>
<br>
<div class="controls">
<!--<button onclick="flv_load()"> load </button>-->
<button onclick="flv_start()"> Start </button>
<button onclick="flv_pause()"> Pause </button>
<button onclick="flv_destroy()"> stop it </button>
<input style="width:100px" type="text" name="seekpoint" />
<button onclick="flv_seekto()"> Jump </button>
</div>
<script src="./flv.js/flv.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/flv.js/1.5.0/flv.min.js"></script>
<script>
var player = document.getElementById('videoElement');
if (flvjs.isSupported()) {
var flvPlayer = flvjs.createPlayer({
type: 'flv',
"isLive": true,
url: 'http://127.0.0.1:7001/live/movie.flv',//<== Modify yourself
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load(); // load
flv_start();
}
function flv_start() {
player.play();
}
function flv_pause() {
player.pause();
}
function flv_destroy() {
player.pause();
player.unload();
player.detachMediaElement();
player.destroy();
player = null;
}
function flv_seekto() {
player.currentTime = parseFloat(document.getElementsByName('seekpoint')[0].value);
}
</script>
</body>
</html>
版权声明
本文为[_ Carpediem]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210553547035.html
边栏推荐
- Introduction to electron tutorial 3 - process communication
- 论文写作 19: 会议论文与期刊论文的区别
- Video understanding
- R语言survival包coxph函数构建cox回归模型、ggrisk包ggrisk函数和two_scatter函数可视化Cox回归的风险评分图、解读风险评分图、基于LIRI数据集(基因数据集)
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
- 还在用 ListView?使用 AnimatedList 让列表元素动起来
- How to do product innovation—— Exploration of product innovation methodology I
- 波场DAO新物种下场,USDD如何破局稳定币市场?
- LeetCode异或运算
- SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
猜你喜欢
Shanda Wangan shooting range experimental platform project - personal record (IV)
Kubernetes entry to mastery - bare metal loadbalance 80 443 port exposure precautions
antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题
Physical meaning of FFT: 1024 point FFT is 1024 real numbers. The actual input to FFT is 1024 complex numbers (imaginary part is 0), and the output is also 1024 complex numbers. The effective data is
LeetCode动态规划训练营(1~5天)
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
Grafana shares links with variable parameters
Unity general steps for creating a hyper realistic 3D scene
C6748 software simulation and hardware test - with detailed FFT hardware measurement time
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
随机推荐
Kubernetes entry to mastery - bare metal loadbalance 80 443 port exposure precautions
Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 64
How to do product innovation—— Exploration of product innovation methodology I
Shanda Wangan shooting range experimental platform project - personal record (V)
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
Five minutes to show you what JWT is
R language uses econocrats package to create microeconomic or macroeconomic map, visualize indifference function indifference curve, customize calculation intersection, and customize the parameters of
R语言使用caret包的preProcess函数进行数据预处理:对所有的数据列进行BoxCox变换处理(将非正态分布数据列转换为正态分布数据、不可以处理负数)、设置method参数为BoxCox
Design of warehouse management database system
NC basic usage 4
Confusion about thread blocking after calling the read () method of wrapper flow
An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
Understanding various team patterns in scrum patterns
nc基础用法2
Sqoop imports tinyint type fields to boolean type
Remote code execution in Win 11 using wpad / PAC and JScript 3
AQS learning
Intersection calculation of straight line and plane in PCL point cloud processing (53)