How do I play just a specific section of a video in a web page?

99封情书 提交于 2020-01-02 16:19:19

问题


It there any way of displaying videos on a website that would allow me to show just a clip of a video without physically slicing the file into actual clips?

EDIT: Specifically, I'd like to play the clips using an open source flash player. I could make specific clips, but that is time consuming and a maintenance nightmare.

Second EDIT: youtube won't work because it is very important we be able to control who views these videos. Also, this web application is running off of a classic LAMP stack.


回答1:


The free Flow Video Player will play video files and it includes source code and api functions to change the seek position:

http://flowplayer.org/




回答2:


You edit the video into another file, and embed that file as the video on your page ;-)




回答3:


you could try to execute ffmpeg or similar from php to generate a clip section on the fly- but that would be cheating, wouldn't it? - i believe that there must be an obscure way to select the starting and ending point of a video in many video players, that's why the user can switch to a point in the video while watching...




回答4:


it depends a lot on the video technology you use. Quicktime clips, for example, have a clear and easily manipulable distinction between media (data) and 'movie' (metadata).

Long ago, you could open a clip in 'simplemovie' (the video equivalent of notepad :-) ), select the part you want, copy, new (empty) file, paste, save, and pick "with references". The result was a very small file that contained no media but was absolutely valid movie file for every purpose, as long as the 'big' file was still around.

I'm sure SMIL has a similar capability; but who implements that? As for other containers, i have no idea.

I guess your best bet is to check the API of the player you're embedding in your webpage. It probably has some parameters to specify new 'beginning' and 'end' points. With some luck, it could even make it seem as the sub-clip is all there is.




回答5:


Based on your comments, it seems you are still considering slicing the files / as long as its automated.

The issue, is you didn't mention what platform / languages you are using. If it happens to be .net, a modification of this is working well for us: http://jasonjano.wordpress.com/2010/02/09/a-simple-c-wrapper-for-ffmpeg/. The sample is for conversion, but can be adapted to use the features you need from ffmpeg i.e. to just grab a piece of the video.




回答6:


I don't think its the best way, but you could use some AS3 to load the movies as movieclips then use .addFrameScript(), gotoAndPlay() and .Stop() to manually control the clips.



来源:https://stackoverflow.com/questions/2740156/how-do-i-play-just-a-specific-section-of-a-video-in-a-web-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!