我想知道,如何从flash-video文件中提取缩略图,然后将其显示在列表框中。
该列表框是假设有许多视频,我需要从actionscript程序中提取缩略图。
flash播放器将在web上,并且提取必须在加载swf文件时发生,因此,该方法不能太耗时。
我该如何继续这样做呢?这有可能吗?
提前使用tnx
发布于 2010-04-21 20:01:11
您可以使用ffmpeg。也许调用脚本将是最好的方法。
发布于 2010-04-22 08:40:10
你应该看看FFMpeg --有了它,你可以从视频中提取缩略图(还有其他很多很酷的东西)。将其安装到服务器上后,只需通过PHP的exec()函数传递命令即可。
例如:
$cmd = "ffmpeg -i you_video.flv -f image2 -vframes 1 -ss 00:00:01 -y -s 100x100 my_video_thumb.png";
exec($cmd, $output, $return);
Where:
-i is your specify the input file
-f is to force the output format, this case "image2" since we are generating an image
-vframes video frames we want to record in the snapshot, only one
-ss starting time of the snapshot
-y overwrite any existing file with the same name
-s size/dimensions of the output image有一些关于如何在你的服务器上安装FFMpeg的很好的教程,如果你搜索它,你会发现大量的信息。通过http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%E2%80%93-the-easy-way/,这里是一个起点
干杯,M。
发布于 2010-04-21 19:59:41
最好的解决方案是generate the thumbnail server side,并将url发送到此图像。如果你想“在飞行中”做缩略图,你需要首先加载视频,至少直到你想要截图的时候,这不会特别快。
https://stackoverflow.com/questions/2682492
复制相似问题