PHPを使用したFFMPEGに関連するSOに関する膨大な数の質問について読んだ後、小さなスニペットなどをまとめましたが、何も実行されていないようです。エラーもスローされません。
私のPHPは次のとおりです。
function get_video_thumbnail($file) {
define('ALL_PLACE_WIDTH', 250);
define('ALL_PLACE_HEIGHT', 200);
$ffmpeg = "ffmpeg"; // where ffmpeg is
$image_source_path = $file; // where the video is
$image_cmd = " -r 1 -ss 00:00:10 -t 00:00:01 -s ".ALL_PLACE_WIDTH."x".ALL_PLACE_HEIGHT." -f image2 "; // command
$dest_image_path = "cdn/thumbnails"; // destination of thumbnail
$str_command = $ffmpeg ." -i " . $image_source_path . $image_cmd .$dest_image_path;
shell_exec($str_command);
}
ルートフォルダには、「ffmpeg.exe」、「ffplay.exe」、「pthreadGC2.dll」の中に「ffmpeg」フォルダがあります。だから私は疑問に思っています、私が欠けているものはありますか?ビデオ/mp4ファイルからサムネイルを生成しようとしています。