开发者

Php code for getting the first frame of a video(flv)

I have using flow player f开发者_C百科or playing my .flv videos.How i can create a thumbnail from the first frame.Is their any inbuilt Php code for doing this one. Thanks in advance.


The only way I know of is using FFMPEG. I have never used this script, but looking at it seems to be what you need, and may need some tweaking.

http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/447/show-first-frame-as-preview-image

EDIT

To get the image / display it you would just use the html code:

<img src="http://my.domain.com/path-to-file/ffmpeg_image.php?file=video.flv&time=00:00:00&browser=false" />

From what I gathered from that script. But of course, it would probably be better to, when you upload the video, run that and generate a "cache" of the image so that whole process does not have to run for each call.


Not exactly what you are looking for but a good way of showing the first frame of a video in flowplayer is to set autobuffering to true:

    clip: {
        autoPlay: false,
        autoBuffering: true,
    }

This will load the video (wich might be very bad for you).

To do it yourself you need something like ffmpeg installed on your system. if it is installed check this out.


Hmm, some guy on the forums needed something similar and I tried to help him, idiot-proof style. Check out the last post on this thread. I hope it helps.

link

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜