GithubHelp home page GithubHelp logo

javaav's Introduction

JavaAV

The aim of this project is to provide an easy to use interface to FFmpeg. This project is not command line based like many others do. In addition JavaAV is easily maintainable. First, the native FFmpeg library is accessed through JNI. There is no other extra layer of native code like in Xuggler. Second, all the JNI classes are automatically generated with JavaCPP. Even the compilation into native code is controlled by JavaCPP. This way there is less effort to react to new FFmpeg updates. To improve JavaAV or fix bugs you do not need to touch the native code.

Supported Platforms

  • Android ARM
  • Linux x86 / x64
  • Mac OS X x64
  • Windows x86 / x64

Features

  • Encoding / Decoding with any codec that was compiled into FFmpeg
  • Muxing / Demuxing
  • Audio / Video resampling
  • Log access through callback

Code Snippets

Below some code snippets are shown to demonstrate the API usage. For more complete code see the examples section.

Enumerate installed codecs (each string contains name, type and description):

String[] codecs = Codec.getInstalledCodecs();

Create and use a real-time video encoder:

Options options = new Options();
options.put("tune", "zerolatency");
options.put("preset", "ultrafast");
		
Encoder encoder = new Encoder(CodecID.H264);
encoder.setPixelFormat(PixelFormat.YUV420P);
encoder.setImageWidth(1280);
encoder.setImageHeight(720);
encoder.setGOPSize(25);
encoder.setBitrate(2000000);
encoder.setFramerate(25);
encoder.open(options);

BufferedImage image = ...;
VideoFrame frame = VideoFrame.create(image);

MediaPacket packet = encoder.encodeVideo(frame);

... send packet over a network, write it to a file or whatever

encoder.close();
			

Examples

Below is the list of some basic examples. All examples can be found in the projects src/examples folder.

Installation

Maven

For those who use Maven may include this project as dependency:

<dependency>
	<groupId>com.github.hoary</groupId>
	<artifactId>JavaAV</artifactId>
	<version>0.5</version>
</dependency>

Manually

You can also download JavaAV manually. In doing so, JavaAV and the necessary dependencies must be added to the classpath.

License

GPLv2 with Classpath Exception

javaav's People

Contributors

hoary avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.