Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ffmpeg shared library in a commercial C/C++ application

Tags:

ffmpeg

We have a C++-based application that runs on Windows, Mac, and Linux. I now need to add h.264 and h.265 decoding within this application. It seems ffmpeg will do the trick.

As ours is a commercial application, we cannot disclose the source code to public. However, as I understand, FFMpeg is based on LGPL licensing requirements. Going through various articles on LGPL requirements, it seems I can use ffmpeg without disclosing our source code as long as:

  1. I build ffmpeg as a shared libraries and make sure that I don't use "--enable-gpl" flag during configuration.
  2. I acknowledge in our About dialog box that we are using ffmpeg shared libraries.

Can someone please verify if this more or less meets the requirements? Regards.

Note that I need ffmpeg only to decode and not to encode. Therefore, I don't have to use "--enable-libx264" and "--enable-libx265" flags.

like image 558
Peter Avatar asked May 09 '17 00:05

Peter


2 Answers

As a FFmpeg developer, I would expect you to follow the considerations mentioned on our website:

  1. Compile FFmpeg without "--enable-gpl" and without "--enable-nonfree".
  2. Use dynamic linking (on windows, this means linking to dlls) for linking with FFmpeg libraries.
  3. Distribute the source code of FFmpeg, no matter if you modified it or not.
  4. Make sure the source code corresponds exactly to the library binaries you are distributing.
  5. Run the command "git diff > changes.diff" in the root directory of the FFmpeg source code to create a file with only the changes.
  6. Explain how you compiled FFmpeg, for example the configure line, in a text file added to the root directory of the source code.
  7. Use tarball or a zip file for distributing the source code.
  8. Host the FFmpeg source code on the same webserver as the binary you are distributing.
  9. Add "This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here [where here is a link to the source code]" to every page in your website where there is a download link to your application.
  10. Mention "This software uses libraries from the FFmpeg project under the LGPLv2.1" in your program "about box".
  11. Mention in your EULA that your program uses FFmpeg under the LGPLv2.1.
  12. If your EULA claims ownership over the code, you have to explicitly mention that you do not own FFmpeg, and where the relevant owners can be found.
  13. Remove any prohibition of reverse engineering from your EULA.
  14. Apply the same changes to all translations of your EULA.
  15. Do not misspell FFmpeg (two capitals F and lowercase "mpeg").
  16. Do not rename FFmpeg dlls to some obfuscated name, but adding a suffix or prefix is fine (renaming "avcodec.dll" to "MyProgDec.dll" is not fine, but to "avcodec-MyProg.dll" is).
  17. Go through all the items again for any LGPL external library you compiled into FFmpeg (for example LAME).
  18. Make sure your program is not using any GPL libraries (notably libx264).

From what you've said so far, I think you're doing only point 1-2, 9-11, 15-18. You need to make the source code (of FFmpeg) including modifications (3-5, 7-8) available along with your application, mention build instructions (6), remove ownership claims on FFmpeg, remove reverse engineering prohibitions (if any), and check your EULA (12-14).

like image 108
Ronald S. Bultje Avatar answered Sep 18 '22 22:09

Ronald S. Bultje


Yes, with lgpl you can use it as a dll/shared lib and you won't need to make your source code available. But you should be aware that it's not the licensing of the code is the issue for commercial use, but the patents around h.264/h.265 and you need license for that. AFAIK, even if you simply want to decode you'll still need to have license.

MPEGLA is the licensing body for h264 codec patent pool.

like image 34
Pavel P Avatar answered Sep 18 '22 22:09

Pavel P