当前位置:网站首页>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
边栏推荐
- Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)
- Handwritten Google's first generation distributed computing framework MapReduce
- Database query - course selection system
- Shanda Wangan shooting range experimental platform project - personal record (V)
- R语言survival包coxph函数构建cox回归模型、ggrisk包ggrisk函数和two_scatter函数可视化Cox回归的风险评分图、解读风险评分图、基于LIRI数据集(基因数据集)
- NC basic usage 1
- Remote code execution in Win 11 using wpad / PAC and JScript 1
- Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
- SRS deployment
- 使用 WPAD/PAC 和 JScript在win11中进行远程代码执行
猜你喜欢

DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind

Distinction between pointer array and array pointer

Leetcode XOR operation

MySQL 进阶 锁 -- MySQL锁概述、MySQL锁的分类:全局锁(数据备份)、表级锁(表共享读锁、表独占写锁、元数据锁、意向锁)、行级锁(行锁、间隙锁、临键锁)

SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习

Servlet learning notes

Sqoop imports tinyint type fields to boolean type

selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT

antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题

Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 127
随机推荐
CVPR 2022 | querydet: use cascaded sparse query to accelerate small target detection under high resolution
PCL点云处理之基于PCA的几何形状特征计算(五十二)
渤海期货这家公司怎么样。期货开户办理安全?
Electron入门教程4 —— 切换应用的主题
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码
Kubernetes introduction to mastery - ktconnect (full name: kubernetes toolkit connect) is a small tool based on kubernetes environment to improve the efficiency of local test joint debugging.
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
nc基础用法4
The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
R language uses timeroc package to calculate the multi time AUC value of survival data under competitive risk, uses Cox model and adds covariates, and R language uses the plotauccurve function of time
R language uses econocrats package to create microeconomic or macroeconomic map, visualize indifference function indifference curve, customize calculation intersection, and customize the parameters of
An error is reported when sqoop imports data from Mysql to HDFS: sqlexception in nextkeyvalue
JDBC tool class jdbcconutil gets the connection to the database
Shanda Wangan shooting range experimental platform project - personal record (V)
Unity 模型整体更改材质
論文寫作 19: 會議論文與期刊論文的區別
How to do product innovation—— Exploration of product innovation methodology I
DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
Introduction to electron Tutorial 4 - switching application topics
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码