每周散记 20190324

* cloud studio  腾讯云端开发环境

https://studio.dev.tencent.com

*  app 直播体系

https://github.com/stlndm/linke 

* udp 验证
推流:
ffmpeg -f dshow -i video="screen-capture-recorder" -r 5 -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -s 320x240 -f h264 udp://127.0.0.1:6666
播放:
ffplay udp://127.0.0.1:6666

推流:
ffmpeg -f dshow -i video="screen-capture-recorder" -r 5 -vcodec mpeg2video -f mpeg2video -s 320x240 -f h264 udp://127.0.0.1:6666
播放:
ffplay -vcodec mpeg2video udp://127.0.0.1:6666
问题: 延迟大 3-4s

* rtp 未通过
推流:
ffmpeg -f dshow -i video="screen-capture-recorder" -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -s 320x240 -f rtp rtp://127.0.0.1:6666 >rtp.sdp
播放:
ffplay rtp://127.0.0.1:6666
ffplay rtp://127.0.0.1:5004

参考: https://blog.csdn.net/leixiaohua1020/article/details/38284961

# 查看数据量大的表
use information_schema;
select table_name, table_rows from tables where TABLE_SCHEMA = 'db_xxx' order by table_rows desc;
# 截取文件一部分
tail -n 2000 xxxx.log> test.log
# 文件下载
scp root@123.56.xxx.xx:/home/wwwlogs/xxxx.log /tmp/

php和js 数组
js 数组真正的数组,编号序列key只能是数字。实质为对象类型。
php 数组一个有序映射。映射是一种把 values 关联到 keys 的类型。可以是真正的
数组

1. 定义和获取元素
js: var arr = ['a', 'b', 'c'];
arr[0] // 'a'

php: $arr = ['a', 'b', 'c']; // 5.4 起可以使用短数组定义语法,用 [] 替代 array()。
var $arr = ['a'=>1, 'b'=>2, 'c'=>3];
var $arr = array('a'=>1, 'b'=>2, 'c'=>3);
key 可以是 integer 或者 string。value 可以是任意类型。
key 会有如下的强制转换:
* 有合法整型值的字符串,浮点数,布尔值会被转换成整型。
* Null转为""

调试方法:
http://sandbox.onlinephpfunctions.com
js 控制台
右键审查元素或ctrl+shift+i

参考:
http://javascript.ruanyifeng.com/grammar/array.html

原文地址:https://www.cnblogs.com/swing07/p/10590622.html