开发者

thumbnail of video in php while uploading [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜