views:

533

answers:

2

I'm working on our back-end encoder service which does an awful lot of video transcoding, and a very small amount of joining of video files.

The transcoding is done using the On2 Flix engine for Windows which works very well, but unfortunately it isn't able to join files (at least as far as I can ascertain - neither the help nor the support are very informative). I'm happy with this for now.

The joining, at the moment, is done using the LEADTOOLS Multimedia software which is, franky, dreadful. It's single threaded and requires STA as it uses a message pump which isn't exactly desirable for a server application. In addition the installation overwrites all our working codecs with a load of its own eval ones, and there is no way to avoid this.

Ideally I'm looking for an API to replace the LEADTOOLs Multimedia one, which can join 3GP and/or MP4 files. Cost isn't too much of a problem. Does anybody have any recommendations?

I know the ideal solution is to write our own tool here, but we're intending to do this in WMF and haven't quite transitioned to Win2008 yet so we need a temporary solution for a couple of months.

Update:

I should point out that encoding is by no means my area of expertise, and I've never had much dealing with unmanaged code being relatively new to the industry (7 years). I also don't have very much time because my day job is dev lead of the services-tier/encoder team which consists of just me and one other person, so we simply don't have a lot of time to spend on the encoder.

Something like the Flix engine where a lot of the underlying complexity is already handled is more what I'm looking for than low-level APIs that have to be called differently depending on input/output file types etc.

If you do have any recommendations, it would be really useful if you could point me at some docs for how they are used etc.

+2  A: 

FFMPEG's libavcodec and libavformat are your friend. They're extremely versatile and support more than basically anything else, and are effectively the cross-platform standard for multimedia support and manipulation.

You could also try MP4box's library, GPAC, which is an MP4-specific library that is much more powerful than FFMPEG's APIs, but is (given the name) only useful for handling MP4 and 3GP files.

Also, if you're using Flix for transcoding, have you considered upgrading to something more modern? FLV1 and VP6 are rather crappy formats for Flash video; now that Flash supports H.264, there's really no reason to continue using such outdated (and, in the case of VP6, expensive) formats.

Dark Shikari
The latest version of the Flix engine supports MP4/H.264 which we're switching to now the required Flash version 9.0.115.0 has >90% market penetration (we're too small to require an upgrade from users). I'll have a look into the two you mention, cheers!
Greg Beech
I would suggest you use a better H.264 encoder; Flix is not known for its speed or quality. I would highly recommend x264, as it is both fast, versatile, and has a relatively simple API that you can call directly from your application. Also, its quality is basically unrivaled.
Dark Shikari
x264 looks interesting as I haven't been that impressed by Flix's output quality. When you say it has an API do you mean start it out of process or add a reference and use it in process? I can't see a way of generating an interop assembly to reference it.
Greg Beech
I'll answer this in a separate post, as the comments are rather limited in terms of length.
Dark Shikari
A: 

For x264: you can simply call the executable itself, or you can include the library itself and call it through its API (encoder_open, etc). With .NET its likely more difficult; being a C program, its API is built around C, though I know both C and C++ programs on Windows and Linux have been built that call the API.

There's no real advantage to one over the other for a simple program: either way, x264 only takes a single type of input (raw YV12 video) and spits out a single type of output (H.264 elementary streams, or in the case of the CLI app, it can also mux MP4 and Matroska).

If you need an all-in-one solution, ffmpeg can do the job, as it can automatically handle decoding and pass on the encoding to libx264. If you need more specific assistance, drop by #x264 on Freenode IRC.

Dark Shikari