use*_*460 5 php ffmpeg ffmpeg-php
我是php的新手.我在我的本地iis中安装了ffmpeg ..是否可以为flv文件生成缩略图图像.请帮忙..
rav*_*404 12
试试这个
$ffmpeg = 'ffmpeg.exe';
//video dir
$video = 'video.flv';
//where to save the image
$image = 'image.jpg';
//time to take screenshot at
$interval = 5;
//screenshot size
$size = '320x240';
//ffmpeg command
$cmd = "$ffmpeg -i $video -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size $image 2>&1";
$return = `$cmd`;
Run Code Online (Sandbox Code Playgroud)
命令选项的说明:
-i filename(源视频的文件路径)
-deinterlace(将隔行扫描的视频转换为非隔行扫描的形式)
-an(音频录制被禁用;我们不需要它用于缩略图)
-ss position(输入视频被解码并被转储,直到时间戳到达位置,缩略图的位置以秒为单位)
-f 输出文件格式
-t duration(输出文件在持续时间后停止写入)
-r fps(设置帧速率写入; fps以赫兹表示(1 /秒) );我们使用1使得我们只抓取一帧)
-y(如果输出文件已经存在则覆盖它)
-s widthxheight(帧的大小,以像素为单位)
| 归档时间: |
|
| 查看次数: |
23119 次 |
| 最近记录: |