Add dynamic video content (YouTube like) (PHP)

﹥>﹥吖頭↗ 提交于 2019-11-28 01:52:57

问题


I'm looking to setup video uploads for users on a site and want to have them viewed through a Flash player. The site is already partially built (by someone else) and I'm wondering what kind of technologies there are to deal with the video files, specifically in PHP.

I'm thinking the files need to be converted to an FLV. After that I think it's just loading the FLV, like an SWF in Flash.

They also want to do mp3's with Flash streaming, so it'd be cool if it could also support mp3's.


回答1:


ffmpeg is the tool for you. It's a major opensource video encoding library that a lot of other tools are based on. It's a bit tricky to use directly, but I think there are a few wrappers around.




回答2:


In adition to Daniels answer, I recommend you to check ffmpeg-php, is a wrapper library for PHP that adds an object-oriented API for accessing and retrieving information from video and audio files using ffmpeg.

You can do a lot of things, from converting between formats, get video frame images for thumbnails and more in an easy way...




回答3:


Have you tried SWFObject for displaying FLVs? Used this recently in a project and it works a like a charm. Very easy to configure as well.




回答4:


I actually found that using other services to encode the file is the easiest option and also the fastest to setup. I ended up using Hey!Watch for this project. I haven't worried about a streaming server/service yet because for the most part the videos are short and people won't be skipping around within the video.




回答5:


There is this highly underrated post with 3 great links for open source solutions that are like youtube and fits perfectly your question (and at least another one).




回答6:


Use the YouTube API and let them do the heavy lifting for you.




回答7:


Just FYI: If you have HQ videos you need not to encode them into FLV. Flash Player 10 has builtin H264 support, this is what HQ does in popular video sites.




回答8:


  • For converting movies to flv I suggest (as the most people before) ffmpeg
  • You could stream these flv over http, but then the users could not skip forward in the movies. There for you need a streaming server like FlashMediaServer or Red5. (These server are also more effcient than pure HTTP)
  • Finally you need FlashMovie that plays the stream. It's quite easy to write one by yourself, or you chose one the open sourced/free players. (e.g.: JW Player)


来源:https://stackoverflow.com/questions/282683/add-dynamic-video-content-youtube-like-php

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