当前位置:网站首页>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
边栏推荐
- NC basic usage 1
- Remote code execution in Win 11 using wpad / PAC and JScript
- Record: call mapper to report null pointer Foreach > the usage of not removing repetition;
- Local call feign interface message 404
- SQL Server Connectors By Thread Pool | DTSQLServerTP 插件使用说明
- Building googlenet neural network based on pytorch for flower recognition
- PCA based geometric feature calculation of PCL point cloud processing (52)
- The R language uses the timeroc package to calculate the multi time AUC value of survival data without competitive risk, and uses the confint function to calculate the confidence interval value of mul
- Redis的安装(CentOS7命令行安装)
- 如何在BNB鏈上創建BEP-20通證
猜你喜欢
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (VII)
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
Distinction between pointer array and array pointer
LeetCode动态规划训练营(1~5天)
How to create bep-20 pass on BNB chain
PCL点云处理之计算两平面交线(五十一)
WordPress plug-in: WP CHINA Yes solution to slow domestic access to the official website
Kubernetes entry to mastery - bare metal loadbalance 80 443 port exposure precautions
Redis cache penetration, cache breakdown, cache avalanche
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
随机推荐
R language uses econocrats package to create microeconomic or macroeconomic map, visualize indifference function indifference curve, customize calculation intersection, and customize the parameters of
Cadence OrCAD capture batch change component packaging function introduction graphic tutorial and video demonstration
Compact CUDA tutorial - CUDA driver API
程序设计语言基础(2)
基于pytorch搭建GoogleNet神经网络用于花类识别
R语言ggplot2可视化分面图(facet_wrap)、使用lineheight参数自定义设置分面图标签栏(灰色标签栏)的高度
NC basic usage 3
Record: call mapper to report null pointer Foreach > the usage of not removing repetition;
[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码
Tencent Qiu Dongyang: techniques and ways of accelerating deep model reasoning
Redis distributed lock
Intersection calculation of straight line and plane in PCL point cloud processing (53)
MFC obtains local IP (used more in network communication)
R语言survival包coxph函数构建cox回归模型、ggrisk包ggrisk函数和two_scatter函数可视化Cox回归的风险评分图、解读风险评分图、基于LIRI数据集(基因数据集)
PHP reference manual string (7.2000 words)
Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration
An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
How about CICC fortune? Is it safe to open an account
使用 WPAD/PAC 和 JScript在win11中进行远程代码执行3