Giter Site home page Giter Site logo

nextbreakpoint / ffmpeg4java Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 11.0 388 KB

FFmpeg4Java provides a JNI wrapper of FFmpeg library

License: BSD 3-Clause "New" or "Revised" License

Java 92.32% Shell 7.68%
java-library java jni-wrapper jni ffmpeg-wrapper ffmpeg

ffmpeg4java's Introduction

FFmpeg4Java 3.1.1-1.1

FFmpeg4Java provides a JNI wrapper of FFmpeg library version 3.1.1.

License

FFmpeg4Java is distributed under the terms of BSD 3-Clause License.

Copyright (c) 2016-2018, Andrea Medeghini
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

* Neither the name of FFmpeg4Java nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Notice

FFmpeg4Java depends on FFmpeg library. See http://ffmpeg.org for details.

FFmpeg is used under the terms of GNU Lesser General Public License, version 2.1.

FFmpeg library is statically linked with FFmpeg4Java's JNI library

Generate JNI code

We use docker for generating JNI code.

Before you continue install docker on your system

Create base image:

sh create-image-base.sh

Create image for generating code:

sh create-image-java.sh

Run a container from the image:

sh run-image-java.sh

The Java code will be generated in directory:

build/com.nextbreakpoint.ffmpeg4java/src/main/java

The JNI code will be generated in file:

build/ffmpeg4java_wrap.c

Build library for MacOS

Download and install command line tools from Apple Developer Center.

Generate JNI code before compiling library for MacOS

Execute build script:

sh build-macos.sh

The native library will be created in directory:

build/com.nextbreakpoint.ffmpeg4java/src/main/resources/macos

Build library for Linux

We use docker for compiling Linux library.

Generate JNI code before compiling library for Linux

Create repository image:

sh create-image-repo.sh

Create image for building library:

sh create-image-linux.sh

Run a container from the image:

sh run-image-linux.sh

The native library will be created in directory:

build/com.nextbreakpoint.ffmpeg4java/src/main/resources/linux

Build library for Windows (cross-compilation)

We use docker for cross-compiling Windows library using Mingw-w64.

Generate JNI code before compiling library for Windows

Create repository image:

sh create-image-repo.sh

Create image for building library:

sh create-image-mingw64.sh

Run a container from the image:

sh run-image-mingw64.sh

The native library will be created in directory:

build/com.nextbreakpoint.ffmpeg4java/src/main/resources/win32

Create and install artifacts

We use Apache Maven to compile and package the artifacts.

Generate JNI code and build libraries before creating artifacts

Create artifacts:

sh mvn-package.sh

The artifacts will be created in directory:

build/com.nextbreakpoint.ffmpeg4java/target

Install artifacts:

sh mvn-install.sh

The artifacts will be installed in local maven repository (~/.m2/repository).

Run tests

We use Apache Maven to run the tests.

Install artifacts in local repository before running tests

Run tests on MacOS:

sh run-tests.sh -Pmacos

Run tests on Linux:

sh run-tests.sh -Plinux

Run tests on Windows:

sh run-tests.sh -Pwin32

TODO

  • Add sample application to show how to use the library

ffmpeg4java's People

Contributors

nextbreakpoint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ffmpeg4java's Issues

sample?

sample?

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ffmpeg4java in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at com.nextbreakpoint.ffmpeg4java.FFmpeg4Java.(FFmpeg4Java.java:23)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.