Skip to content

Commit b01742f

Browse files
committed
Merge branch 'master' of https://github.com/a-schild/jave2
2 parents 6af02cc + d6a023e commit b01742f

File tree

35 files changed

+1319
-129
lines changed

35 files changed

+1319
-129
lines changed

Changelog.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
# JAVE2
22

33
## Changelog
4-
- **2.6.0-SNAPSHOT**
5-
- Prepare for next dev cycle
4+
- **2.7.1**
5+
- Allow additional arguments on watermark filter
6+
- Make positions optional (use -1 for posX and posY) and then use the setAddArgument() method
7+
- **2.7.1**
8+
- Make FFMPEGLocator.createExecutor() to allow it to be used in other contexts
9+
- added execute method to FFMPEGExecutor to leave the ffmpeg processes running after JVM shutdown
10+
- First implementation of drawtext filter
11+
- Most support classes now return the instance when calling setXY() methods
12+
- **2.6.1**
13+
- Added additional method to screen extractor to extract a given image from a video
14+
at the give time in milisenconds, and optional, specify size of resulting image
15+
- **2.6.0**
616
- Change of logging api to slf4j as logging facade in version 1.7.x
717
- The encode methods now accept a List<> of MultimediaObject's, which are the concatenated
818
- Implemented set thread cound for encoding / decoding stages (Max number of cores/cpus to use)
19+
- URL's as source are now treated as "multiple time readables" per default, can be overriden in the MultimediaObject
20+
- Progress listener now works for URL's too, unless the "multiple time readables" flag is set to true
921
- **2.5.1**
1022
- Renamed native folder where the executables are to nativebin too, to prevent Java 9+ problems
1123
- Allow to create a MultimediaObject with an URL instead of a file as conversion source

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ see the JAVE manual for details.
2424
## Projects using Jave2
2525
* [XR3Player](https://github.com/goxr3plus/XR3Player)
2626
* [XR3Converter](https://github.com/goxr3plus/XR3Converter)
27+
* [On Github](https://github.com/a-schild/jave2/network/dependents)
2728
* ....
2829

2930

@@ -45,7 +46,7 @@ It includes all binaries for the supported platforms
4546
<dependency>
4647
<groupId>ws.schild</groupId>
4748
<artifactId>jave-all-deps</artifactId>
48-
<version>2.5.1</version>
49+
<version>2.7.1</version>
4950
</dependency>
5051
```
5152

@@ -59,7 +60,7 @@ Generally if you want to use for one platform or more what you have to do is add
5960
<dependency>
6061
<groupId>ws.schild</groupId>
6162
<artifactId>jave-core</artifactId>
62-
<version>2.5.1</version>
63+
<version>2.7.1</version>
6364
</dependency>
6465
```
6566

@@ -70,7 +71,7 @@ and then the specific jar(s) for your platform(s) :
7071
<dependency>
7172
<groupId>ws.schild</groupId>
7273
<artifactId>jave-nativebin-linux64</artifactId>
73-
<version>2.5.1</version>
74+
<version>2.7.1</version>
7475
</dependency>
7576
```
7677

@@ -79,7 +80,7 @@ and then the specific jar(s) for your platform(s) :
7980
<dependency>
8081
<groupId>ws.schild</groupId>
8182
<artifactId>jave-nativebin-win64</artifactId>
82-
<version>2.5.1</version>
83+
<version>2.7.1</version>
8384
</dependency>
8485
```
8586

@@ -88,7 +89,7 @@ and then the specific jar(s) for your platform(s) :
8889
<dependency>
8990
<groupId>ws.schild</groupId>
9091
<artifactId>jave-nativebin-osx64</artifactId>
91-
<version>2.5.1</version>
92+
<version>2.7.1</version>
9293
</dependency>
9394
```
9495

@@ -97,13 +98,13 @@ and then the specific jar(s) for your platform(s) :
9798
It includes all binaries for the supported platforms
9899

99100
``` XML
100-
compile group: 'ws.schild', name: 'jave-all-deps', version: '2.5.1'
101+
compile group: 'ws.schild', name: 'jave-all-deps', version: '2.7.1'
101102
```
102103

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

109110
### Main Components of Jave2

jave-all-deps/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>ws.schild</groupId>
55
<packaging>jar</packaging>
6-
<version>2.6.0-SNAPSHOT</version>
6+
<version>2.7.1</version>
77
<artifactId>jave-all-deps</artifactId>
88
<name>Jave all native dependencies package</name>
99
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
@@ -152,32 +152,32 @@
152152
<dependency>
153153
<groupId>ws.schild</groupId>
154154
<artifactId>jave-core</artifactId>
155-
<version>2.6.0-SNAPSHOT</version>
155+
<version>2.7.1</version>
156156
</dependency>
157157
<dependency>
158158
<groupId>ws.schild</groupId>
159159
<artifactId>jave-nativebin-win32</artifactId>
160-
<version>2.6.0-SNAPSHOT</version>
160+
<version>2.7.1</version>
161161
</dependency>
162162
<dependency>
163163
<groupId>ws.schild</groupId>
164164
<artifactId>jave-nativebin-win64</artifactId>
165-
<version>2.6.0-SNAPSHOT</version>
165+
<version>2.7.1</version>
166166
</dependency>
167167
<dependency>
168168
<groupId>ws.schild</groupId>
169169
<artifactId>jave-nativebin-linux32</artifactId>
170-
<version>2.6.0-SNAPSHOT</version>
170+
<version>2.7.1</version>
171171
</dependency>
172172
<dependency>
173173
<groupId>ws.schild</groupId>
174174
<artifactId>jave-nativebin-linux64</artifactId>
175-
<version>2.6.0-SNAPSHOT</version>
175+
<version>2.7.1</version>
176176
</dependency>
177177
<dependency>
178178
<groupId>ws.schild</groupId>
179179
<artifactId>jave-nativebin-osx64</artifactId>
180-
<version>2.6.0-SNAPSHOT</version>
180+
<version>2.7.1</version>
181181
</dependency>
182182
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
183183
<dependency>

jave-core-test-java11/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>ws.schild</groupId>
55
<packaging>jar</packaging>
6-
<version>2.6.0-SNAPSHOT</version>
6+
<version>2.7.1</version>
77
<artifactId>jave-core-test-java11</artifactId>
88
<properties>
99
<maven.compiler.source>11</maven.compiler.source>
@@ -38,32 +38,32 @@
3838
<dependency>
3939
<groupId>ws.schild</groupId>
4040
<artifactId>jave-core</artifactId>
41-
<version>2.6.0-SNAPSHOT</version>
41+
<version>2.7.1</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>ws.schild</groupId>
4545
<artifactId>jave-nativebin-win32</artifactId>
46-
<version>2.6.0-SNAPSHOT</version>
46+
<version>2.7.1</version>
4747
</dependency>
4848
<dependency>
4949
<groupId>ws.schild</groupId>
5050
<artifactId>jave-nativebin-win64</artifactId>
51-
<version>2.6.0-SNAPSHOT</version>
51+
<version>2.7.1</version>
5252
</dependency>
5353
<dependency>
5454
<groupId>ws.schild</groupId>
5555
<artifactId>jave-nativebin-linux32</artifactId>
56-
<version>2.6.0-SNAPSHOT</version>
56+
<version>2.7.1</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>ws.schild</groupId>
6060
<artifactId>jave-nativebin-linux64</artifactId>
61-
<version>2.6.0-SNAPSHOT</version>
61+
<version>2.7.1</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>ws.schild</groupId>
6565
<artifactId>jave-nativebin-osx64</artifactId>
66-
<version>2.6.0-SNAPSHOT</version>
66+
<version>2.7.1</version>
6767
</dependency>
6868
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
6969
<dependency>

jave-core-test/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>ws.schild</groupId>
55
<packaging>jar</packaging>
6-
<version>2.6.0-SNAPSHOT</version>
6+
<version>2.7.1</version>
77
<artifactId>jave-core-test</artifactId>
88
<properties>
99
<maven.compiler.source>1.8</maven.compiler.source>
@@ -38,32 +38,32 @@
3838
<dependency>
3939
<groupId>ws.schild</groupId>
4040
<artifactId>jave-core</artifactId>
41-
<version>2.6.0-SNAPSHOT</version>
41+
<version>2.7.1</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>ws.schild</groupId>
4545
<artifactId>jave-nativebin-win32</artifactId>
46-
<version>2.6.0-SNAPSHOT</version>
46+
<version>2.7.1</version>
4747
</dependency>
4848
<dependency>
4949
<groupId>ws.schild</groupId>
5050
<artifactId>jave-nativebin-win64</artifactId>
51-
<version>2.6.0-SNAPSHOT</version>
51+
<version>2.7.1</version>
5252
</dependency>
5353
<dependency>
5454
<groupId>ws.schild</groupId>
5555
<artifactId>jave-nativebin-linux32</artifactId>
56-
<version>2.6.0-SNAPSHOT</version>
56+
<version>2.7.1</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>ws.schild</groupId>
6060
<artifactId>jave-nativebin-linux64</artifactId>
61-
<version>2.6.0-SNAPSHOT</version>
61+
<version>2.7.1</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>ws.schild</groupId>
6565
<artifactId>jave-nativebin-osx64</artifactId>
66-
<version>2.6.0-SNAPSHOT</version>
66+
<version>2.7.1</version>
6767
</dependency>
6868
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
6969
<dependency>

jave-core-test/src/test/java/ws/schild/jave/ScreenExtractorTest.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public ScreenExtractorTest() {
2222

2323
/**
2424
* Test of render method, of class ScreenExtractor.
25+
* @throws java.lang.Exception
2526
*/
2627
@Test
2728
public void testRenderImages_01() throws Exception {
@@ -52,6 +53,7 @@ public void testRenderImages_01() throws Exception {
5253

5354
/**
5455
* Test of render method, of class ScreenExtractor.
56+
* @throws java.lang.Exception
5557
*/
5658
@Test
5759
public void testRenderImages_02() throws Exception {
@@ -82,6 +84,7 @@ public void testRenderImages_02() throws Exception {
8284

8385
/**
8486
* Test of render method, of class ScreenExtractor.
87+
* @throws java.lang.Exception
8588
*/
8689
@Test
8790
public void testRenderImages_03() throws Exception {
@@ -112,6 +115,7 @@ public void testRenderImages_03() throws Exception {
112115

113116
/**
114117
* Test of render method, of class ScreenExtractor.
118+
* @throws java.lang.Exception
115119
*/
116120
@Test
117121
public void testRenderImage_01() throws Exception {
@@ -135,6 +139,7 @@ public void testRenderImage_01() throws Exception {
135139

136140
/**
137141
* Test of render method, of class ScreenExtractor.
142+
* @throws java.lang.Exception
138143
*/
139144
@Test
140145
public void testRenderImage_02() throws Exception {
@@ -154,5 +159,51 @@ public void testRenderImage_02() throws Exception {
154159
instance.render(multimediaObject, width, height, seconds, target, quality);
155160
assertTrue(target.exists(), "Output file missing");
156161
}
162+
163+
/**
164+
* Test of render method, of class ScreenExtractor.
165+
* @throws java.lang.Exception
166+
*/
167+
@Test
168+
public void testRenderOneImage00() throws Exception {
169+
System.out.println("render one image 00");
170+
File source = new File(getResourceSourcePath(), "zelda first commercial.mpeg");
171+
File target = new File(getResourceTargetPath(), "RenderOneImage00.jpg");
172+
if (target.exists())
173+
{
174+
target.delete();
175+
}
176+
MultimediaObject multimediaObject = new MultimediaObject(source);
177+
int width = -1;
178+
int height = -1;
179+
int seconds = 15000;
180+
int quality = 1;
181+
ScreenExtractor instance = new ScreenExtractor();
182+
instance.renderOneImage(multimediaObject, width, height, seconds, target, quality);
183+
assertTrue(target.exists(), "Output file missing");
184+
}
157185

186+
187+
/**
188+
* Test of render method, of class ScreenExtractor.
189+
* @throws java.lang.Exception
190+
*/
191+
@Test
192+
public void testRenderOneImage01() throws Exception {
193+
System.out.println("render one image 01");
194+
File source = new File(getResourceSourcePath(), "zelda first commercial.mpeg");
195+
File target = new File(getResourceTargetPath(), "RenderOneImage01.jpg");
196+
if (target.exists())
197+
{
198+
target.delete();
199+
}
200+
MultimediaObject multimediaObject = new MultimediaObject(source);
201+
int width = 60;
202+
int height = 60;
203+
int seconds = 15000;
204+
int quality = 1;
205+
ScreenExtractor instance = new ScreenExtractor();
206+
instance.renderOneImage(multimediaObject, width, height, seconds, target, quality);
207+
assertTrue(target.exists(), "Output file missing");
208+
}
158209
}

jave-core-test/src/test/java/ws/schild/jave/URLVideoEncoderTest.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import java.io.File;
2222
import java.net.URL;
23+
import static org.junit.jupiter.api.Assertions.assertNotNull;
24+
import static org.junit.jupiter.api.Assertions.assertNull;
2325
import static org.junit.jupiter.api.Assertions.assertTrue;
2426
import org.junit.jupiter.api.Test;
2527

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

68+
PListener listener = new PListener();
6669
Encoder encoder = new Encoder();
67-
encoder.encode(new MultimediaObject(source), target, encodingAttr);
70+
encoder.encode(new MultimediaObject(source, false), target, encodingAttr, listener);
71+
assertNotNull(listener.getInfo(), "URL should be able to read twice");
6872
assertTrue(target.exists(), "Output file missing");
6973
}
7074

75+
/**
76+
* Test of encode method, of class Encoder.
77+
* @throws java.lang.Exception
78+
*/
79+
@Test
80+
public void testEncodeVideo14() throws Exception {
81+
System.out.println("testEncodeVideo14");
82+
83+
URL source = new URL("https://samples.ffmpeg.org/MPEG1/zelda%20first%20commercial.mpeg");
84+
File target = new File(getResourceTargetPath(), "testEncodeVideo14.mp4");
85+
if (target.exists())
86+
{
87+
target.delete();
88+
}
89+
AudioAttributes audioAttr = new AudioAttributes();
90+
VideoAttributes videoAttr = new VideoAttributes();
91+
EncodingAttributes encodingAttr = new EncodingAttributes();
92+
93+
audioAttr.setChannels(2);
94+
audioAttr.setCodec("aac");
95+
audioAttr.setBitRate(128000);
96+
audioAttr.setSamplingRate(44100);
97+
98+
videoAttr.setCodec("libx264");
99+
videoAttr.setBitRate(4000000);
100+
101+
encodingAttr.setAudioAttributes(audioAttr);
102+
encodingAttr.setVideoAttributes(videoAttr);
103+
encodingAttr.setFormat("mp4");
104+
105+
Encoder encoder = new Encoder();
106+
PListener listener = new PListener();
107+
encoder.encode(new MultimediaObject(source, true), target, encodingAttr, listener);
108+
assertNull(listener.getInfo(), "URL should not be read twice");
109+
assertTrue(target.exists(), "Output file missing");
110+
}
71111

72112
}

0 commit comments

Comments
 (0)