a-schild / jave2

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

Exit code of ffmpeg encoding run is 137 #164

Closed naffan2014 closed 3 years ago

naffan2014 commented 3 years ago

i do jave format code code as below:

public List<String> formatVideo(Long taskId, List<String> videoPathList, DirType targetDir, String targetFormat)
        throws IllegalArgumentException,EncoderException {
        List<String> formattedList = new ArrayList<>();
        String targetPath =  fileInfra.makeDirPath(taskId, targetDir);

        AudioAttributes audio = new AudioAttributes();
        audio.setCodec(DIRECT_STREAM_COPY);
        VideoAttributes video = new VideoAttributes();
        video.setCodec(DIRECT_STREAM_COPY);
        EncodingAttributes attrs = new EncodingAttributes();
        attrs.setAudioAttributes(audio);
        attrs.setVideoAttributes(video);
        for (String o: videoPathList) {
            String[] keySplit = o.split("/");
            String fileName = keySplit[keySplit.length - 1];
            String targetName = fileName.substring(0,fileName.lastIndexOf(".") + 1) + targetFormat;
            File target = new File(targetPath, targetName);
            if (target.exists()) {
                target.delete();
            }
            Encoder encoder = new Encoder();
            try {
                encoder.encode(new MultimediaObject( new File(o)), target, attrs);
            }catch (Exception e){
                throw e;
            }
            formattedList.add(targetPath + targetName);
        }
        return formattedList;
    }

it occurs error code is 137 . what this code mean?

a-schild commented 3 years ago

Perhaps this? https://stackoverflow.com/questions/19548027/ffmpeg-closes-with-return-code-137

naffan2014 commented 3 years ago

thank u