views:

3623

answers:

3

I would like my website to record flvs using webcams. These flvs need to play smoothly so I can play with them afterwards, for example transcoding them to avis.

I've tried many different servers to handle the flv recording. The resulting flvs play OK in Wimpy FLV Player, for example, except that the progress indicator doesn't move smoothly or in a regular fashion. This is a sign that there is something wrong and if I try to transcode them using "ffmpeg -i input.flv output.avi" (with or without the framerate option "-r 15") I don't get the right avi.

Here's what I tried and the kind of problem I get:

  1. Using red5 (v 0.6.3 and 0.7.0, both on OS X 10.5.4 and Ubuntu 8.04) and the publisher.html example it includes. Here's the resulting flv. The indicator jumps towards the end very rapidly.

  2. Still using red5, but publishing "live" and starting the recording after a couple of seconds. I used these example files. Here's the resulting flv. The indicator still jumps to the end very rapidly, no sound at all with this method...

  3. Using Wowza Media Server Pro (v 1.5.3, on my mac). The progress indicator doesn't jump to the end, but it moves more quickly at the very beginning. This is enough that conversion to other formats using ffmpeg will have the visual not synchronized properly with the audio. Just to be sure I tried the video recorder that comes with it, as well as using red5's publisher.html (with identical results).

  4. Using Flash Media Server 3 through an account hosted at www.influxis.com. I get yet another progression pattern. The progress indicator jumps a bit a the beginning and then becomes regular. Here's an example.

I know it is possible to record a "flawless" flv because facebook's video application does it (using red5?) Indeed, it's easy to look at the HTML source of facebook video and get the http URL to download the flvs they produce. When played back in Wimpy, the progress indicator is smooth, and transcoding with "ffmpeg -i facebook.flv -r 15 facebook.avi" produces a good avi. Here's an example.

So, can I manage to get a good flv with a constant framerate?

PS: Server must be either installable on Linux or else be available at a reasonably priced hosting provider.

Edit: As pointed out, maybe the problem is not framerate per say but something else. I am not knowledgeable in video and I don't know how to inspect the examples I gave to check things out; maybe someone can shed some light on this.

A: 

Your problem might not be with the framerate but with keyframes and markers.

Gilles
Yes, it is possible, I don't really know enough about video to tell you. Clearly there is a problem and I can't transcode the flv to something else because of it...
Marc-André Lafortune
+1  A: 

Looking at your red5 example flv in richflv (very handy flv editing tool) we can see that you have regular keyframes but the duration metadata isn't set.

The facebook example flv has hardly any keyframes (which would mean you wouldn't be able 'seek' within it very well) however the metadata duration is correct.

I'd look into flvtool2 and flvtool++ (which is a more memory efficient alternative for long files) to insert the correct metadata post capture.

+1  A: 

You can record from webcam using the Nimbb Player, then call the API to download the FLV file locally. This is pretty simple to do and pricing starts at $9/mo. However, not sure if the FLV file will work like you want.

Documentation about the API is here: http://nimbb.com/Help/Api.aspx

Neb
Looks promising , thanks!My project has been abandoned in the meantime.
Marc-André Lafortune