Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/a-schild/jave2
Browse files Browse the repository at this point in the history
  • Loading branch information
a-schild committed Nov 9, 2019
2 parents 6af02cc + d6a023e commit b01742f
Show file tree
Hide file tree
Showing 35 changed files with 1,319 additions and 129 deletions.
16 changes: 14 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# JAVE2

## Changelog
- **2.6.0-SNAPSHOT**
- Prepare for next dev cycle
- **2.7.1**
- Allow additional arguments on watermark filter
- Make positions optional (use -1 for posX and posY) and then use the setAddArgument() method
- **2.7.1**
- Make FFMPEGLocator.createExecutor() to allow it to be used in other contexts
- added execute method to FFMPEGExecutor to leave the ffmpeg processes running after JVM shutdown
- First implementation of drawtext filter
- Most support classes now return the instance when calling setXY() methods
- **2.6.1**
- Added additional method to screen extractor to extract a given image from a video
at the give time in milisenconds, and optional, specify size of resulting image
- **2.6.0**
- Change of logging api to slf4j as logging facade in version 1.7.x
- The encode methods now accept a List<> of MultimediaObject's, which are the concatenated
- Implemented set thread cound for encoding / decoding stages (Max number of cores/cpus to use)
- URL's as source are now treated as "multiple time readables" per default, can be overriden in the MultimediaObject
- Progress listener now works for URL's too, unless the "multiple time readables" flag is set to true
- **2.5.1**
- Renamed native folder where the executables are to nativebin too, to prevent Java 9+ problems
- Allow to create a MultimediaObject with an URL instead of a file as conversion source
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ see the JAVE manual for details.
## Projects using Jave2
* [XR3Player](https://github.com/goxr3plus/XR3Player)
* [XR3Converter](https://github.com/goxr3plus/XR3Converter)
* [On Github](https://github.com/a-schild/jave2/network/dependents)
* ....


Expand All @@ -45,7 +46,7 @@ It includes all binaries for the supported platforms
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-all-deps</artifactId>
<version>2.5.1</version>
<version>2.7.1</version>
</dependency>
```

Expand All @@ -59,7 +60,7 @@ Generally if you want to use for one platform or more what you have to do is add
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.5.1</version>
<version>2.7.1</version>
</dependency>
```

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

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

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

Expand All @@ -97,13 +98,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: '2.5.1'
compile group: 'ws.schild', name: 'jave-all-deps', version: '2.7.1'
```

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

### Main Components of Jave2
Expand Down
14 changes: 7 additions & 7 deletions jave-all-deps/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>2.6.0-SNAPSHOT</version>
<version>2.7.1</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 @@ -152,32 +152,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</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>2.6.0-SNAPSHOT</version>
<version>2.7.1</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>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
14 changes: 7 additions & 7 deletions jave-core-test/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>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
<artifactId>jave-core-test</artifactId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down Expand Up @@ -38,32 +38,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public ScreenExtractorTest() {

/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderImages_01() throws Exception {
Expand Down Expand Up @@ -52,6 +53,7 @@ public void testRenderImages_01() throws Exception {

/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderImages_02() throws Exception {
Expand Down Expand Up @@ -82,6 +84,7 @@ public void testRenderImages_02() throws Exception {

/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderImages_03() throws Exception {
Expand Down Expand Up @@ -112,6 +115,7 @@ public void testRenderImages_03() throws Exception {

/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderImage_01() throws Exception {
Expand All @@ -135,6 +139,7 @@ public void testRenderImage_01() throws Exception {

/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderImage_02() throws Exception {
Expand All @@ -154,5 +159,51 @@ public void testRenderImage_02() throws Exception {
instance.render(multimediaObject, width, height, seconds, target, quality);
assertTrue(target.exists(), "Output file missing");
}

/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderOneImage00() throws Exception {
System.out.println("render one image 00");
File source = new File(getResourceSourcePath(), "zelda first commercial.mpeg");
File target = new File(getResourceTargetPath(), "RenderOneImage00.jpg");
if (target.exists())
{
target.delete();
}
MultimediaObject multimediaObject = new MultimediaObject(source);
int width = -1;
int height = -1;
int seconds = 15000;
int quality = 1;
ScreenExtractor instance = new ScreenExtractor();
instance.renderOneImage(multimediaObject, width, height, seconds, target, quality);
assertTrue(target.exists(), "Output file missing");
}


/**
* Test of render method, of class ScreenExtractor.
* @throws java.lang.Exception
*/
@Test
public void testRenderOneImage01() throws Exception {
System.out.println("render one image 01");
File source = new File(getResourceSourcePath(), "zelda first commercial.mpeg");
File target = new File(getResourceTargetPath(), "RenderOneImage01.jpg");
if (target.exists())
{
target.delete();
}
MultimediaObject multimediaObject = new MultimediaObject(source);
int width = 60;
int height = 60;
int seconds = 15000;
int quality = 1;
ScreenExtractor instance = new ScreenExtractor();
instance.renderOneImage(multimediaObject, width, height, seconds, target, quality);
assertTrue(target.exists(), "Output file missing");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import java.io.File;
import java.net.URL;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -63,10 +65,48 @@ public void testEncodeVideo13() throws Exception {
encodingAttr.setVideoAttributes(videoAttr);
encodingAttr.setFormat("mp4");

PListener listener = new PListener();
Encoder encoder = new Encoder();
encoder.encode(new MultimediaObject(source), target, encodingAttr);
encoder.encode(new MultimediaObject(source, false), target, encodingAttr, listener);
assertNotNull(listener.getInfo(), "URL should be able to read twice");
assertTrue(target.exists(), "Output file missing");
}

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

URL source = new URL("https://samples.ffmpeg.org/MPEG1/zelda%20first%20commercial.mpeg");
File target = new File(getResourceTargetPath(), "testEncodeVideo14.mp4");
if (target.exists())
{
target.delete();
}
AudioAttributes audioAttr = new AudioAttributes();
VideoAttributes videoAttr = new VideoAttributes();
EncodingAttributes encodingAttr = new EncodingAttributes();

audioAttr.setChannels(2);
audioAttr.setCodec("aac");
audioAttr.setBitRate(128000);
audioAttr.setSamplingRate(44100);

videoAttr.setCodec("libx264");
videoAttr.setBitRate(4000000);

encodingAttr.setAudioAttributes(audioAttr);
encodingAttr.setVideoAttributes(videoAttr);
encodingAttr.setFormat("mp4");

Encoder encoder = new Encoder();
PListener listener = new PListener();
encoder.encode(new MultimediaObject(source, true), target, encodingAttr, listener);
assertNull(listener.getInfo(), "URL should not be read twice");
assertTrue(target.exists(), "Output file missing");
}

}
Loading

0 comments on commit b01742f

Please sign in to comment.