butter-desktop icon indicating copy to clipboard operation
butter-desktop copied to clipboard

[Question] How do you support so many codecs

Open LukasBombach opened this issue 7 years ago • 10 comments

Hello, I am trying to make a media center app with electron and of course it only supports very few video codecs. I saw you managed to support a lot of them. Do you mind sharing how do did it—and how I can do it?

LukasBombach avatar May 24 '17 18:05 LukasBombach

So I found this: https://github.com/butterproject/nwjs-build/blob/master/build_linux64.sh

I can see you are doing a lot of ffmpeg stuff there. Is this how you make the codecs work for Butter?

Also: This is for Linux, what about macOS and Windows?

LukasBombach avatar May 24 '17 19:05 LukasBombach

we build our own nw adding more supports to the chromium ffmpeg. but it has been a pain. people tend to use fluent-ffmpeg to transcode or use vlc bindings to do that.

xaiki avatar May 24 '17 20:05 xaiki

I tried transcoding with fluent-ffmpeg to WebM. I'm not sure I did it right but I had a really bad performance. As for VLC, there is WebChimera, but it will be discontinued. There is another project that uses a pepper plugin to render the output of MPV to an embedded OpenGL but this also is heavy on the CPU. I still think a "native" solution would be the best, and yes I know how hard it is to compile NW.js. That is why I am asking, apparently you managed to do that. Do you have a repo that I can clone and try to get it to run?

LukasBombach avatar May 24 '17 20:05 LukasBombach

nwjs-build is what we use.

xaiki avatar May 24 '17 20:05 xaiki

Sorry I am being naggy, but I am looking for this for so long.

I can see there is a file build_linux64.sh but none for macOS or Windows, how do you compile for these platforms?

LukasBombach avatar May 24 '17 20:05 LukasBombach

i'll let @vankasteelj answer that, it's been a looong time i haven't looked at this.

xaiki avatar May 24 '17 20:05 xaiki

Thank you!

LukasBombach avatar May 24 '17 20:05 LukasBombach

maybe @team-pct has more insight too

xaiki avatar May 24 '17 20:05 xaiki

I never managed to build for windows. But yeah, the idea is in nwjs-build. Another good start could be https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases but it supports a little less codecs because it's only a ffmpeg build, not a complete nwjs build. I can't help you much more than that, lately my main role was to report what was working and what was not, I'm not even sure who exactly has built our last build (18.6 is the one i'm currently using, I havent tested above that)

You can feel free to use our nwjs builds though http://builds.butterproject.org/nw/

vankasteelj avatar May 24 '17 22:05 vankasteelj

That is awesome, thank you very much. I really have only one last question: I am sure you have an automated build process and scripts for building for macOS. Is there any way I can find that script (for macOS), because I would like to see if I can manage to build electron for macOS because then I would have pepper support.

LukasBombach avatar May 28 '17 10:05 LukasBombach