views:

137

answers:

3

I have a serie of video files encoded in mpeg2 (I can change this encoding), and I have to produce a movie in flash flv (this is a requirement, I can't change that encoding).

One destination movie is a compilation of different source video files.

I have a playlist defining the destination movie. For example:

Video file        Position        Offset       Length 
little_gnomes     0               0            8.5
fairies           5.23            0.12         12.234
pixies            14              0            9.2

Video file is the name of the file, position is when the file should be started (in the master timeline), offset is the offset within the video file, and length is the length of the video to play. The numbers are seconds (in double).

This would result in something like that (final movie timeline):

               0--5.23|--8.5|--14|--17.464|--23.2|
little_nomes   **************
fairies               *********************
pixies                           *****************

Where video overlaps, the last video to be added override the last one, the audio should be mixed.

The resulting video track would be:

               0--5.23|--8.5|--14|--17.464|--23.2|
little_nomes   *******
fairies               ***********
pixies                           *****************

While the resulting audio would be:

               0--5.23|--8.5|--14|--17.464|--23.2|
little_nomes   11111112222222
fairies               222222211112222222222
pixies                           22222222221111111

Where 1 or 2 is the number of mixed audio tracks.

There can be a maximum of 3 audio tracks.

I need to write a program which takes the playlist as input and produce the flv file. I'm open to any solution (must be free/open source).

An existing tool that can do that would be the simplest, but I found none. As for making my own solution, I found only ffmpeg, I was able to do basic things with it, but the documentation is terribly lacking.

It can be any language, it doesn't have to be super fast (if it takes 30 minutes to build a 1h movie it's fine).

The solution will run on opensolaris based x64 servers. If I have to use linux, this would work too. But windows is out of the question.

A: 

Here are two related questions:

http://stackoverflow.com/questions/605970/command-line-video-editing-tools

http://superuser.com/questions/74028/linux-command-line-tool-for-video-editing

Avisynth sounds as if it might do what you want, but it's Windows-only.

You may very well end up writing your own application using the FFmpeg library. You're right, the documentation could be better... but the tutorial by Stephen Dranger is a good place to start (if you don't know it yet).

Martin B
I saw those questions already. And the tutorial. But I preferred explaining my situation in details, perhaps someone will come with something else.Thanks.
A: 

I finally ended writing my solution from scratch, using ffmpeg library. It's a lot of boiler plate code but in the end the logic in not complicated.

I found the MLT framework which helped me greatly.

A: 

Well, if you prefer Java, I've written several similar programs using Xuggler's API.

Xuggle