视频处理几个常用指令
--文字浮动
ffmpeg -vhook '/usr/lib64/vhook/imlib2.so -c red -F /usr/share/fonts/bitstream-vera/Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' -i input.flv -y -ab 32 -ar 22050 output.flv
--图片浮动
ffmpeg -i input.flv -y -vhook '/usr/lib64/vhook/imlib2.so -x W*(0.5+0.25*sin(N/47*PI))-w/2 -y H*(0.5+0.50*cos(N/97*PI))-h/2 -i watermark.png' -acodec copy -sameq output.flv
--图片切换
ffmpeg -i input.flv -y -vhook '/usr/lib64/vhook/imlib2.so -x gte(sin(N/100*PI),0)*W-w-30 -y 12 -i logo1.png' -vhook '/usr/lib64/vhook/imlib2.so -x gte(sin(N/100*PI),0)*W+30 -y 12 -i logo2.png' output.flv
--覆盖台标
mencoder -vf "delogo=0:0:88:30:3" -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=5000 -lavfopts format=flv -srate 44100 -oac lavc -lavcopts acodec=libmp3lame:abitrate=56 -o output.flv input.flv
mencoder -vf "delogo=0:0:88:30" -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=5000 -lavfopts format=flv -srate 44100 -oac lavc -lavcopts acodec=libmp3lame:abitrate=56 -o output.flv 20101026100901557197dQXHy9.flv
带上反交错和水印参数:
ffmpeg -i input.flv -deinterlace -vhook '/usr/lib64/vhook/watermark.so -f watermark.png' -acodec libfaac -vcodec libx264 -vpre hq -b 500k output.flv
ffmpeg -i '/opt/input/a.flv' -y -f image2 -t 1 -s 300*200 '/opt/output/1.jpg' //获取静态图
ffmpeg -i '/opt/input/a.mpg' -vframes 30 -y -f gif '/output/1.gif' //获取动态图;
加水印
ffmpeg -i input.flv -y -f image2 -t 1 xxx.jpg -vhook '/usr/lib64/vhook/imlib2.so -i xxx.jpg -x -10 -y -10' output.flv
取视频信息
mplayer -identify /usr/local/encode/test.flv -nosound -vc dummy -vo null
--文字浮动
ffmpeg -vhook '/usr/lib64/vhook/imlib2.so -c red -F /usr/share/fonts/bitstream-vera/Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' -i input.flv -y -ab 32 -ar 22050 output.flv
--图片浮动
ffmpeg -i input.flv -y -vhook '/usr/lib64/vhook/imlib2.so -x W*(0.5+0.25*sin(N/47*PI))-w/2 -y H*(0.5+0.50*cos(N/97*PI))-h/2 -i watermark.png' -acodec copy -sameq output.flv
--图片切换
ffmpeg -i input.flv -y -vhook '/usr/lib64/vhook/imlib2.so -x gte(sin(N/100*PI),0)*W-w-30 -y 12 -i logo1.png' -vhook '/usr/lib64/vhook/imlib2.so -x gte(sin(N/100*PI),0)*W+30 -y 12 -i logo2.png' output.flv
--覆盖台标
mencoder -vf "delogo=0:0:88:30:3" -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=5000 -lavfopts format=flv -srate 44100 -oac lavc -lavcopts acodec=libmp3lame:abitrate=56 -o output.flv input.flv
mencoder -vf "delogo=0:0:88:30" -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=5000 -lavfopts format=flv -srate 44100 -oac lavc -lavcopts acodec=libmp3lame:abitrate=56 -o output.flv 20101026100901557197dQXHy9.flv
带上反交错和水印参数:
ffmpeg -i input.flv -deinterlace -vhook '/usr/lib64/vhook/watermark.so -f watermark.png' -acodec libfaac -vcodec libx264 -vpre hq -b 500k output.flv
ffmpeg -i '/opt/input/a.flv' -y -f image2 -t 1 -s 300*200 '/opt/output/1.jpg' //获取静态图
ffmpeg -i '/opt/input/a.mpg' -vframes 30 -y -f gif '/output/1.gif' //获取动态图;
加水印
ffmpeg -i input.flv -y -f image2 -t 1 xxx.jpg -vhook '/usr/lib64/vhook/imlib2.so -i xxx.jpg -x -10 -y -10' output.flv
取视频信息
mplayer -identify /usr/local/encode/test.flv -nosound -vc dummy -vo null
--格式转换:
ffmpeg -i woyoxueshengmei.flv-qscale 4 -s 1040*576 woyoxueshengmei_1039x576.flv
ffmpeg -i car.wmv -qscale 4 -y-ar 22050 -r 15-s 1040*576 car_width_1040x576.flv
ffmpeg -iWildlife.wmv-y -ab 32 -ar 44100 -r 15 -b 520000 -qscale 4Wildlife_mencoder.flv
ffmpeg -i wt_orig.flv -y-ar 22050 -r 15 -qscale 4 ffmpeg_wt_orig.flv