docker部署kplayer直播推流
docker run -td \
--name kplayer \
-v $(pwd)/video:/video \
-v $(pwd)/config.json:/kplayer/config.json \
-v $(pwd)/kplayer/cache:/kplayer/cache \
--restart=always \
bytelang/kplayer:latest
kplayer配置文件
{
"version": "2.0.0",
"resource": {
"lists": [
"/video/"
],
"extensions": ["mp4"]
},
"output": {
"lists": [
{
"path": "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx"
}
],
"reconnect_internal": 5
},
"play": {
"fill_strategy": "ratio",
"skip_invalid_resource": true,
"cache_on": true,
"play_model": "random"
}
}
youtube推流地址
rtmp地址格式为(url+key):rtmp://a.rtmp.youtube.com/live2/xxx-xxx-xxx-xxx/,假如你的密钥(点击显示即可查看密钥)为:
gz6b-xfu4-bt4u-dd12,那么你的推流格式为:rtmp://a.rtmp.youtube.com/live2/gz6b-xfu4-bt4u-dd12/
参考资料:
https://juejin.cn/post/7250405870936080444
https://www.u11u.com/basic/rtmp-youtube-url-format.html
https://blog.51cto.com/u_15652665/6408722
https://docs.kplayer.net/v0.5.8/config/resource.html
License:
CC BY 4.0