流媒体服务器 php,nginx 流媒体服务器 FFmpeg 截图
預(yù)備:
yum install -y automake autoconf libtool gcc gcc-c++
1.安裝php
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-devel php-fpm
2.安裝 nginx
yum –y install nginx nginx-devel
3.安裝FFmpeg
安裝 Install ffmpeg 等模塊
yum -y install ffmpeg ffmpeg-devel
4.安裝 php ffmpeg 擴(kuò)展
tar jxvf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
phpize
./configure
make
make install
切換到 php.d
生成 ffmpeg.ini文件 內(nèi)容:extension=ffmpeg.so
5.安裝yamdi
yadmi的作用是為flv文件添加關(guān)鍵幀,才能實(shí)現(xiàn)拖動(dòng)播放
#下載yadmi
#安裝yadmi
tar xzvf yamdi-1.4.tar.gz
cd yamdi-1.4
make && make install
使用方法:yamdi -i input.flv -o out.flv
6.配置nginx
http {
include?????? mime.types;
default_type? application/octet-stream;
log_format main? ‘$remote_addr – $remote_user [$time_local] ‘
‘"$request" $status $bytes_sent ‘
‘"$http_referer" "$http_user_agent" ‘
‘"$gzip_ratio"’;
keepalive_timeout? 60;
server_names_hash_bucket_size? 128;
client_header_buffer_size??? 32k;
large_client_header_buffers? 4 32k;
access_log off;
gzip on;
gzip_min_length? 1100;
gzip_buffers???? 4 8k;
gzip_types?????? text/plain;
output_buffers?? 1 32k;
postpone_output? 1460;
client_header_timeout? 3m;
client_body_timeout??? 3m;
send_timeout?????????? 3m;
sendfile??????????????? on;
tcp_nopush????????????? on;
tcp_nodelay???????????? on;
######################################################################
server {
listen?????? 80;
server_name? 192.168.1.145;
root??? /var/www/html/flv/;
limit_rate_after 5m;??? ####在flv視頻文件下載了5M以后開始限速
limit_rate 512k;???????? ####速度限制為512K
index?? index.html;
charset utf-8;
location ~ \.flv {
flv;
}
error_page?? 500 502 503 504? /50x.html;
location = /50x.html {
root?? html;
}
}
}
7.重啟php-fpm? nginx 測試
下載開源的JW Player,上傳 測試 12.flv視頻
8.生成時(shí)間截圖:
ffmpeg -i 12.flv -y -f mjpeg -ss 3 -vframes 1 -t 0.2 -s 320×240 test.jpg
9.瀏覽器訪問測試
type:協(xié)議類型
file:視頻源文件
image:視頻截圖文件
最后編輯:2015-01-04作者:sunny5156
喜歡技術(shù)....
總結(jié)
以上是生活随笔為你收集整理的流媒体服务器 php,nginx 流媒体服务器 FFmpeg 截图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux安全加固(linux系统安全加
- 下一篇: 锁匠备案证书图片(锁匠备案)