views:

362

answers:

4

I'm interested in installing ffmpeg or somesuch on my server so I can upload files, automatically encode them to FLV and then serve up a embedded player to use on my pages.

The problem is that I don't know where to start. I don't want to have to spend days coding a web based encoding service, as I'm more interested in using an out of the box solution.

My research so far has led me to FFMPEG and possibly Gallery2: it has a ffmpeg integrated and the gallery 2 framework provides user accounts and FTP upload facilities.

Is anyone aware of other open source encoding solutions which you can install on Linux?

A: 

There is also memcoder, that does the same thing that ffmpeg does, but you will have to code the glue that binds ffmpeg/memcoder, PHP and the uploaded videos together.

The general workflow would be something like:

  • Present form to user with PHP
  • Upload file through post
  • Verify uploaded file is video both client and serverside
  • Store uploaded video in a known folder
  • From PHP, run a CLI command with all the desired parameters and store the file in another known location
  • Delete original file if success (optional)
  • Store in DB the path to the created file
  • Serve content
  • Profit!
voyager
yeah I was hoping to avoid having to make custom codes if at all possible - I'd love to just configure an existing platform and minimise my workload.
hfidgen
A: 

You could also have a look at VLC since it can transcode and act as a server for your FLV streams. The main application is a user interface to playback the video but it can be invoked from the command-line to do the serving - rather than playing.

Also there is libvlc which is the C library upon which VLC is written. VLC is based upon ffmpeg and might just make your life a little easier.

Hiya, I had a look at that but it makes no mention of FLV, which would be my preferred web format I think.
hfidgen
You're right, I can only see it listed as an input format. However it definitely works - I've been working on a project that converts raw H.264 video to FLV using VLC so I'm absolutely certain!
A: 

You should check out the docs for your chosen encoder, I have used ffmpeg successfully in the past. Then your workflow looks something like this.

  • Handle the file upload with PHP
  • Use exec() to shell out to your encoder and encode the video.
  • When exec() returns, you can then serve the video in your page

ffmpeg was really easy to get up and running with a couple of command line arguments.

Greg B
have to say the command line does look pretty simple! Again i'm really looking for a packaged solution if at all possible.
hfidgen
I really don't think you're going to find a packaged solution. and as the commandline should only take you about 10 minutes to figure out exactly what settings you're after, I wouldn't waste my time searching for a package that probably doesn't exist.
Greg B
I fear you are correct, but I hope you're not! I don't really have time for this but it looks as if I'll have to properly put this on the jobs list. Thanks for the help!
hfidgen
A: 

There is ffmpeg extension for PHP.

raspi