简体   繁体   English

视频缩略图生成imagemagick?

[英]Video thumbnail generation imagemagick?

I have been searching for an alternative to ffmpeg (I'm on a host that doesn't allow ffmpeg or mencode due to server power or something) and I was looking into GD or Imagemagick (both of which are installed) is there a way to generate a video thumbnail from either of these two libraries or another one? 我一直在寻找ffmpeg的替代方案(我在主机上由于服务器电源或其他东西而不允许使用ffmpeg或mencode)我正在研究GD或Imagemagick(两者都安装了)有没有办法从这两个库中的任何一个或另一个库生成视频缩略图?

I also have the option of using ruby on rails or python or CGI/perl to do the generation. 我也可以选择在rails或python或CGI / perl上使用ruby进行生成。 But I'm not skilled in either of those languages so I would need a tutorial or script already wrote. 但是我对这两种语言都不熟悉,所以我需要一本已经写过的教程或脚本。

Anyone help? 有人帮吗?

Imagemagicks Convert can do video tumbnails. Imagemagicks转换可以做视频tumbnails。

convert -quiet moviefile.mov[10] movieframe.gif

where the number between the [] is the framenumber of the movie that is converted 其中[]之间的数字是转换的电影的帧数

In fact, ImageMagick just uses ffmeg under the hood. 事实上,ImageMagick只是在幕后使用ffmeg。 If ffmpeg is not installed, you'll have no luck using ImageMagick 如果没有安装ffmpeg,使用ImageMagick就没有运气了

As tijej said you must need ffmpeg in order to use ImageMagick. 正如tijej所说,你必须使用ffmpeg才能使用ImageMagick。 If you are OK with that you can also use FFmpeg::Thumbnail module. 如果你没问题,你也可以使用FFmpeg :: Thumbnail模块。

Sample: 样品:

my $baz = FFmpeg::Thumbnail->new( { video => '/my/video/file.flv' } );
$baz->output_width( 640 );
$baz->output_height( 480 );
$baz->offset( 21 );
$baz->create_thumbnail( undef, '/my/first/thumbnail.png');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM