Log in

View Full Version : Code to write MP4 container format file?


Jack Bowman
11th September 2010, 01:05
Hi.

I need to modify an encoder program to write .mp4 files with data for a new codec. I have not been able to find any available (i.e. usable in a commercial application) code which will handle writing .mp4 files with VBR, which does not cost too much (e.g. Bento4 at $5000.)

I would prefer not to have to code from scratch using the ISO specification.

Are you aware of any available code, C++ callable library or DLL that could handle this function for me? I have a small but reasonable budget for acquiring whatever will save me the coding and debugging time.

Thanks in advance for any help you can offer.

J_Darnley
11th September 2010, 09:15
libavformat, you can use it in a commercial application because it is LGPL. I will also point out gpac but I don't know what that might cost, they seem to have a special clause for commercial use on top of the LGPL.

Reimar
11th September 2010, 11:31
While I would consider FFmpeg/libavformat a good choice a lot of commercial programs use, as with any other product make sure you read the license (unless you are already very familiar with the LGPL).
The major points are (somewhat simplified and thus not 100% correct): if you redistribute your product outside your company, you must include the source to the libavformat parts and your main program in a way that allows re-linking against a modified libavformat, and your EULA etc. may not forbid reverse-engineering of any part that is linked against libavformat (which is related to the previous point, someone wanting to replace the libavformat you use really needs to be allowed to look at least at your binary code e.g. for debugging, too).

ffmpeg
14th September 2010, 05:15
libavformat is able to do this task within 200 lines code, I can provide a simple wrapper based on libavformat to perform 3rd codec integration in .mp4 files

RBO
8th October 2010, 16:23
Have a look at GPAC: it is free software (LGPL) and has a wide support for .mp4 files :)

Romain