开发者

thumbnail of video in php while uploading [duplicate]

开发者 https://www.devze.com 2022-12-20 08:50 出处:网络
This question already has answers here: 开发者_运维技巧Closed 10 years ago. Possible Duplicate: How to create thumbnails or preview for videos?
This question already has answers here: 开发者_运维技巧 Closed 10 years ago.

Possible Duplicate:

How to create thumbnails or preview for videos?

I have made video gallery . i want thumbnail of that video like youtube. how can i get that while uploading in php.


http://ffmpeg-php.sourceforge.net/


Use below two lines for creating image from video using ffmpeg

$str_command= $ffmpeg  ." -i " . $image_source_path . $image_cmd .$dest_image_path;     
shell_exec($str_command);

Please find variable explanation at below:

$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"

This will capture image from your video after 10 second.

FFMPEG

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消