sannies / mp4parser

A Java API to read, write and create MP4 files
Apache License 2.0
2.75k stars 566 forks source link

After merging aac and mp4 files, the merged code is not rendering audio. #366

Open Prasadph123 opened 5 years ago

Prasadph123 commented 5 years ago

Movie movie = MovieCreator.build(videopath); AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl(audiopath)); CroppedTrack aacCroppedTrack = new CroppedTrack(aacTrack, 1, aacTrack.getSamples().size()); movie.addTrack(aacCroppedTrack); Container mp4file = new DefaultMp4Builder().build(movie); FileOutputStream fileOutputStream = new FileOutputStream(output); FileChannel fc = fileOutputStream.getChannel(); mp4file.writeContainer(fc); fileOutputStream.close();

Where audiopath = directory + "/my_song.aac"; and videopath = directory + "/myvideo.mp4"; If I try to play the output video, only video is getting played. Audio is not playing. Any solution for this?

rasfront commented 5 years ago

Did you fix problem?

nguyen-tam commented 4 years ago

Movie movie = MovieCreator.build(videopath); AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl(audiopath)); CroppedTrack aacCroppedTrack = new CroppedTrack(aacTrack, 1, aacTrack.getSamples().size()); movie.addTrack(aacCroppedTrack); Container mp4file = new DefaultMp4Builder().build(movie); FileOutputStream fileOutputStream = new FileOutputStream(output); FileChannel fc = fileOutputStream.getChannel(); mp4file.writeContainer(fc); fileOutputStream.close();

Where audiopath = directory + "/my_song.aac"; and videopath = directory + "/myvideo.mp4"; If I try to play the output video, only video is getting played. Audio is not playing. Any solution for this?

How did you fix this issue?