// AACTrackImpl aacTrack = new AACTrackImpl(Ac3Example.class.getResourceAsStream("/sample.aac"));
H264TrackImpl h264Track = new H264TrackImpl(new FileInputStream("/Users/magnus/Projects/castlabs/cff/DTS_Paint_HD1/DTS_Paint_HD1.h264"));
AACTrackImpl aacTrack = new AACTrackImpl(new FileInputStream("/Users/magnus/Projects/castlabs/cff/DTS_Paint_HD1/DTS_Paint.aac"));
// H264TrackImpl h264Track = new H264TrackImpl(new FileInputStream("/Users/magnus/Projects/castlabs/cff/Dolby_Countdown_1920x1080p_H264_Stereo_AAC_51_DDPlus/Dolby_Countdown_1920x1080p.h264"));
// AACTrackImpl aacTrack = new AACTrackImpl(new FileInputStream("/Users/magnus/Projects/castlabs/cff/Dolby_Countdown_1920x1080p_H264_Stereo_AAC_51_DDPlus/Dolby_Countdown_Stereo.aac"));
Movie m = new Movie();
m.addTrack(h264Track);
m.addTrack(aacTrack);
{
IsoFile out = new DefaultMp4Builder().build(m);
FileOutputStream fos = new FileOutputStream(new File("h264_output.mp4"));
out.getBox(fos.getChannel());
fos.close();
}
{
FragmentedMp4Builder fragmentedMp4Builder = new FragmentedMp4Builder();
fragmentedMp4Builder.setIntersectionFinder(new SyncSampleIntersectFinderImpl());
IsoFile out = fragmentedMp4Builder.build(m);
FileOutputStream fos = new FileOutputStream(new File("h264_frag_output.mp4"));
out.getBox(fos.getChannel());
fos.close();
}