一、视频处理FFmpeg和video-thumbextractor
一、nginx+video-thumbextractor生成视频缩略图安装所需的环境
1、安装ImageMagick
yum install
2、安装libjpeg
wget https://github.com/yasm/yasm/archive/master.zip
unzip master.zip
cd yasm-master
./autogen.sh
make
make install
3、安装ffmpeg
wget http://ffmpeg.org/releases/ffmpeg-3.3.3.tar.gz
tar -xzvf ffmpeg-3.3.3.tar.gz
cd ffmpeg
#配置参数,不同版本不同(注意)/configure --prefix=/usr/local/ffmpeg-3.3.3 --enable-shared --disable-ffserver --disable-ffplay --enable-postproc --enable-gpl
make
make install
4、安装nginx
wget https://codeload.github.com/wandenberg/nginx-video-thumbextractor-module/zip/master -O nginx-video-thumbextractor-module-master.zip
unzip nginx-video-thumbextractor-module-master.zip
yum install gcc make git libgcc libstdc++ subversion ruby ncurses-devel -y
yum -y install openssl openssl-devel gd gd-devel
yum -y install lua-devel pcre pcre-devel
wget http://nginx.org/download/nginx-1.14.1.tar.gz
tar -xzvf nginx-1.14.1.tar.gz
cd nginx-1.14.1
./configure --prefix=/usr/local/nginx-1.14.1 --with-http_image_filter_module --with-http_stub_status_module --with-http_ssl_module --add-module=../nginx-video-thumbextractor-module-master --with-cc-opt='-I /usr/include/ImageMagick' --with-http_sub_module --with-ld-opt="-L /usr/local/ffmpeg/lib" --with-cc-opt="-I /usr/local/ffmpeg/include"
make
make install
5、Nginx的配置
server {
listen 80;
server_name wzs.test.com/;
access_log /data/logs/nginx/wzs.test.com.access.log main;
index index.html index.php index.html;
root /data/site/wzs.test.com;
location / {
}
location ~ /2687/(.*)
{
alias /data/site/wzs.test.com/2687/;
video_thumbextractor;
video_thumbextractor_video_filename $1;
video_thumbextractor_video_second $arg_second;
video_thumbextractor_image_width $arg_width;
video_thumbextractor_image_height $arg_height;
}
}
二、nginx+video-thumbextractor生成视频缩略图实战
三、FFmpeg
1、FFmpeg源代码简单分析:configure
2、FFmpeg简单使用