a-schild / jave2

The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project
GNU General Public License v3.0
1.2k stars 246 forks source link

getProcessExitCode() throws NPE #224

Closed yantimirov-timur closed 7 months ago

yantimirov-timur commented 1 year ago

When i running 'encode()', last line thow NPE.

      String line;
      ConversionOutputAnalyzer outputAnalyzer = new ConversionOutputAnalyzer(duration, listener);
      RBufferedReader reader = new RBufferedReader(new InputStreamReader(ffmpeg.getErrorStream()));
      while ((line = reader.readLine()) != null) {
        outputAnalyzer.analyzeNewLine(line);
      }
      if (outputAnalyzer.getLastWarning() != null) {
        if (!SUCCESS_PATTERN.matcher(lastWarning).matches()) {
          throw new EncoderException("No match for: " + SUCCESS_PATTERN + " in " + lastWarning);
        }
      }
      /*
       * TODO: This is not thread safe. This needs to be a resulting value from the call to the 
       * Encoder. We can create a separate EncoderResult, but not a stateful variable.
       */
      unhandledMessages = outputAnalyzer.getUnhandledMessages();
      int exitCode = ffmpeg.getProcessExitCode();
yantimirov-timur commented 1 year ago

java.lang.NullPointerException: null at ws.schild.jave.process.ProcessWrapper.getProcessExitCode(ProcessWrapper.java:219) at ws.schild.jave.Encoder.encode(Encoder.java:569) at ws.schild.jave.Encoder.encode(Encoder.java:351) at ws.schild.jave.Encoder.encode(Encoder.java:318)

a-schild commented 1 year ago

Which version are you using? Where is the code where ffmpeg is instanciated?