diff --git a/Changelog.md b/Changelog.md
index 7d4f3ae..d514150 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,6 +1,8 @@
# JAVE2
## Changelog
+- **2.7.2**
+ - Handle invalid/unknown duration values in containers
- **2.7.1**
- Allow additional arguments on watermark filter
- Make positions optional (use -1 for posX and posY) and then use the setAddArgument() method
diff --git a/README.md b/README.md
index b7997ec..b78a570 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ It includes all binaries for the supported platforms
ws.schild
jave-all-deps
- 2.7.1
+ 2.7.2
```
@@ -60,7 +60,7 @@ Generally if you want to use for one platform or more what you have to do is add
ws.schild
jave-core
- 2.7.1
+ 2.7.2
```
@@ -71,7 +71,7 @@ and then the specific jar(s) for your platform(s) :
ws.schild
jave-nativebin-linux64
- 2.7.1
+ 2.7.2
```
@@ -80,7 +80,7 @@ and then the specific jar(s) for your platform(s) :
ws.schild
jave-nativebin-win64
- 2.7.1
+ 2.7.2
```
@@ -89,7 +89,7 @@ and then the specific jar(s) for your platform(s) :
ws.schild
jave-nativebin-osx64
- 2.7.1
+ 2.7.2
```
@@ -98,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.7.1'
+compile group: 'ws.schild', name: 'jave-all-deps', version: '2.7.2'
```
### For one platform only (Linux 64Bit in this case)
``` XML
-compile group: 'ws.schild', name: 'jave-core', version: '2.7.1'
-compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '2.7.1'
+compile group: 'ws.schild', name: 'jave-core', version: '2.7.2'
+compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '2.7.2'
```
### Main Components of Jave2
diff --git a/jave-all-deps/pom.xml b/jave-all-deps/pom.xml
index 0dcd86a..7c131e1 100644
--- a/jave-all-deps/pom.xml
+++ b/jave-all-deps/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-all-deps
Jave all native dependencies package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
@@ -152,32 +152,32 @@
ws.schild
jave-core
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-win32
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-win64
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux32
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux64
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-osx64
- 2.7.1
+ 2.7.2
diff --git a/jave-core-test-java11/pom.xml b/jave-core-test-java11/pom.xml
index 428bc08..2b233b4 100644
--- a/jave-core-test-java11/pom.xml
+++ b/jave-core-test-java11/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-core-test-java11
11
@@ -38,32 +38,32 @@
ws.schild
jave-core
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-win32
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-win64
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux32
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux64
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-osx64
- 2.7.1
+ 2.7.2
diff --git a/jave-core-test/pom.xml b/jave-core-test/pom.xml
index 3b9741d..ddfd89a 100644
--- a/jave-core-test/pom.xml
+++ b/jave-core-test/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-core-test
1.8
@@ -38,32 +38,32 @@
ws.schild
jave-core
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-win32
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-win64
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux32
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux64
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-osx64
- 2.7.1
+ 2.7.2
diff --git a/jave-core-test/src/test/java/ws/schild/jave/MultimediaObjectTest.java b/jave-core-test/src/test/java/ws/schild/jave/MultimediaObjectTest.java
index 9bb47cf..dd8a3a3 100644
--- a/jave-core-test/src/test/java/ws/schild/jave/MultimediaObjectTest.java
+++ b/jave-core-test/src/test/java/ws/schild/jave/MultimediaObjectTest.java
@@ -121,4 +121,22 @@ public void testGetInfo04() throws Exception {
assertEquals(result.getFormat(), "mpeg", "Invalid video format");
assertEquals(result.getDuration(), 29800, "Invalid duration");
}
+
+
+
+ /**
+ * Test of getInfo method, of class MultimediaObject.
+ * @throws java.lang.Exception
+ */
+ @Test
+ public void testGetInfo05() throws Exception {
+ System.out.println("testGetInfo05");
+ File file = new File(getResourceSourcePath(), "PCRecorded.mp4");
+ MultimediaObject instance = new MultimediaObject(file);
+ MultimediaInfo result = instance.getInfo();
+ assertEquals("matroska", result.getFormat(), "Invalid video format");
+ assertEquals("vp8", result.getVideo().getDecoder(), "Invalid video decoder format");
+ assertEquals("opus", result.getAudio().getDecoder(), "Invalid audio decoder format");
+
+ }
}
diff --git a/jave-core/pom.xml b/jave-core/pom.xml
index 51e7ccf..76b3ed9 100644
--- a/jave-core/pom.xml
+++ b/jave-core/pom.xml
@@ -4,7 +4,7 @@
ws.schild
jave-core
jar
- 2.7.1
+ 2.7.2
Jave core package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
ffmpeg project. Developers can take take advantage of JAVE2 to transcode
diff --git a/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java b/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java
index 64af14c..9949aa1 100644
--- a/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java
+++ b/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java
@@ -43,7 +43,7 @@ public class DefaultFFMPEGLocator extends FFMPEGLocator {
* Trace the version of the bundled ffmpeg executable. It's a counter: every
* time the bundled ffmpeg change it is incremented by 1.
*/
- private static final String MY_EXE_VERSION = "2.7.1";
+ private static final String MY_EXE_VERSION = "2.7.2";
/**
* The ffmpeg executable file path.
diff --git a/jave-core/src/main/java/ws/schild/jave/MultimediaObject.java b/jave-core/src/main/java/ws/schild/jave/MultimediaObject.java
index 3b8798c..9e17884 100644
--- a/jave-core/src/main/java/ws/schild/jave/MultimediaObject.java
+++ b/jave-core/src/main/java/ws/schild/jave/MultimediaObject.java
@@ -214,7 +214,10 @@ private MultimediaInfo parseMultimediaInfo(String source,
EncoderException {
Pattern p1 = Pattern.compile("^\\s*Input #0, (\\w+).+$\\s*",
Pattern.CASE_INSENSITIVE);
- Pattern p2 = Pattern.compile(
+ Pattern p21 = Pattern.compile(
+ "^\\s*Duration:.*$",
+ Pattern.CASE_INSENSITIVE);
+ Pattern p22 = Pattern.compile(
"^\\s*Duration: (\\d\\d):(\\d\\d):(\\d\\d)\\.(\\d\\d).*$",
Pattern.CASE_INSENSITIVE);
Pattern p3 = Pattern.compile(
@@ -257,22 +260,32 @@ private MultimediaInfo parseMultimediaInfo(String source,
}
case 1:
{
- Matcher m = p2.matcher(line);
- if (m.matches())
+ Matcher m1 = p21.matcher(line);
+ Matcher m2 = p22.matcher(line);
+ if (m1.matches())
{
- long hours = Integer.parseInt(m.group(1));
- long minutes = Integer.parseInt(m.group(2));
- long seconds = Integer.parseInt(m.group(3));
- long dec = Integer.parseInt(m.group(4));
- long duration = (dec * 10L) + (seconds * 1000L)
- + (minutes * 60L * 1000L)
- + (hours * 60L * 60L * 1000L);
- info.setDuration(duration);
- step++;
- } else
+ if (m2.matches())
+ {
+ long hours = Integer.parseInt(m2.group(1));
+ long minutes = Integer.parseInt(m2.group(2));
+ long seconds = Integer.parseInt(m2.group(3));
+ long dec = Integer.parseInt(m2.group(4));
+ long duration = (dec * 10L) + (seconds * 1000L)
+ + (minutes * 60L * 1000L)
+ + (hours * 60L * 60L * 1000L);
+ info.setDuration(duration);
+ step++;
+ } else
+ {
+ LOG.warn("Invalid duration found {}", line);
+ step++;
+ // step = 3;
+ }
+ }
+ else
{
// step = 3;
- }
+ }
break;
}
case 2:
diff --git a/jave-example/pom.xml b/jave-example/pom.xml
index 587ef2c..211862c 100644
--- a/jave-example/pom.xml
+++ b/jave-example/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-example
12
@@ -66,12 +66,12 @@
ws.schild
jave-core
- 2.7.1
+ 2.7.2
ws.schild
jave-nativebin-linux32
- 2.7.1
+ 2.7.2
diff --git a/jave-nativebin-linux32/pom.xml b/jave-nativebin-linux32/pom.xml
index df4cbc5..f1eb940 100644
--- a/jave-nativebin-linux32/pom.xml
+++ b/jave-nativebin-linux32/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-nativebin-linux32
Jave linux 32 bit native package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
diff --git a/jave-nativebin-linux64/pom.xml b/jave-nativebin-linux64/pom.xml
index 9fe01e9..6be1470 100644
--- a/jave-nativebin-linux64/pom.xml
+++ b/jave-nativebin-linux64/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-nativebin-linux64
Jave linux 64 bit native package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
diff --git a/jave-nativebin-osx64/pom.xml b/jave-nativebin-osx64/pom.xml
index 5888bf2..1115b68 100644
--- a/jave-nativebin-osx64/pom.xml
+++ b/jave-nativebin-osx64/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-nativebin-osx64
Jave OSX 64 bit native package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
diff --git a/jave-nativebin-win32/pom.xml b/jave-nativebin-win32/pom.xml
index 9023b57..b1423d1 100644
--- a/jave-nativebin-win32/pom.xml
+++ b/jave-nativebin-win32/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-nativebin-win32
Jave windows 32 bit native package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
diff --git a/jave-nativebin-win64/pom.xml b/jave-nativebin-win64/pom.xml
index 2dadd69..c3f580d 100644
--- a/jave-nativebin-win64/pom.xml
+++ b/jave-nativebin-win64/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ws.schild
jar
- 2.7.1
+ 2.7.2
jave-nativebin-win64
Jave windows 64 bit native package
The JAVE (Java Audio Video Encoder) library is Java wrapper on the
diff --git a/pom.xml b/pom.xml
index ae30bc3..6dcdb35 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,14 +4,14 @@
jave-modules
pom
- 2.7.1
+ 2.7.2
1.8
1.8
UTF-8
- 2.7.1
+ 2.7.2
Jave master project
Jave master project
https://github.com/a-schild/jave2