可以在保存功能中设置图像框的大小吗?

时间:2019-04-09 05:55:13

标签: php ffmpeg ffmpeg-php php-ffmpeg

无法设置图像尺寸,因此我无法使用缩略图尺寸。

$video = $ffmpeg->open($videoFile);
$video
    ->filters()
    ->resize(new FFMpeg\Coordinate\Dimension(320, 240))
    ->synchronize();
$frame = $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(1));
$frame->save('C:\wamp64\www\woc\image_bucket\thumbnail\\'.$thumbnailFileName);

1 个答案:

答案 0 :(得分:0)

如果要使用命令生成缩略图,则应尝试以下操作:

ffmpeg -i INPUT.mp4 -an -ss 1 -y -s 320*240 -vframes 1 OUTPUT.png 
  • ss :设置开始时间偏移(屏幕短时间)
  • an :禁用音频
  • vframes :设置要录制的视频帧数
  • s :设置框架大小
  • y :覆盖输出文件