tags:

views:

1081

answers:

8

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.

+8  A: 

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.

Daniel M
This is probably the best option, although the setup and configuration time are prohibitive. Much easier to use one of the many encoding services available, especially if only standard encoding is needed.
Darryl Hein
Yes, I agree. All to easy to fall into the trap of wanting to do everything yourself. Some of the services out there are great, and cost so little it's very hard to justify doing it yourself.
Daniel M
+6  A: 

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

CMS
A: 

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

ironfroggy
As far as I'm reading, the video will be posted on YouTube, which wouldn't work at the videos need to be private. If I'm wrong, can you provide a link?
Darryl Hein
No, you're not wrong Darryl.
Mark
+3  A: 

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.

Rob
That's good to know about, although I need a way to get from, say a an avi to an flv first. After that it's not hard.
Darryl Hein
I also came accross this - an opensource video platoform that runs on Amazon EC2 and S3. It manages uploads, encoding and streaming and implements a RESTful API. Take a look at http://pandastream.com/
Rob
A: 

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.

Lashae
A: 
  • 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)
Hippo
+1  A: 

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.

Darryl Hein
A: 

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

I'm posting this here just to point out the links. I think 2 of those 3 questions should be marked as duped anyway.

Cawas