-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nearly impossible to understand how to compile ffmpeg #4595
Comments
The proper documentation is here: http:https://docs.nwjs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/ Wiki is for 0.12 and some content may not apply. |
I've also read that linked documentation before and the problem remains the same, I cannot understand what needs to be done, how it has to be done and where it is done. The required knowledge level to understand that documentation is either too high for me or is too incomplete making me incapable of compiling a working mp4 capable ffmpeg by myself. (side note, I am working with nwj13 rc3 under win7x64) |
To under stand the build process, you should read this first: http:https://docs.nwjs.io/en/latest/For%20Developers/Building%20NW.js/ though you don't need to build the entire NW.js. I agree with you that messing with the build system of a large C++ project with millions of code is hard to JS programmers sometimes, we'll see what we can do. In the meantime you could wait for someone else in the community to do this, or pay someone to do it for you. |
I am hoping for something like what you mentioned here: #4492 (comment) Which I assume it means we won't need to compile the entire NWJS, just the dll. However, I did not find that documentation during my searches, will take a good read at it to see if I am capable of understanding what it requires. But this line right here is already a bit scary:
Seems like it can take some time. And with parts of ffmpeg now under LGPL, not just GPL
https://www.ffmpeg.org/legal.html won't these make the restrictions smaller regarding the ability to share, provide one-click compilers for the purpose discussed here or even pack it by default in NWJS? I do not understand these licenses perfectly, but that's the idea I have regarding LGPL, unless the parts being/intended to be used are under GPL in which case nevermind the above. |
I've read the documentation, it is beyond my capabilities both in hardware requirements and time availability. To take upon such a humongeous task to just change one simple line is insane, I cannot do it, but still thanks for the help. I will wait for a simpler process to be made available, the current one is very discouraging and counter-productive. |
@Yonezpt write me and i will send you the binaries. |
@iteufel I really appreciate the help, but I've followed Roger's suggestion for now and paid someone to do it for me. The next step is to check with a lawyer for license conditions and possible fees, but thankfully that won't be needed any time soon. It is not an ideal scenario because this makes me dependent of someone else to do this whenever NWJS is updated (unless I am wrong), but for now it will do until a better alternative is made available. With that said, you can remove your contact to prevent spam bot/crawlers from catching it. |
@ghostoy I believe there is way not to download the whole NW source tree to build ffmpeg. Please check it. |
I'm trying |
There is no easy way to build ffmpeg without pulling NW source tree. Some dependencies of NW source tree must be kept in order to setup proper building variables for ffmpeg. You can download entire zip package of In my test, following folders are the minimal requirement:
Patch ffmpeg:
With sources with patches above, you can now generate build targets with gyp: export GYP_GENERATORS=ninja
export GYP_DEFINES="branding=Chrome"
export PYTHONPATH="$PWD/build"
./tools/gyp/gyp -I build/common.gypi --depth=. ./third_party/ffmpeg/ffmpeg.gyp Build ninja -C out/Release ffmpeg You will find build results in |
On Windows, |
If it would be possible, perhaps the best option would be to provide the fully built proprietary ffmpeg isolated from the main repo and linked in the wiki with the required disclaimers as well as any applicable licenses. This way the source is always available for anyone that wants it, the licenses are being respected, it is by all means independent of the main code since each one is free to use a different build and users do not have to go through an excessive and discouraging task to make such a simple change to one file. That is, of course, if it is possible. |
As far as I see, there are two major issues: 1) License incompatibility from ffmpeg 2) Patents of codecs Issue 1) may be solved by releasing with a different license as your suggestion. Technically we will try to simplify the procedures of building |
From their licensing page:
|
@baconface I did read that, but I was referring mostly to H264 use/conditions. |
@iteufel Could you send you the ffmpeg.dll .I have been trying to compile ffmpeg, but i failed |
I have created a repo with prebuilt binaries and some guides how i build it. |
@iteufel I tried many times according to the guides,but i download source code failed,my network is very unstable.There are other way to download source code?or could you send me the binaries? |
You can download prebuilt binaries from https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases |
Thanks @iteufel - very helpful of you 🍻 and 👍 ! For me it is now a question of license fees and distributing the libs with our tool. I have officially requested informations on prices via our US company and German company. I also informed them that we sell very very small amounts of the product... I will update you along the way! |
I believe you have to pay for US-based and Japan-based (for example), but there are no applicable fees for EU-based companies, because EU doesn't allow these kind of patents. See https://register.epo.org/application?lng=en&number=EP10767601for the MPEG LA request, that has been rejected because of http:https://www.epo.org/law-practice/legal-texts/html/epc/1973/e/ar52.html and http:https://www.epo.org/law-practice/legal-texts/html/epc/2013/e/ar53.html More information in french: http:https://www.lemonde.fr/europe/article/2005/07/06/le-parlement-europeen-a-enterre-la-directive-sur-le-brevet-des-logiciels_669825_3214.html All of that, I believe (I'm not a lawyer), means that in EU you can redistribute binaries and libraries without worrying about fees, but the copyright still exists and belongs to the creator/editor. |
I have mailed the MPEG LA and got back:
That refers only to the H264 (MP4 files use that a lot, but note the difference between ENCODER and CONTAINER - you can have other formats in an MP4 container), yet H.264 is pretty much standard. That means you might need to have a second license for music (H264 is video mostly, music maybe)... so, if you really want to have you butt covered:
So, I will dig deeper and find out, what where and how... |
@ghostoy I think you're forgetting a few things in your guide above (with zip for chromium.src) I've got a few errors:
|
@vankasteelj Thanks for pointing out. You can set I'm using Ubuntu 14.04 64bit and not seeing missing files. I recommend you to install dependencies with |
I'm on 15.10 and had to fight with that script to make it work, but I don't see why it would bother me on <file.h> inclusion :o |
Oh, and I'm reading in ffmpeg.gyp that they offer ffmpeg_component to build ffmpeg as a shared library. Shouldn't we then also use |
@vankasteelj I forgot to mention to patch ffmpeg with https://raw.githubusercontent.com/nwjs/nw.js/nw13/patch/patches/ffmpeg.patch. Updated my steps above. |
@vankasteelj I found the issue. Try running |
Nice, I can now compile! :) I also found out that you can do: Note that: My goal is to include hevc, ac3,eac3 as well, but for that, I need to check out some .c and .h files here and there |
@vankasteelj use |
I went chatting on #chromium IRC, and am now trying to compile nwjs entirely, simply to have the flags This, plus a modification of ffmpeg to include hevc, might just work. If you have any idea on how to have hevc support, I'm all ears :) |
Ok, so. Following the steps (butterproject/butter-desktop#339 (comment)) to build nwjs entirely, there's a good and a bad news:
From what I tested by replacing files around, modified Now, how to have a "regular" size... x) I only have to compile libnw and libffmpeg, as replacing those 2 in the official build is working. |
@vankasteelj you need to strip it. Please see our official buildbot for the configuration and build steps: http:https://buildbot-master.node-webkit.org:8010/waterfall |
I don't see any configuration :/ There's a bunch of SetProperty but that doesn't indicate me what they do. |
See GYP_DEFINES and other environment variables in the 'gyp' step. On Thu, Mar 31, 2016 at 7:16 PM Jean van Kasteel [email protected]
|
ok thanks, I have a working hevc build :) The steps are described at butterproject/butter-desktop#339 (comment), thanks @ghostoy, @rogerwang and @iteufel It's some sort of mix of the official nwjs doc, chromium docs and what ghost wrote above. |
I'll update document to include the simplified steps for building only ffmpeg library. |
could you make available whole build of nwjs with all of those codecs included? Or branch? It's not simple, any mistake will cause improper build and losing about 6 hours of compilation. It's not included, or even not recognized by Chromium - and build codecs without Chromium is not enough. Please help, instructions on butter-project are also outdated |
@thecyberd3m0n There is a 3rd-party project nwjs-ffmpeg-prebuilt providing ffmpeg libraries for all NW.js releases since 0.13. It may save your time building entire NW.js binaries. |
@ghostoy ok it gives me libffmpeg.so binary, just it. I tried to replace default binary with it. Still - ac3 sound not works (I didn't test other codecs but nice 5.1 sound is important to me). |
yeah ac3 doesn't work without a custom build. We have compiled nwjs with all the codecs we could (issue atm is most divx/xvid video are black - but they play; some weird codecs stutter; AVC .ts files can't be read; but aac/ac3/vorbis/h264/hevc work fine) |
@vankasteelj thanks man, I owe you a beer! |
Does anyone have new version of nwjs with all codecs like here http:https://builds.butterproject.org/nw/ ? Building custom nwjs is painfull :( |
We are planning to upgrade to 19 or 20 soon (fullscreen stutter/flash is annoying), so we'll have our guys compile it. You might wanna keep checking every now and then. And yes, the instructions are incomplete, because the compilation actually is a real pain and we had to find "a guy" to do it for us. We're still trying to have a worker do it automatically on each release of nwjs build, but so far I haven't heard back about that, so we're still depending on manual builds. Official builds with codecs for the non-US user would be a great addition 👍 |
the prebuilt ffmpeg lib is good, but it requires modifications to the core to also enable ac3 does it not? |
@vankasteelj Do you request supporting AC3 codecs in NW.js? If so, please create a new issue with a sample app. |
@vankasteelj I've created a new issue for the request. See #5653. |
I am aware that this is closed but, I have a related question. I followed the instructions here but, when I run the build_ffmpeg script, I get the following message INFO: Backing up and overwriting DEPS... |
I have been trying for almost 4 days to compile ffmpeg, find a working version compatible with nwjs, following the tutorial but I am not capable of understanding how, what and where it has to be done.
The available documentation is very confusing; there's mentions of
ffmpegsumo
even though Chrome stopped using the external DLL making useless any related instructions, in "Build it yourself" I cannot understand where I have to open the indicated partial location, I cannot find it in the current repository and the external possible locations contain code that is different than the one that should be changed (perhaps this is a case of outdated details), the suggested "short directions" make no sense, and then it mentions patching the ffmepg repo which makes me think that I also need to do something in it, again making no sense.In the end I am completely clueless on how I can get a simple ffmpeg.dll that is capable of playing MP4 format.
I appreciate in advance if anyone tries to share an already compiled ffmpeg.dll with MP4 playback capabilities, but the problem will return when nwjs needs to be updated so ideally the best solution would be to learn how to do it on my own.
Would it be possible to create an updated, clear and easy tutorial containing all the necessary steps to achieve the desired result? Or maybe provide a routine/script/batch which makes this task simpler, a guide, etc.? Anything to improve the current state of this problem that is preventing the continuation of development under NWJS.
The text was updated successfully, but these errors were encountered: