Skip to content

Commit

Permalink
Merge pull request #199 from a-schild/develop
Browse files Browse the repository at this point in the history
   - Upgraded slf4j libraries
   - Added options to get/set options by index, thanks to HANXU2018
   - Upgraded binaries to 4.4.1 release
     OS-X releases from https://www.osxexperts.net/
	 Linux binaries from https://johnvansickle.com/ffmpeg/
	 -> Windows and arm32 bit builds still on 4.4.0 release
- **3.2.1**
   - Moved development to it's own branch
   - Implemented first support for apple m1 chip on OS-X (Needs to be tested)
   - Added win 32 ffmpeg 4.4 static release https://www.notion.so/34dc4ddf501a4b98b46ea9fb4f3470af?v=878345c5d88f4d21a6520db752b5c29f
  • Loading branch information
a-schild authored Apr 1, 2022
2 parents eb127bb + 3457bfa commit 547c668
Show file tree
Hide file tree
Showing 32 changed files with 678 additions and 59 deletions.
11 changes: 11 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# JAVE2

## Changelog
- **3.3.0**
- Upgraded slf4j libraries
- Added options to get/set options by index, thanks to HANXU2018
- Upgraded binaries to 4.4.1 release
OS-X releases from https://www.osxexperts.net/
Linux binaries from https://johnvansickle.com/ffmpeg/
-> Windows and arm32 bit builds still on 4.4.0 release
- **3.2.1**
- Moved development to it's own branch
- Implemented first support for apple m1 chip on OS-X (Needs to be tested)
- Added win 32 ffmpeg 4.4 static release https://www.notion.so/34dc4ddf501a4b98b46ea9fb4f3470af?v=878345c5d88f4d21a6520db752b5c29f
- **3.2.0**
- Modified quoting for command line arguments
- Implemented subtitle ass video filter
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# JAVE2
![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/ws.schild/jave-core?label=release&nexusVersion=2&server=https%3A%2F%2Foss.sonatype.org%2F)
![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/ws.schild/jave-core?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)

The JAVE2 (Java Audio Video Encoder) library is Java wrapper on the ffmpeg
project. Developers can take take advantage of JAVE2 to transcode audio
Expand All @@ -17,9 +19,11 @@ Many other formats, containers and operations are supported by JAVE2.
> JAVE can also be easily ported to other OS and hardware configurations,
see the JAVE manual for details.

| Operating System | Windows x32,x64 | MacOS x32,x64 | Linux x32,x64 | Linux arm64 |
| Operating System | Windows x32,x64 | MacOS x64 | MacOS m1 | Linux x32,x64 | Linux arm32,arm64 |
| ------- | :---: | :---: | :---: | :---: |
| Supported? | YES | YES | YES |
| Supported? | YES | YES | YES | YES | YES |

Please note that the arm+win 32 bit versions are still on 4.4.0

## Projects using Jave2
* [XR3Player](https://github.com/goxr3plus/XR3Player)
Expand All @@ -46,7 +50,7 @@ It includes all binaries for the supported platforms
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-all-deps</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -60,7 +64,7 @@ Include the following in your pom files.
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -71,7 +75,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -80,7 +84,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux-arm64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -89,7 +93,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux-arm32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -98,7 +102,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -107,7 +111,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
```

Expand All @@ -116,13 +120,13 @@ and then the specific jar(s) for your platform(s) :
It includes all binaries for the supported platforms

``` XML
compile group: 'ws.schild', name: 'jave-all-deps', version: '3.2.0'
compile group: 'ws.schild', name: 'jave-all-deps', version: '3.3.0'
```

### For one platform only (Linux 64Bit in this case)
``` XML
compile group: 'ws.schild', name: 'jave-core', version: '3.2.0'
compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '3.2.0'
compile group: 'ws.schild', name: 'jave-core', version: '3.3.0'
compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '3.3.0'
```

### Main Components of Jave2
Expand Down
23 changes: 14 additions & 9 deletions jave-all-deps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>3.2.0</version>
<version>3.3.0</version>
<artifactId>jave-all-deps</artifactId>
<name>Jave all native dependencies package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down Expand Up @@ -154,42 +154,47 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osxm1</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux-arm32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux-arm64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
14 changes: 7 additions & 7 deletions jave-core-test-java11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>3.2.0</version>
<version>3.3.0</version>
<artifactId>jave-core-test-java11</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -38,32 +38,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
28 changes: 14 additions & 14 deletions jave-core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>3.2.0</version>
<version>3.3.0</version>
<artifactId>jave-core-test</artifactId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down Expand Up @@ -40,32 +40,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand All @@ -75,13 +75,13 @@
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-simple.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<scope>test</scope>
Expand Down
65 changes: 65 additions & 0 deletions jave-core-test/src/test/java/ws/schild/jave/ConcatEncoderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import ws.schild.jave.encode.AudioAttributes;
import ws.schild.jave.encode.EncodingAttributes;
import ws.schild.jave.encode.VideoAttributes;
import ws.schild.jave.filters.FilterChain;
import ws.schild.jave.filters.FilterGraph;
import ws.schild.jave.filters.MediaConcatFilter;
import ws.schild.jave.info.VideoSize;

/** @author a.schild */
Expand Down Expand Up @@ -69,10 +72,63 @@ public void testConcatVideo1() throws Exception {
List<MultimediaObject> src = new ArrayList<>();
src.add(new MultimediaObject(source1));
src.add(new MultimediaObject(source2));
FilterGraph complexFiltergraph= new FilterGraph();
FilterChain fc= new FilterChain();
fc.addFilter(new MediaConcatFilter(src.size(), true, false));
complexFiltergraph.addChain(fc);
video.setComplexFiltergraph(complexFiltergraph);
encoder.encode(src, target, attrs);
assertTrue(target.exists(), "Output file missing");
assertTrue(target.length() == 107384, "Output file incorrect size");
}

/**
* Test of encode method, of class Encoder.
*
* @throws java.lang.Exception
*/
@Test
public void testConcatVideo2() throws Exception {
System.out.println("concat two identical videos");

File source1 = new File(getResourceSourcePath(), "small.mp4");
File source2 = new File(getResourceSourcePath(), "small.mp4");
File target = new File(getResourceTargetPath(), "testConcatVideo2.mp4");
if (target.exists()) {
target.delete();
}
AudioAttributes audio = new AudioAttributes();
audio.setCodec("eac3");
audio.setBitRate(97000);
audio.setSamplingRate(48000);
audio.setChannels(2);
VideoAttributes video = new VideoAttributes();
video.setCodec("mpeg4");
video.setBitRate(1500000);
video.setFrameRate(30);
video.setSize(new VideoSize(320, 240));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setOutputFormat("mp4");
attrs.setVideoAttributes(video);
attrs.setAudioAttributes(audio);

Encoder encoder = new Encoder();

List<MultimediaObject> src = new ArrayList<>();
src.add(new MultimediaObject(source1));
src.add(new MultimediaObject(source2));

FilterGraph complexFiltergraph= new FilterGraph();
FilterChain fc= new FilterChain();
fc.addFilter(new MediaConcatFilter(src.size()));
complexFiltergraph.addChain(fc);
video.setComplexFiltergraph(complexFiltergraph);

encoder.encode(src, target, attrs);
assertTrue(target.exists(), "Output file missing");
assertTrue(target.length() == 1368738, "Output file incorrect size");
}

@Test
public void testContactAudio01() throws Exception {
System.out.println("concat two wmv files and build wav from it");
Expand All @@ -97,7 +153,16 @@ public void testContactAudio01() throws Exception {
List<MultimediaObject> src = new ArrayList<>();
src.add(new MultimediaObject(source1));
src.add(new MultimediaObject(source2));
FilterGraph complexFiltergraph= new FilterGraph();
FilterChain fc= new FilterChain();
fc.addFilter(new MediaConcatFilter(src.size(), false, true));
complexFiltergraph.addChain(fc);
VideoAttributes video = new VideoAttributes();
video.setComplexFiltergraph(complexFiltergraph);
attributes.setVideoAttributes(video);
encoder.encode(src, target, attributes);
assertTrue(target.exists(), "Output file missing");
assertTrue(target.length() == 20477182, "Output file incorrect size");
}

}
Loading

0 comments on commit 547c668

Please sign in to comment.