diff --git a/bbb-screenshare/app/deploy.sh b/bbb-screenshare/app/deploy.sh index 661eeba736966b623f06ab0dec704658f72f449c..1dd2052418a5c717c1acb879f41d4d0317cf0190 100755 --- a/bbb-screenshare/app/deploy.sh +++ b/bbb-screenshare/app/deploy.sh @@ -34,6 +34,7 @@ cd lib sudo cp -r ~/dev/bigbluebutton/bbb-screenshare/app/jws/lib/* . cd .. sudo cp ~/dev/bigbluebutton/bbb-screenshare/app/jws/screenshare.jnlp . +sudo cp ~/dev/bigbluebutton/bbb-screenshare/app/jws/screenshare.jnlp.h264 . sudo chmod -R 777 /usr/share/red5/webapps/screenshare sudo chown -R red5:red5 /usr/share/red5/webapps/screenshare diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86-svc2.jar index f15d430672acc398d27eaf9239e36891c2948d41..08290dc41574e10d529d62db07f56f19fb189dce 100644 Binary files a/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86-svc2.jar and b/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86-svc2.jar differ diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86_64-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86_64-svc2.jar index bb6de91b2218a9c54b760dce4afd4f96c8f2cddb..6e47da1b9c487fbe8a0b47643c75111c9ff8cd69 100644 Binary files a/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86_64-svc2.jar and b/bbb-screenshare/app/jws/lib/ffmpeg-linux-x86_64-svc2.jar differ diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-macosx-x86_64-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-macosx-x86_64-svc2.jar index e8796116a856ad556a511aa215c189931b14c55e..2805275bc8fd154d19b096f20027992d9b7d6e9d 100644 Binary files a/bbb-screenshare/app/jws/lib/ffmpeg-macosx-x86_64-svc2.jar and b/bbb-screenshare/app/jws/lib/ffmpeg-macosx-x86_64-svc2.jar differ diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar index da55767c28e3418a809616c58467c2fc6e072318..aba354529523e4e9be32b8514782d3c525aab061 100644 Binary files a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar and b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar differ diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar index accc9d301b4193f39cdbdc27286b0da6cdd929bb..08f3de1035fcdc49fa2f20e7d6ff3ee6303577ef 100644 Binary files a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar and b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar differ diff --git a/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar b/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar index c7f8daf6e1dbb3b0d2b7ecea8b275ce104d8d085..ddfa8a89108c115b3b30fad54a4c98dd85851288 100755 Binary files a/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar and b/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar differ diff --git a/bbb-screenshare/app/jws/screenshare.jnlp b/bbb-screenshare/app/jws/screenshare.jnlp index 3276301937ffaa01bfad5d1bb455685e29897668..97181542f02acb34e554d91a05e90f13f2f0e4cb 100755 --- a/bbb-screenshare/app/jws/screenshare.jnlp +++ b/bbb-screenshare/app/jws/screenshare.jnlp @@ -12,15 +12,15 @@ <resources> <j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/> <jar href="javacv-screenshare-0.0.1.jar" main="true" /> - <jar href="ffmpeg-svc2.jar" /> + <jar href="ffmpeg.jar" /> </resources> <resources os="Windows" arch="amd64"> - <nativelib href="ffmpeg-win-x86_64-native-svc2.jar"/> + <nativelib href="ffmpeg-win-x86_64-svc2.jar"/> </resources> <resources os="Windows" arch="x86"> - <nativelib href="ffmpeg-win-x86-native-svc2.jar"/> + <nativelib href="ffmpeg-win-x86-svc2.jar"/> </resources> <resources os="Linux" arch="x86_64 amd64"> diff --git a/bbb-screenshare/jws/native-libs/README.md b/bbb-screenshare/jws/native-libs/README.md index 1023ffc06c3e26150d0e9825ad4ae3d7114fffad..9dd69047bdb738e2d40c6e337729b94188182c4f 100755 --- a/bbb-screenshare/jws/native-libs/README.md +++ b/bbb-screenshare/jws/native-libs/README.md @@ -1,15 +1,181 @@ -This directory contains the difference JavaCV jar files that we need for our web start application. - -To build each native library and sign each ffmpeg native libraries: - -1. cd to the platform directory you want to build (cd ffmpeg-win-x86) -2. type ```gradle jar``` to build the jar file -3. type ```ant sign-jar``` to sign the jar file with your certificate -4. copy the signed-jar to ```bbb-screenshare/app/jws/lib``` to be included when - deploying to red5 - -We have included unsigned jars for ```ffmpeg.jar```, ```javacpp.jar```, and ```javacv.jar``` in the -unsigned-jars directory. You can sign the jar files there with your certificate. +** NOTE: ** + Taken from https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments + +Introduction +------------ +This page contains a description of the environments that are used to build the JavaCPP Presets for [Android (ARM and x86)](#android-arm-and-x86), [Linux (x86 and x86_64)](#linux-x86-and-x86_64), [Linux (ARM)](#linux-arm), [Mac OS X (x86_64)](#mac-os-x-x86_64), and [Windows (x86 and x86_64)](#windows-x86-and-x86_64). We also explain our choices given the requirements and provide some recommendations. Furthermore, JavaCPP is by no means limited to these platforms, so if you happen to know how to set up an environment for other platforms, by all means, please do add that information to this page to share with others. Thank you! + + +Prerequisites for all platforms +------------------------------- +The build process for the modules of `javacpp-presets` usually depends on the same version of the `javacpp` module. To insure that you have the latest matching version of both, please execute the following before starting the build in the `javacpp-presets` directory: +```bash +$ git clone https://github.com/bytedeco/javacpp.git --branch <tag> +$ git clone https://github.com/bytedeco/javacpp-presets.git --branch <tag> +$ cd javacpp +$ mvn clean install +``` +For the latest tag please check +https://github.com/bytedeco/javacpp-presets/tags + +Android (ARM and x86) +--------------------- +To produce native libraries for Android, we basically only need to install the JDK and the NDK, which is available for Linux, Mac OS X, and Windows. However, the build scripts of some libraries only run correctly under Linux, so we recommend using a recent distribution of Linux (such as Fedora or Ubuntu) as build environment for Android. + +### Preparations +1. Download the latest version of the [NDK](https://developer.android.com/ndk/downloads/), which is r10e at the time of this writing and contains important fixes for OpenMP, among other things +2. Install the NDK under `~/Android/android-ndk`, where the build scripts will look for it by default +3. Finally, make sure to have installed at least OpenJDK and Maven as per the instructions of your distribution + +After which the following commands can be used to start the build inside the `javacpp-presets` directory: +```bash +$ ANDROID_NDK=/path/to/android-ndk/ bash cppbuild.sh -platform android-xxx install +$ mvn clean install -Djavacpp.platform=android-xxx -Djavacpp.platform.root=/path/to/android-ndk/ -Djavacpp.platform.compiler=/path/to/target-g++ +``` +where `android-xxx` is either `android-arm` or `android-x86`, and where `target-g++` is either `arm-linux-androideabi-g++` or `i686-linux-android-g++`. + + +Linux (x86 and x86_64) +---------------------- +To produce native libraries that can run on the largest possible number of Linux installations out there, it is recommended to build under CentOS 7. This is because it relies on an old enough version of glibc, which nevertheless works for all the libraries found in the JavaCPP Presets, and since newer versions of glibc are backward compatible, all recent distributions of Linux should support the binaries generated. We do not actually need to install CentOS 7 though. Pretty much any recent distribution of Linux comes with a package for [Docker](https://www.docker.com/). It is also possible to map existing directories, for example `/usr/local/lib/bazel` and `/usr/local/cuda` as shown in the steps below, to reuse an existing [Bazel](http://bazel.io/docs/install.html) or [CUDA](https://developer.nvidia.com/cuda-downloads) installation as well as any other set of files for the purpose of the build. + +### Preparations +1. Install Docker under, for example, Fedora and Ubuntu, respectively: + + ```bash + $ sudo yum install docker + $ sudo apt-get install docker.io + ``` + +2. When using SELinux, it might also be necessary to disable temporarily the firewall, for example: + + ``` + $ sudo systemctl stop firewalld + $ sudo systemctl start docker + ``` + +3. Start the container for CentOS 7 (the command might be `docker.io` instead of `docker`): + + ```bash + $ sudo docker run --privileged -it -v /usr/local/lib/bazel:/usr/local/lib/bazel -v /usr/local/cuda:/usr/local/cuda centos:7 /bin/bash + ``` + +4. Finally, inside the container, we need to install a bunch of things: + + ```bash + $ ln -s /usr/local/lib/bazel/bin/bazel /usr/local/bin/bazel + $ yum install epel-release + $ yum install clang gcc-c++ gcc-gfortran java-devel maven python numpy swig git file which wget unzip tar bzip2 gzip xz patch make cmake3 perl nasm yasm alsa-lib-devel freeglut-devel gtk2-devel libusb-devel libusb1-devel zlib-devel + $ yum install `rpm -qa | sed s/.x86_64$/.i686/` + ``` + +After which the following commands can be used to start the build inside the `javacpp-presets` directory: +```bash +$ bash cppbuild.sh -platform linux-xxx install +$ mvn clean install -Djavacpp.platform=linux-xxx +``` +where `linux-xxx` is either `linux-x86` or `linux-x86_64`. + + +Linux (ARM) +----------- +There are a growing number of arm platforms running Linux, though testing of this build has mainly focussed on the Pi family of products. Compiling natively on these platforms can be quite time consuming, and as well to automate the build process, the build setup here relies on cross-compiling for the target arm platform. This has been tested using Ubuntu x64 15.10, but it should be reasonably similar approach for other host OS's. + +You'll need to have setup a build environment with the usual packages (pkgconfig, build-essentials, yasm, nasm, maven3, etc). The major addition you'll need is a set of cross compilers: arm-linux-gnueabihf-gcc, arm-linux-gnueabihf-g++ and arm-linux-gnueabihf-cpp. It's best to get these via your OS's package manager, as there are other dependencies for these. + +Originally a 5.x compiler was used, but this seems to caused problems in creating a dependency on newer glibc functionality which might not be present on your target arm device. The 4.8 or 4.9 version of the compiler seems to work fine, but, in targetting support for the Pi1 and well as Pi2-Pi3 (i.e. arm6 as well as arm7) it seems some compiler flag combinations might not be support by the standard gnueabihf compiler toolchain. + +There are pi specific compilers available, so these have been used in the current setup. + +1. Get the Pi tools: git clone https://github.com/raspberrypi/tools.git +2. From this folder, move out a specific compiler version to a more generic location: sudo cp -r ./tools/arm-bcm2708/arm-bcm2708-linux-gnueabi /opt +3. Setup alternatives of the generic compiler names in /usr/bin to point to this new compiler + + ```bash + $ update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /opt/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-gcc 46 + $ update-alternatives --install /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /opt/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-g++ 46 + $ update-alternatives --install /usr/bin/arm-linux-gnueabihf-cpp arm-linux-gnueabihf-cpp /opt/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-cpp 46 + ``` + + (This way if you want to explore using other newer compilers, just add them to alternatives and the same build setup should work fine) + +This should now have you setup ready to build for arm. It could be an idea to test at this stage with building a simple hello world executable (save your hello world test code as hello.cpp): + + $ arm-linux-gnueabihf-g++ -O3 -g3 -Wall -fPIC -march=armv6 -mfpu=vfp -mfloat-abi=hard hello.cpp -c -o hello.o + $ arm-linux-gnueabihf-g++ -o hello hello.o + $ file hello + +And you should see in the returned info that hello is built for ARM + +With the build environment setup, now its on to building JavaCV. Not all components have been setup with the linux-armhf build configurations, so rather than building the entire project only a subset are built here, but enough to have core functionality (OpenCV, FFmpeg) working with some additional parts (artoolkitplus, flycapture, flandmark, libfreenect, libdc1394) built but not tested. For flycapture, you need to download the arm SDK (currently flycapture.2.9.3.13_armhf) and make these .so libs available, either in your path, or setting up a /usr/include/flycapture directory and moving them there. + +Now all the dependencies are setup, the build can be started (assuming you've done a git clone of javacv, javacpp and javacpp-presets all to the same folder) + + $ cd javacpp + $ mvn install + $ cd .. + $ cd javacpp-presets + $ ./cppbuild.sh -platform linux-armhf install + $ mvn install -Djavacpp.platform=linux-armhf -Djavacpp.platform.compiler=arm-linux-gnueabihf-g++ + $ cd platform + $ mvn install -Djavacpp.platform=linux-armhf + +Hopefully that all runs OK, and then in ./javacpp-presets/platform/target/ you should find there are platform specific (opencv-linux-armhf.jar, ffmpeg-linux-armhf.jar, etc) files built. + +If you want to try alternative flags, you need to modify in javacpp, ./src/main/resources/org/bytedeco/javacpp/properties/linux-armhf.properties and then in javacpp-presets any project cppbuild.sh file where you want to update too (e.g. ./opencv/cppbuild.sh linux-armhf section). For newer Pis on arm7 it does look like there are potential performance gains in armv7 and neon flags, and using a newer compiler rather than the bcm2708 build used here may further improve things (some earlier builds specific for armv7 did look faster). Also if you are using onboard picam devices, make sure you load the module with "modprobe bcm2835-v4l2 max_video_width=2592 max_video_height=1944" - this way if you test just using OpenCV or FFMPEG grabber you should get at least 30fps as a start point. The more computation you then do on each frame, the more this will drop. + + +Mac OS X (x86_64) +----------------- +OS X Mavericks (10.9) is the first version of Mac OS X to support C++11 fully and properly, so to preserve your sanity, we do not recommend trying to build or use the JavaCPP Presets on any older versions of Mac OS X. + +### Preparations +1. Install [Xcode](https://developer.apple.com/xcode/) and [Homebrew](http://brew.sh/) +2. Ensure the command line tools for Xcode are installed + + ```bash + $ xcode-select --install + ``` +3. Run the following commands to install the JDK, among other things Apple left out of Xcode: + + ```bash + $ brew install caskroom/cask/brew-cask + $ brew cask install cuda java + $ brew install gcc5 swig bazel cmake libusb maven nasm yasm xz pkg-config + ``` + +After which the following commands can be used to start the build inside the `javacpp-presets` directory: +```bash +$ bash cppbuild.sh install +$ mvn clean install +``` + + +Windows (x86 and x86_64) +------------------------ +Visual Studio Community 2013 is the first free version to have been decently bundled with support for C++11, OpenMP, the Windows SDK, and everything else from Microsoft, so we recommend installing that version of Visual Studio, which consequently requires Windows 7. Still, to run the bash scripts and compile some things that the Microsoft C/C++ Compiler does not support, we need to install manually a few other things. + +### Preparations +1. Install the [Java SE Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/), [Maven](https://maven.apache.org/download.cgi), [MSYS2](https://msys2.github.io/), [Visual Studio Community 2013](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx), and [CUDA](https://developer.nvidia.com/cuda-downloads) +2. Under an "MSYS2 Shell", run: + + ```bash + $ pacman -S base-devel tar patch make git unzip zip nasm yasm pkg-config mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-i686-gcc mingw-w64-x86_64-gcc-fortran mingw-w64-i686-gcc-fortran mingw-w64-x86_64-libwinpthread-git mingw-w64-i686-libwinpthread-git + ``` + +3. From the "Visual Studio Tools" found inside the Start menu, open: + - "VS2013 x86 Native Tools Command Prompt" and run `c:\msys64\mingw32_shell.bat` inside + - "VS2013 x64 Native Tools Command Prompt" and run `c:\msys64\mingw64_shell.bat` inside + - Making sure the `set MSYS2_PATH_TYPE=inherit` line is *not* commented out in either of those batch files. + +4. Run the "Prerequisites for all platforms" tasks inside the shell + +Afterwards the following commands can be used to start the build inside the `javacpp-presets` directory: +```bash +$ bash cppbuild.sh -platform windows-xxx install +$ mvn clean install -Djavacpp.platform=windows-xxx +``` +where `windows-xxx` is either `windows-x86` or `windows-x86_64`. Run the builds for `windows-x86` inside the "MINGW32" window, and the ones for `windows-x86_64` in the "MINGW64" one. diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86/svc2/sign-jar.sh b/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86/svc2/sign-jar.sh index 11d22ee19bbe10f6f1a00064ea78461384df9e0f..e82feeb760ee234e2a44d540c57802b734831493 100755 --- a/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86/svc2/sign-jar.sh +++ b/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86/svc2/sign-jar.sh @@ -1,4 +1,4 @@ -FFMPEG=ffmpeg-3.0.2-1.2-linux-x86.jar +FFMPEG=ffmpeg-3.0.2-1.2-linux-x86-svc2.jar mkdir workdir cp $FFMPEG workdir/ffmpeg-linux-x86.jar rm -rf src diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86_64/svc2/sign-jar.sh b/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86_64/svc2/sign-jar.sh index cd5e6490dc696ed9b249d344f281ce51dbb02ef7..781bc3e084016be9de8a136cc2ad0806c86e83d9 100755 --- a/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86_64/svc2/sign-jar.sh +++ b/bbb-screenshare/jws/native-libs/ffmpeg-linux-x86_64/svc2/sign-jar.sh @@ -1,4 +1,4 @@ -FFMPEG=ffmpeg-3.0.2-1.2-linux-x86_64.jar +FFMPEG=ffmpeg-3.0.2-1.2-linux-x86_64-svc2.jar mkdir workdir cp $FFMPEG workdir/ffmpeg-linux-x86_64.jar rm -rf src diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86-svc2-unsigned.jar index 1cabd4229d4a954257adba03d2b2413e964de068..dcf20788d66c779397db59e5f4e2f5f395a50f35 100644 Binary files a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86-svc2-unsigned.jar and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86-svc2-unsigned.jar differ diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86_64-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86_64-svc2-unsigned.jar index 4702bb25cc660009999ff823a06c113395b1805b..5dbdc8e794c60a6dbcd3bd4dc7dde3d050e3e402 100644 Binary files a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86_64-svc2-unsigned.jar and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-linux-x86_64-svc2-unsigned.jar differ diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-macosx-x86_64-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-macosx-x86_64-svc2-unsigned.jar index f4dc8aab77b004a530733970981b4baf996c9cc2..a610847562643fca2741ae735749f4fa68508a34 100644 Binary files a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-macosx-x86_64-svc2-unsigned.jar and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-macosx-x86_64-svc2-unsigned.jar differ diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar index f7592603397fcd3a181bc51396d4c3b262739ada..6a3463a45ba98e5a99600071773f5a7a3b74dcc9 100644 Binary files a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar differ diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar index 7ace3ca93e28aeb71e633b85df761e4e02340628..2c90fec4215c695370e23e93b7488e8b5090dca9 100644 Binary files a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar differ