This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 1. logcat如何查看时间戳 | |
adb logcat -v threadtime | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
location /ws/ { | |
proxy_pass http://127.0.0.1:1982; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. FFMPEG 编程开发教程 | |
地址:http://dranger.com/ffmpeg/tutorial01.html | |
* AVPicture 是 AVFrame的子集,即两个数据结构的前面部分是一致的, 因此AVFrame可以指针转换为AVPicture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 如何使用emscripten | |
## 1.下载emsdk,并且利用emsdk下载对应的二进制工具 | |
https://developer.mozilla.org/en-US/docs/Emscripten/Download_and_install | |
## 配置emsdk | |
在下载esmsdk_portable目录下,执行: | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
最简单使用libSVM,只需要指定2个参数,即C和RBF核函数的Sigma,训练命令行如下: | |
./svm-train -s 0 -c 0.5 -g 0.1 test test.model | |
生成模型文件,支持向量的第一项为 y(i)*alpha(i), 例如: | |
``` | |
svm_type c_svc %分类SVM | |
kernel_type rbf %RBF核函数 | |
gamma 0.1 %gamma 对应 高斯核函数sigma 1/(2*sigma^2) = gamma | |
nr_class 2 %2分类 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmepg 分割视频 注意-ss -t参数顺序 | |
-ss 必须放在 -i 之前, -t 必须放在 -i 之後! | |
一个转码实例: | |
~/opt/ffmpeg/bin/ffmpeg -ss 00:00:10 -i planet.mp4 -t 00:00:05 -vcodec libx264 -crf 20 -acodec libfaac ~/Downloads/a.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X264对应的编译: | |
.configure —disable-asm —enable-shared --prefix=/Users/teaonly/opt/ffmpeg/ | |
make;make install | |
libaac 也需要按上面的配置编译,并且安装到相同的制定目录 | |
为了支持pkg-config的文件,需要将PKG_CONFIG_PATH配置对。 | |
FFMPEG的对应编译: | |
./configure --disable-yasm --enable-shared --enable-libx264 --enable-gpl --enable-libfaac --enable-nonfree --enable-debug --extra-cflags=-I/Users/teaonly/opt/ffmpeg/include/ --extra-ldflags=-L/Users/teaonly/opt/ffmpeg/lib/ --prefix=/Users/teaonly/opt/ffmpeg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
采用文件列表的方法: | |
1. 编辑file.list | |
``` | |
file 1.mp4 | |
file 2.mp4 | |
``` | |
ffmpeg 命令 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 如何配置nginx/php/node.js | |
在OS X下默认已经安装好PHP和 PHP-fpm (即fastcgi for PHP)两个软件,node.js和nginx则通过homebrew 安装。 | |
安装较为简单,关键是配置文件 | |
## 配置php-fpm | |
生成配置文件 | |
``` | |
cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf | |
cp /usr/local/etc/nginx/fastcgi.conf.default /usr/local/etc/nginx/fastcgi.conf | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function yuv2canvas(yuv, width, height, canvas) { | |
/* | |
canvas.width = width; | |
canvas.height = height; | |
*/ | |
context = canvas.getContext("2d"); | |
output = context.createImageData(width, height); | |
outputData = output.data; | |
yOffset = 0; |
NewerOlder