Skip to content
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

Add binary patcher system to include additional Chrome codecs (AVC/MPEG-4/Widevine) - Twitch/YouTube Live/MP4 support #28

Closed
ds58 opened this issue Apr 20, 2022 · 11 comments
Labels

Comments

@ds58
Copy link
Collaborator

ds58 commented Apr 20, 2022

For simplicity of explaining -- there are 2 versions of Chromium you can build:

  • standard "libre" Chromium
  • Chromium with additional codecs / Chrome branding

For licensing reasons I cannot host the binaries for a build of Chromium with additional codecs. There are royalties for H.264 and possibilities other codes included in such a build.

However, it is possible I can host binary diffs between the libre version of Chromium (which I can host without issue) and the proprietary version of Chromium.

From these diffs, the mod can then patch the libre version of Chromium to include the additional codecs. Ie the end user is compiling the final product on their machine -- I am not distributing it directly. The user would be made aware and need to agree to the additional Chrome codecs license (basically the same thing as agreeing to the terms when you install Google Chrome).

@ds58 ds58 added the codecs label Apr 20, 2022
@ds58 ds58 mentioned this issue Apr 20, 2022
@ds58 ds58 changed the title Add binary patcher system to include additional Chrome codecs (AVC/MPEG-4/Widevine) Add binary patcher system to include additional Chrome codecs (AVC/MPEG-4/Widevine) - Twitch/YouTube Live/MP4 support Apr 20, 2022
@ds58 ds58 pinned this issue Apr 20, 2022
@ds58
Copy link
Collaborator Author

ds58 commented Jun 14, 2022

I am working on a new project which supports this feature

New projects are located here under "CinemaMod" https://github.com/CinemaMod

@Garulf
Copy link

Garulf commented Oct 12, 2022

I am very interested in getting codec support for my MCEF. Is there a guide or reference on how to achieve this?

@ds58
Copy link
Collaborator Author

ds58 commented Oct 12, 2022

I am very interested in getting codec support for my MCEF. Is there a guide or reference on how to achieve this?

There's several things to consider:

If you are new to CEF/Chromium, you should know that, by distributing a version of CEF built with proprietary codecs, you are required to have licenses for those codecs.

My new project, CinemaMod, gets around this by not distributing the CEF-with-proprietary-codecs binaries directly, but rather, I distribute the normal CEF binaries without codecs and in addition include bsdiff patch files which contain binary diffs between the 2 CEF versions: CEF-with-codecs and CEF-without-codecs. The process for me is basically:

  1. Build CEF+JCEF without codecs
  2. Build CEF+JCEF with codecs
  3. Take a bsdiff between the 2 sets of binaries
  4. Create manifest files (list of binaries + hashes) for each build (JCEF-w-codecs, JCEF-wo-codecs, the bsdiff files)
  5. Upload the manifest files for each build, upload JCEF without codecs, upload the bsdiff binaries all to my S3 bucket in a structured way
cinemamod-libraries/
  jcef/
    4896/
      linux64/
        manifest.txt
        libcef.so
        libjcef.so
        ...
      win64/
        manifest.txt
        libcef.dll
        libjcef.dll
        ...
  jcef-patches/
    4896/
      linux64/
        manifest.txt
        patched-manifest.txt
        libcef.so.diff
      win64/
        manifest.txt
        patched-manifest.txt
        libcef.dll.diff
        libEGL.dll.diff
        chrome_elf.dll.diff
        ...

(As you may notice, I have support for Windows x86_64 and Linux x86_64 at the moment. I don't have a working macOS build yet.)

I'm not sure how technical you want to get, I just thought I would describe my process for context. It would be possible to use my "downloader/patcher" system from CinemaMod in MCEF if you wanted to utilize my newer JCEF builds with codec patches. The process for that in the code is basically:

  1. When MC launches, check the disk to see if we have JCEF installed in the CinemaMod libraries path
  2. If not installed, download JCEF without codecs
  3. Download the codec bsdiff patch files
  4. Apply the patches to the JCEF build without codecs

See this package for an example of how that's all done: https://github.com/CinemaMod/CinemaMod-Fabric/tree/master/src/main/java/com/cinemamod/downloader

@ds58
Copy link
Collaborator Author

ds58 commented Oct 12, 2022

My new project, CinemaMod, gets around this

This is also a legally gray area for sure. I'm not a lawyer so don't take this as fact.

@Garulf
Copy link

Garulf commented Oct 13, 2022

Thank you very much for responding! I am looking into getting this to work on my end.

@Garulf
Copy link

Garulf commented Oct 13, 2022

image

It works beautifully thanks again!

I can watch a 4k movie from my Plex server in Minecraft!

@ds58
Copy link
Collaborator Author

ds58 commented Oct 13, 2022

It works beautifully thanks again!

Glad you got it to work. It would probably be possible to get a plex player working in CinemaMod so that you have additional features such as: multiplayer video sync, video queue/skip/vote skip, video timeline as a boss bar, regional theater boundaries defined by WorldGuard regions, and other stuff as well

@Garulf
Copy link

Garulf commented Oct 13, 2022

It works beautifully thanks again!

Glad you got it to work. It would probably be possible to get a plex player working in CinemaMod so that you have additional features such as: multiplayer video sync, video queue/skip/vote skip, video timeline as a boss bar, regional theater boundaries defined by WorldGuard regions, and other stuff as well

I'd love to use your CinemaMod but I'm stuck on a long term build using 1.12 atm. Multiplayer video sync would be amazing!

@ds58 ds58 unpinned this issue Aug 8, 2023
@memesaregood1
Copy link

I am very interested in getting codec support for my MCEF. Is there a guide or reference on how to achieve this?

There's several things to consider:

If you are new to CEF/Chromium, you should know that, by distributing a version of CEF built with proprietary codecs, you are required to have licenses for those codecs.

My new project, CinemaMod, gets around this by not distributing the CEF-with-proprietary-codecs binaries directly, but rather, I distribute the normal CEF binaries without codecs and in addition include bsdiff patch files which contain binary diffs between the 2 CEF versions: CEF-with-codecs and CEF-without-codecs. The process for me is basically:

  1. Build CEF+JCEF without codecs
  2. Build CEF+JCEF with codecs
  3. Take a bsdiff between the 2 sets of binaries
  4. Create manifest files (list of binaries + hashes) for each build (JCEF-w-codecs, JCEF-wo-codecs, the bsdiff files)
  5. Upload the manifest files for each build, upload JCEF without codecs, upload the bsdiff binaries all to my S3 bucket in a structured way
cinemamod-libraries/
  jcef/
    4896/
      linux64/
        manifest.txt
        libcef.so
        libjcef.so
        ...
      win64/
        manifest.txt
        libcef.dll
        libjcef.dll
        ...
  jcef-patches/
    4896/
      linux64/
        manifest.txt
        patched-manifest.txt
        libcef.so.diff
      win64/
        manifest.txt
        patched-manifest.txt
        libcef.dll.diff
        libEGL.dll.diff
        chrome_elf.dll.diff
        ...

(As you may notice, I have support for Windows x86_64 and Linux x86_64 at the moment. I don't have a working macOS build yet.)

I'm not sure how technical you want to get, I just thought I would describe my process for context. It would be possible to use my "downloader/patcher" system from CinemaMod in MCEF if you wanted to utilize my newer JCEF builds with codec patches. The process for that in the code is basically:

  1. When MC launches, check the disk to see if we have JCEF installed in the CinemaMod libraries path
  2. If not installed, download JCEF without codecs
  3. Download the codec bsdiff patch files
  4. Apply the patches to the JCEF build without codecs

See this package for an example of how that's all done: https://github.com/CinemaMod/CinemaMod-Fabric/tree/master/src/main/java/com/cinemamod/downloader

necroing, but the links are now dead. is there a new way? I am using Mysticpasta1's MCEF fork.

@JonnygamingTv
Copy link

Hope this may be added soon :)
In the meanwhile, .webm seem to work 👍

@ds58
Copy link
Collaborator Author

ds58 commented Nov 8, 2023

This issue is now irrelevant with MCEF 2.x. The binaries that are included contain the codecs

@ds58 ds58 closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants