1

Error Log: java.lang.RuntimeException: A cast to int has gone wrong. Please contact the mp4parser discussion group (3292244048)

Fatal Exception: java.lang.RuntimeException on MovieCreator.build()

I need help

Movie movieA = null;
try {
    movieA = MovieCreator.build(firstFile.getAbsolutePath());
} catch (IOException e) {
    e.printStackTrace();
}
final Movie finalMovie = new Movie();
List<Track> audioTracks = new ArrayList<>();
ArrayList<Movie> movilist=new ArrayList<>();
for(int i=0;i<value;i++){
    movilist.add(movieA);
}

for (Movie movie : movilist) {
    for (Track track : movie.getTracks()) {
        if (track.getHandler().equals("soun")) {
            audioTracks.add(track);
        }
    }
}
try {
    finalMovie.addTrack(new AppendTrack(audioTracks.toArray(new Track[audioTracks.size()])));
} catch (IOException e) {
    e.printStackTrace();
}

final Container container = new DefaultMp4Builder().build(finalMovie);
File mergedFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + Constants.PROJECT_FOLDER + "/Sounds/newsound123" + ".mp3");
try {
    final FileOutputStream fos = new FileOutputStream(mergedFile);
} catch (FileNotFoundException e) {
    e.printStackTrace();
}
FileChannel fc = null;
try {
    fc = new RandomAccessFile(mergedFile, "rw").getChannel();
} catch (FileNotFoundException e) {
    e.printStackTrace();
}
try {
    container.writeContainer(fc);
} catch (IOException e) {
    e.printStackTrace();
}
try {
    fc.close();
} catch (IOException e) {
    e.printStackTrace();
}
return mergedFile.getAbsolutePath();
Chetan Patel
  • 180
  • 8

0 Answers0