Coder Social home page Coder Social logo

xingkaieden / ihmc-video-codecs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ihmcrobotics/ihmc-video-codecs

0.0 1.0 0.0 4.29 MB

This library provides a Java library for H264 and MJPEG encoding and decoding as well as support for MP4.

License: Apache License 2.0

CMake 0.86% C++ 16.83% Java 81.52% SWIG 0.65% Kotlin 0.14%

ihmc-video-codecs's Introduction

IHMC Java Video Codecs

This library provides Java support for the following video formats

  • MP4 (Based on JCodec)
  • MJPEG (libJPEG-Turbo)
  • H264 (OpenH264)

Native code is used for the actual encoding and decoding of the video formats. Only video support is provided for now.

H264 support is provided using OpenH264. A downloader for the OpenH264 library is included, and will prompt the user to accept the license. This means all royalities for the H264 codec are taken care off by Cisco.

Philosophy

All code is released under a permissive Apache 2.0 license. This library tries to avoid problems with licensing patents, for example trough the use of the OpenH264 module.

Simple, well defined classes to support the functionality needed are written in C++. SWIG is used to bridge our C++ classes to Java. Only basic features are supported, keeping the API simple and maintainable.

Only video is supported.

Features

  • Video tracks only
  • Supports RGB <-> YUV conversion using libyuv (BSD license)
  • Supports JPEG encoding/decoding using libjpeg-turbo (BSD/IJG license)
  • Bridge to OpenH264 (BSD License)
    • Automatic downloading of Cisco licensed binary
  • MP4 support based on JCodec (BSD License)
    • Mux: H264, MJPEG
    • Demux: H264, MJPEG
  • Fast screenshot support using native code
    • Linux only
    • Fallback using AWT Robot for Mac/Windows

Usage

A pre-compiled version is avaiable on https://bintray.com/ihmcrobotics/maven-release/IHMCVideoCodecs. You can either use Gradle or Maven to add IHMC Video codecs to your project.

Gradle

Add the IHMC Video Codecs library as dependency

repositories {
    maven {
        url  "https://dl.bintray.com/ihmcrobotics/maven-release"
    }
}
	
dependencies {
	compile group: 'us.ihmc', name: 'IHMCVideoCodecs', version: '2.1'
}

Examples

See the examples directory

Headless systems

To accept the license on a system without console input, add "-Dopenh264.license=accept" to your Java command line arguments.

Contributions

Contributions are welcome. We are a robot lab, supporting video codecs is not our main focus. Please provide pull requests. If you or your organization is interested in taking over maintainance, please contact us.

Compile native code

For your convenience compiled libraries are placed in the resources directory. Compiled libraries are available for

If you want to use this library on another platform, you have to compile it yourself. Follow the instructions most appropriatly for your platform.

Dependencies

  • LibYUV git #d0ed025447622c570a76bcf2ac88c30209c780a0
  • OpenH264 v1.7
  • Swig 3.0.3 or higher

Linux

Mac

Windows

  • Install Visual Studio Community 2017
    • Continue while this is downloading and get some coffee
  • Install Windows SDK for WIndows 10
  • Install the 64 bit JDK for Windows (>=8)
  • Install CMake using the installer http://www.cmake.org/download/
  • Download and unpack swigwin 3.0.3 or higher
  • Install Libyuv
  • Install MinGW (you only need to select msys-base)
  • Install nasm for windows 64 bit from http://www.nasm.us/
  • Setup %Path% variables, add the following directories
    • C:\MinGW\msys\1.0\bin
    • C:\Program Files\NASM
  • Download the openh264 sources, tag v1.7
    • Use git
    • Read the instructions in the openh264 README.md
    • Start the 64 Native Tools Command Prompt for VS 2017 (Start -> Visual Studio 2017 -> Visual Studio Tools)
    • cd to the openh264 dir
    • make OS=msvc ENABLE64BIT=Yes
  • Start the cmake-gui
    • Point source directory to IHMCVideoCodecs sources
    • Point build directory to [sources]/build
    • Configure
      • Choose the Visual Studio 15 2017 Win64 generator
      • Choose Default native toolchain
      • Set all paths (LIBYUV_HOME, OPENH264_HOME, SWIG_EXECUTABLE) correctly
      • Configure
    • Generate
  • In the command prompt go to IHMCVideoCodecs/build
    • Run "C:\Program Files\CMake\bin\cmake.exe" --build . --config Release --target install

Publishing

To publish to bintray run

  • gradle bintrayUpload

ihmc-video-codecs's People

Contributors

calvertdw avatar jerrypratt avatar jespersmith avatar nathanphilliber avatar

Watchers

 avatar

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.