Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
上传时用php制作的视频缩略图_Php_Video - Fatal编程技术网

上传时用php制作的视频缩略图

上传时用php制作的视频缩略图,php,video,Php,Video,可能重复: 我制作了视频画廊。我想要那个视频的缩略图,比如youtube。在php中上传时,如何获得这些信息 使用下面两行使用ffmpeg从视频创建图像 $str_command= $ffmpeg ." -i " . $image_source_path . $image_cmd .$dest_image_path; shell_exec($str_command); 请在下面找到变量解释: $ffmpeg ="Document path to your ffmpeg"; $im

可能重复:


我制作了视频画廊。我想要那个视频的缩略图,比如youtube。在php中上传时,如何获得这些信息

使用下面两行使用ffmpeg从视频创建图像

$str_command= $ffmpeg  ." -i " . $image_source_path . $image_cmd .$dest_image_path;     
shell_exec($str_command);
请在下面找到变量解释:

$ffmpeg ="Document path to your ffmpeg";
$image_source_path = "Document path to your video"
$image_cmd = " -r 1 -ss 00:00:10 -t 00:00:01 -s ".ALL_PLACE_WIDTH."x".ALL_PLACE_HEIGHT."   -f image2 " ;
    Where ALL_PLACE_WIDTH ="width of the image you want"
    ALL_PLACE_HEIGHT ="heoght of the image you want"

$dest_image_path = "Document path to your image which is going to create"
这将在10秒后从视频中捕获图像


希望这能有所帮助。

使用下面两行代码使用ffmpeg从视频创建图像

$str_command= $ffmpeg  ." -i " . $image_source_path . $image_cmd .$dest_image_path;     
shell_exec($str_command);
请在下面找到变量解释:

$ffmpeg ="Document path to your ffmpeg";
$image_source_path = "Document path to your video"
$image_cmd = " -r 1 -ss 00:00:10 -t 00:00:01 -s ".ALL_PLACE_WIDTH."x".ALL_PLACE_HEIGHT."   -f image2 " ;
    Where ALL_PLACE_WIDTH ="width of the image you want"
    ALL_PLACE_HEIGHT ="heoght of the image you want"

$dest_image_path = "Document path to your image which is going to create"
这将在10秒后从视频中捕获图像


希望这有帮助。

不知道上传时这是否有效,但我仍然给出+1:)@rajanikant:只需下载并将其复制到php扩展目录,然后在php.ini和扩展部分的一个条目上(搜索“扩展”,您将看到如何为该扩展执行此操作)然后给我上传时工作的想法不知道上传时这是否有效,但我仍然给出+1:)@rajanikant:只需下载并将其复制到php扩展目录,然后在php.ini和扩展部分中的一个条目上(搜索“扩展”,您将看到如何为该扩展执行此操作)然后给我上传时的工作思路,但我如何安装FFMPEGJ必须从这里下载最新版本。然后将ffmpeg.exe放在您想要的任何文件夹结构中,并在变量$ffmpeg中给出上述代码的路径。另外,我在回答chk it时添加了ffmpeg的链接。我尝试了ffmpeg-i f:\Videos\mazing_mcculum_catch.flv-r1-t00:00:30-f image2-s 120x72/withfr/tnails/final%01d.png以及ffmpeg-i f:\Videos\mazing_mcculum_catch.flv-r1-t00:00:01-ss 00:30-f image2-s 120x72/withfr/tnails/final%01d.png以获得单个帧来自视频第30秒的缩略图,但它返回了多个图像。。为什么?可能是你在循环中使用了它…不,我没有使用循环,我只是在命令行客户机中尝试过。但是产生了太多的图像,但我如何安装FFMPEGJ必须从这里下载最新版本。然后将ffmpeg.exe放在您想要的任何文件夹结构中,并在变量$ffmpeg中给出上述代码的路径。另外,我在回答chk it时添加了ffmpeg的链接。我尝试了ffmpeg-i f:\Videos\mazing_mcculum_catch.flv-r1-t00:00:30-f image2-s 120x72/withfr/tnails/final%01d.png以及ffmpeg-i f:\Videos\mazing_mcculum_catch.flv-r1-t00:00:01-ss 00:30-f image2-s 120x72/withfr/tnails/final%01d.png以获得单个帧来自视频第30秒的缩略图,但它返回了多个图像。。为什么?可能是你在循环中使用了它…不,我没有使用循环,我只是在命令行客户机中尝试过。但是产生了太多的图像