From a8ae0b2623f7d0c1c88fc0ba2efe836604b00c55 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 5 Jun 2019 16:11:13 +0700 Subject: [PATCH] [ffprobe] Failed to read media encoding date: Text '2014-11-04 05:52:00' could not be parsed at index 10 --- source/net/filebot/media/FFProbe.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/media/FFProbe.java b/source/net/filebot/media/FFProbe.java index af2d4c7c..901c0169 100644 --- a/source/net/filebot/media/FFProbe.java +++ b/source/net/filebot/media/FFProbe.java @@ -9,6 +9,9 @@ import java.io.File; import java.io.IOException; import java.time.Duration; import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; import java.util.Objects; @@ -114,7 +117,11 @@ public class FFProbe implements MediaCharacteristics { @Override public Instant getCreationTime() { - return getTag("creation_time").map(Instant::parse).orElse(null); + return getTag("creation_time").map(this::parseDateTime).orElse(null); + } + + private Instant parseDateTime(String s) { + return LocalDateTime.parse(s, DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ss")).toInstant(ZoneOffset.UTC); } public Map getFormat() {