Add dynamic video content (YouTube like) (PHP)

允我心安 提交于 2019-11-29 08:09:30

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.

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...

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.

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.

cregox

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).

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

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.

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