当前位置:网站首页>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
边栏推荐
- 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
- R language uses the preprocess function of caret package for data preprocessing: BoxCox transform all data columns (convert non normal distribution data columns to normal distribution data and can not
- IIS data conversion problem: 16bit to 24bit
- Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
- Compact CUDA tutorial - CUDA driver API
- How about CICC fortune? Is it safe to open an account
- Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (6)
- R语言使用caret包的preProcess函数进行数据预处理:对所有的数据列进行BoxCox变换处理(将非正态分布数据列转换为正态分布数据、不可以处理负数)、设置method参数为BoxCox
- [problem solving] 'ASCII' codec can't encode characters in position XX XX: ordinal not in range (128)
- Mysql database - single table query (II)
猜你喜欢
The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (VII)
[talkative cloud native] load balancing - the passenger flow of small restaurants has increased
STM32基础知识
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)
DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
Shanda Wangan shooting range experimental platform project - personal record (IV)
考研英语唐叔的语法课笔记
[text classification cases] (4) RNN and LSTM film evaluation Tendency Classification, with tensorflow complete code attached
随机推荐
R语言使用timeROC包计算存在竞争风险情况下的生存资料多时间AUC值、使用cox模型、并添加协变量、R语言使用timeROC包的plotAUCcurve函数可视化多时间生存资料的AUC曲线
Shanda Wangan shooting range experimental platform project - personal record (IV)
AQS learning
Notes of Tang Shu's grammar class in postgraduate entrance examination English
使用 WPAD/PAC 和 JScript在win11中进行远程代码执行1
[text classification cases] (4) RNN and LSTM film evaluation Tendency Classification, with tensorflow complete code attached
Distinction between pointer array and array pointer
nc基础用法2
MySQL advanced lock - overview of MySQL locks and classification of MySQL locks: global lock (data backup), table level lock (table shared read lock, table exclusive write lock, metadata lock and inte
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
Use test of FFT and IFFT library functions of TI DSP
Five minutes to show you what JWT is
CVPR 2022 | QueryDet:使用级联稀疏query加速高分辨率下的小目标检测
Remote code execution in Win 11 using wpad / PAC and JScript 1
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)
如何做产品创新?——产品创新方法论探索一
程序设计语言基础(2)
JDBC database addition, deletion, query and modification tool class
Electron入门教程3 ——进程通信