All Projects → Tinywan → Php Practice

Tinywan / Php Practice

Licence: mit
🌹 一天一点点,积少成多...

Projects that are alternatives of or similar to Php Practice

Awesome Live Stream
Webrtc && Nginx && DASH && Quic 学习资料收集,持续更新中
Stars: ✭ 290 (-17.38%)
Mutual labels:  ffmpeg, hls, rtmp
Janus Webrtc Gateway Docker
Perfect Docker Image for Media Streaming Expert User ( https://github.com/meetecho/janus-gateway )
Stars: ✭ 582 (+65.81%)
Mutual labels:  ffmpeg, hls, rtmp
Rtmp Ts Dash Webrtc
👾 音视频解决方案 Audio and video solutions(AV1)
Stars: ✭ 129 (-63.25%)
Mutual labels:  ffmpeg, hls, rtmp
Docker Nginx Rtmp
🐋 A Dockerfile for nginx-rtmp-module + FFmpeg from source with basic settings for streaming HLS. Built on Alpine Linux.
Stars: ✭ 608 (+73.22%)
Mutual labels:  ffmpeg, hls, rtmp
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+7701.14%)
Mutual labels:  ffmpeg, hls, rtmp
Ffplayout Engine
python and ffmpeg based playout
Stars: ✭ 128 (-63.53%)
Mutual labels:  ffmpeg, hls, rtmp
smart rtmpd
RTMP server, smart, compact, high performance(c, c++), high concurrency, easy to maintain, easy to deploy, (supports multiple operating systems Windows and Linux, ARM, FreeBSD)
Stars: ✭ 159 (-54.7%)
Mutual labels:  ffmpeg, hls, rtmp
livego
直播服务器 hls stream online RTMP AMF HLS HTTP-FLV
Stars: ✭ 30 (-91.45%)
Mutual labels:  hls, rtmp
Huong-dan-cai-dat-stream-server-va-chuyen-doi-video-sang-streaming
Hướng dẫn cài đặt stream server và chuyển đổi video thường sang dạng TS Streaming
Stars: ✭ 29 (-91.74%)
Mutual labels:  ffmpeg, hls
SharpGrabber
Download from YouTube, Vimeo, PornHub, HLS (M3U8 files) with .NET and JavaScript, Library and desktop app for downloading high quality media
Stars: ✭ 138 (-60.68%)
Mutual labels:  ffmpeg, hls
Python Ffmpeg Video Streaming
📼 Package media content for online streaming(DASH and HLS) using FFmpeg
Stars: ✭ 269 (-23.36%)
Mutual labels:  ffmpeg, hls
wsa
WSA(Websocket Streaming Agent) is a stream server target for mp4/h264 streaming over websocket
Stars: ✭ 35 (-90.03%)
Mutual labels:  hls, rtmp
browserLiveStream
Use webcam, browser and Node to stream live video. From api.video (https://api.video)
Stars: ✭ 141 (-59.83%)
Mutual labels:  hls, rtmp
Dockerfiles
Optimized media, analytics and graphics software stack images. Use the dockerfile(s) in your project or as a recipe book for bare metal installation.
Stars: ✭ 98 (-72.08%)
Mutual labels:  ffmpeg, rtmp
sms
rtmp server and super media server whith golang.
Stars: ✭ 65 (-81.48%)
Mutual labels:  hls, rtmp
Zlmediakit
WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181 server and client framework based on C++11
Stars: ✭ 5,248 (+1395.16%)
Mutual labels:  hls, rtmp
cassandra-nginx-cdn
Some config files and POC code to use Apache Cassandra as distributed storage for HLS chunks accross multiple datacenters and scripts for converting/transcoding UDP MPEG-TS to HLS and vice versa. The idea is take from Globo.com’s Live Video Platform for FIFA World Cup ’14.
Stars: ✭ 24 (-93.16%)
Mutual labels:  ffmpeg, hls
Egg Commerce
Stars: ✭ 264 (-24.79%)
Mutual labels:  redis, alipay
Dokit
基于 Spring Boot2、 Jpa、 Spring Security、JWT、redis、Vue的前后端分离的后台管理系统开发平台, 用户管理、菜单管理、角色管理、字典管理、权限控制的方式为RBAC,操作日志、异常日志、接口限流、项目支持数据权限管理,支持一键生成前后端代码(支持在线预览及打包下载),支持前端菜单动态路由 可一键部署服务器应用,数据库。系统中活跃用户状态监控,监视当前系统CPU、内存、磁盘、堆栈等相关信息,基于Element UI在线表单设计及生成Vue代码。
Stars: ✭ 348 (-0.85%)
Mutual labels:  redis, rbac
Blog.core
💖 ASP.NET Core 6.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
Stars: ✭ 3,542 (+909.12%)
Mutual labels:  redis, rbac

Tinywan GitHub stars image
image

Work experience based on ThinkPhp framework

    主要有视频播放器插件、阿里云OSS存储、支付宝即时到账接口、Redis缓存、PHPmailer批量发送邮件、Monolog 日志工具、ECharts图表库、PDO预处理、PHP-FFmpeg、WebSocket、无限级分类、RBAC、AngularJS等等


image

流媒体、视频编码、直播流测试库

  • 2016杭州·云栖大会集锦
    • https://vodcdn.alicdn.com/oss/taobao-ugc/1dde6e764244406cbe5962b26eee078c/1476754829/video.mp4
  • 阿里巴巴王坚完整版视频
    • https://vodcdn.alicdn.com/oss/taobao-ugc/e6fb60eae8594f9e812233489bfa2732/1476578718/video.mp4
  • RTMP协议直播源 
    • 亚太第一卫视(RTMP流) rtmp://v1.one-tv.com/live/mpegts.stream
    • 香港电视台直播 rtmp://live.hkstv.hk.lxdns.com/live/hks
    • 亚太卫视 rtmp://58.61.150.198/live/Livestream
    • 香港卫视公开的拉流地址 rtmp://live.hkstv.hk.lxdns.com/live/hks
    • 香港卫视公开的推流地址 rtmp://live.hkstv.hk.lxdns.com/live/tinywan123456
    • 香港卫视公开的推流测试地址 rtmp://live.hkstv.hk.lxdns.com/live/tinywan123456
  • RTSP协议直播源 
    • rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov
  • HTTP协议直播源 
    • 香港卫视 http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8
    • CCTV1高清 http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8
    • CCTV5高清 http://ivi.bupt.edu.cn/hls/cctv5hd.m3u8
    • 杭康 http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8

FFmpeg录制、转换以及流化音视频的解决方案

  • 更多FFmpeg 命令相关文档

  • 将网络直播源(RTMP流)拉取到内网(本地文件),切片成m3u8+ts

    • ffmpeg -i rtmp://live.hkstv.hk.lxdns.com/live/hks -f hls -hls_list_size 5 -hls_time 10 -hls_wrap 10 ./live.m3u8
  • FFmpeg 自动截取直播图片

    • ffmpeg -i rtmp://live.hkstv.hk.lxdns.com/live/hks -vframes 1 -y -f image2 -t 1 -s 600x480 $path/autoCli.jpg
  • FFmpeg的转码延时测试与设置优化,ffmpeg设置转码延时的参数和步骤如下:

    关闭sync-lookahead
    降低rc-lookahead,但别小于10,默认是-1
    降低threads(比如从12降到6)
    禁用rc-lookahead
    禁用b-frames
    缩小GOP,
    开启x264的 -preset fast/faster/verfast/superfast/ultrafast参数
    使用-tune zerolatency 参数

    • 测试案例(延时大概在0.2 -- 0.6 秒):
    • ./ffmpeg -i rtmp://192.168.1.12/live/src -tune zerolatency -vcodec libx264 -preset ultrafast -b:v 400k -s 720x576 -r 25 -acodec libfaac -b:a 64k -f flv rtmp://192.168.1.12/live/dst
  • 将本地摄像头RTSP流拉取到公网RTMP流(默认使用UDP协议传送)

    • ffmpeg -i rtsp://192.168.18.240:554/onvif/live/1 -c:a copy -c:v libx264 -f flv "rtmp://公网IP地址/live/tinywan123"
  • 将本地摄像头RTSP流拉取到公网RTMP流(TCP协议传送)

    • ffmpeg -rtsp_transport tcp -i rtsp://admin:[email protected]:554/h264/ch1/main/av_stream -c:a copy -c:v libx264 -f flv rtmp://公网IP地址/live/tinywan123
  • 将rtmp流,以文件的形势保存到本地

    • ffmpeg -i "rtmp://tinywan.www.com/live123/4008899 live=1" -acodec copy -vcodec copy -f flv -y F:\Tinywan\Video\RTMPtest2test.flv
  • 列出本机的设备

    • ffmpeg -list_devices true -f dshow -i dummy
  • FFmpeg进行笔记本摄像头+麦克风实现流媒体直播服务

    • ffmpeg -f dshow -i video="Lenovo EasyCamera":audio="麦克风 (Realtek High Definition Audio)" -vcodec libx264 -acodec copy -preset:v ultrafast -tune:v zerolatency -f flv "rtmp://aitech.com/live/tinywan123"
  • 将本地摄像头RTSP流拉取到公网EasyDarwin流媒体服务器,播放RTSP流(TCP协议传送)

    • 推流模式:ffmpeg -i "rtsp://192.168.18.240:554/onvif/live/1" -vcodec copy -acodec copy -rtsp_transport tcp -f rtsp "rtsp://114.55.107.180:10554/tinywan123.sdp"
    • 播放地址:rtsp://114.55.107.180:10554/tinywan123.sdp

公共脚本库

  • Bootstrap/css http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css
  • Bootstrap/js http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js
  • Jquery http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js
  • Angular http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js

最新的以ThinkPHP为WEB应用开发提供功能

  • [x] 基于角色的RBAC权限管理
  • [x] 基于类的无限级分类和数据库的无限级分类
  • [x] 基于角色的RBAC权限管理
  • [x] 基于类的无限级分类和数据库的无限级分类
  • [x] 非关系性数据库Redis
  • [x] 存储数据形成消息队列 Home/DataBaseController/createRedisList
  • [x] 消息队列元素大于10000时,批量插入到Mysql数据库 Home/DataBaseController/RedisSaveToMysql
  • [x] 读取缓存数据 Home/DataBaseController/findDataRedisOrMysql
  • [x] 多级模块化的管理
  • [x] Uploadify图片上传DEMO
  • [x] PHPmailer批量发送邮件
  • [x] 支付宝即时到账接口开发 Api/AliPayController/Index
  • [x] 用户注册邮箱激活和邮箱密码修改 Library/EmailController/Index
  • [x] AngularJS 框架 Home/AngularJSController
  • [x] Monolog 日志记录工具 Home/MonoLogController
  • [x] ECharts 统计工具 Home/EChartsController
  • [x] PDO 数据库抽象层 Home/DataBaseController/pdoExample1
    • [x] 陷阱

      PDO::PARAM_INT,PDOStatement::bindParam的一个陷阱
      Home/DataBaseController/PDOStatementBindParam2

    • [ ] 优化
  • [x] Socket 服务器框架GatewayWorker Home/GatewayWorker
  • [x] WebSocket HTML5/WebSocketController
  • [x] PHP-FFmpeg视频编码处理
    • [x] 读取视频、设置视频大小
    • [x] 视频编码h264
    • [x] 获取一个视频的时长、宽度、高度等基本信息
    • [x] MP4格式=>MP3格式转换
    • [x] 提取单张、多张图像
    • [x] 视频剪切
    • [x] 转码进度实时监控
    • [x] 提取GIF动画图像
    • [ ] 视频旋转到给定的角度
    • [ ] 视频水印
  • [x] 数据依赖缓存Cache(Yii2.0文件依赖思想) Home/CacheController
  • [x] Intervention Image 基本用法 Home/ImageController
  • [x] Faker生成测试数据的PHP库 Home/FakerController
  • [x] 一个简单的APi接口签名方法 Home/SignEncryptController
  • [x] Mobile_Detect是一个轻量级的PHP类,用于检测移动设备 Home/MobileController
  • [ ] E=mc
  • [x] PHP标准的HTML过滤器: Home/HtmlController/complexFilter
  • [x] [PHP的机器学习库](PHP-ML - Machine Learning library for PHP)
    • [x] PHP >= 7.0
    • [ ] 算法
    • [ ] 交叉验证
    • [ ] 视频编码h神经网络
    • [ ] 预处理
  • [x] HTTP请求库
  • [x] PHP Curl类可以轻松地发送HTTP请求并与Web API集成

jwplayer 播放器ajax同步获取播放地址

var default_stream_address;
function testPlay(name) {
    var url = 'http/127.0.0.1/getplay_rtmp_address';
    var data = {
        'name' : name
    };
    var success = function(response){
        default_stream_address = response;
        console.log(default_stream_address);
    };
    $.ajax({
        url:url,
        type:'get',
        data:data,
        dataType:'json',
        async:false,
        success:success
    });
    $("#testPlayModal").modal("show");
    console.log(111111111111111)
    console.log(default_stream_address)
    console.log(2222222222222222222)
    jwplayer("my-video").setup({
        file: default_stream_address,
        image: "/res/streaming/img/amai-logo-01.jpg",
        width: "100%",//580
        height: "370",//370
        hlshtml: true,
        autostart: true //自动播放
    });
}

常用单利模式调用

  • [x] Redis单利模式:RedisInstance::Instance
  • [x] PDO单利模式:PDOInstance::Instance
  • [x] OSS单利模式:OssInstance::Instance
  • [x] MonoLog单利模式:MonoLogInstance::Instance

支付功能

  • 支付宝支付
    • [x] 即时到帐
    • [ ] 手机网站
    • [ ] 移动支付
    • [ ] 订单查询
    • [ ] 退款
    • [ ] 转款
  • 微信支付
    • [ ] APP支付
    • [ ] 公众号支付
    • [ ] 扫码支付

视频播放插件

播放器 代码路径 RTMP延迟 HLS延迟 FLV延迟 描述
Sewise HTML5/SewiseController/Index 20s 30s 20s ~
JPlayer HTML5/JPlayerController/Index 15s 30s 20s ~
Jwplayer HTML5/JwplayerController/Index 15s 30s 20s ~
SwfObject HTML5/SwfObjectController/Index 1~2S 30s 20s 推荐
Video HTML5/VideoController/Index 15s 30s 20s ~
VideoJS HTML5/VideoJSController/Index 3~5S 30s 20s 推荐

Google

doodle

VideoJs插件播放一个RTMP视频流

 <link href="__PUBLIC__/lib/video-js/video-js.css" rel="stylesheet">
 <script src="__PUBLIC__/lib/video-js/video.js"></script>
 <script>
     videojs.options.flash.swf = "__PUBLIC__/lib/video-js/video-js.swf"
 </script>
 <video 
    id="livestream" 
    class="video-js vjs-default-skin vjs-big-play-centered"
    controls autoplay preload="auto" width="1280" height="720"
    data-setup='{"example_option":true}'>
    <source src="rtmp://live.hkstv.hk.lxdns.com/live/hks" type="rtmp/mp4"></source>
 </video>

常用Shell脚本

  •  凌晨备份昨天的日志,放在该日期的月份目录下面,同时以昨天的时间为后缀名
    Shell文件夹/Logs文件夹/auto_backup_logs_del_current.sh
  •  RTMP模块的分发服务器分发本地流到各个节点服务器上去
    Shell文件夹/Logs文件夹/auto_backup_logs_del_current.sh
  •  每隔10分钟把每个活动对应的评论和礼物数量同步到MySQL数据库中去
    Shell文件夹/Redis文件夹/comment_redis_pdo.sh
  •  每隔10分钟把每个活动对应的评论和礼物数量同步到MySQL数据库中去
    Shell文件夹/Redis文件夹/comment_redis_pdo.sh
  •  Nginx RTMP录像自动上传到阿里云oss存储
    Shell文件夹/Rtmp文件夹/rtmpRecordedNotify.sh

What is he thinking about?

Tinywan

Git工作流指南:Gitflow工作流

Tinywan

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].