Closed mmaatuq closed 5 years ago
If the decoder throws an exception, it means that the SRT file is not valid. What is the content of the file in question? Also, could you please check the formatting of your posts before submitting them, the above is unnecessarily hard to read.
Thanks for your support
Hello, the below exception is thrown while trying to run extraction using cineast ` 2019-10-13 00:40:37.893 [extraction-file-handler-thread] ERROR o.v.c.c.r.f.GenericExtractionItemHandler - Media Type VIDEO does not sup port file type application/octet-stream 2019-10-13 00:40:37.894 [extraction-file-handler-thread] DEBUG o.v.c.c.r.p.TreeWalkContainerIteratorProvider - Next path: /var/www/html /test/1.mp4, base /var/www/html/test, res 1.mp4 2019-10-13 00:40:37.894 [extraction-file-handler-thread] INFO o.v.c.c.r.f.GenericExtractionItemHandler - Processing path ExtractionItem Container{object=MediaObjectDescriptor{objectId='null', name='1.mp4', path='1.mp4', exists=false, mediatypeId=99}, metadata=[], path=/v ar/www/html/test/1.mp4} and mediatype VIDEO 2019-10-13 00:40:38.867 [extraction-file-handler-thread] INFO o.v.c.c.d.s.s.SRTSubTitleDecoder - Loading SRT subtitle from /var/www/htm l/test/1.srt 2019-10-13 00:40:38.962 [extraction-file-handler-thread] WARN o.v.c.c.d.s.s.SRTSubTitleDecoder - Error while parsing subtitle item 2019-10-13 00:40:38.964 [extraction-file-handler-thread] WARN o.v.c.c.d.s.s.SRTSubTitleDecoder - java.lang.NumberFormatException: For i nput string: "1" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615) at java.lang.Thread.run(Thread.java:748) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.vitrivr.cineast.core.decode.subtitle.SubtitleDecoderFactory.subtitleForFile(SubtitleDecoderFactory.java:77) at org.vitrivr.cineast.core.decode.subtitle.SubtitleDecoderFactory.subtitleForVideo(SubtitleDecoderFactory.java:56) at org.vitrivr.cineast.core.decode.video.FFMpegVideoDecoder.init(FFMpegVideoDecoder.java:430) at org.vitrivr.cineast.core.run.filehandler.GenericExtractionItemHandler.run(GenericExtractionItemHandler.java:208) at java.lang.Thread.run(Thread.java:748)
actully i tried to figure out if it's a problem with class SRTSubTitleDecoder itself so i somehow seperate it like below
import java.io.BufferedReader; import java.io.IOException; import java.nio.file.Paths; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; / import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vitrivr.cineast.core.decode.subtitle.SubTitleDecoder; import org.vitrivr.cineast.core.decode.subtitle.SubtitleItem; import org.vitrivr.cineast.core.util.LogHelper; / public class SRTSubTitleDecoder {
// LOGGER.info("Loading SRT subtitle from {}", file); try (final BufferedReader reader = Files.newBufferedReader(file)) { String line1, line2, line3; StringBuffer text; int id = 0; long start, end; loop: while ((line1 = reader.readLine()) != null) {
// items.add(new SRTSubtitleItem(id, start, end, text.toString())); } catch (NumberFormatException e) { // LOGGER.warn("Error while parsing subtitle item"); // LOGGER.warn(LogHelper.getStackTrace(e)); } } ` and i run that class against the same SRT file and it worked no exceptions were thrown.