public static void main(String[] args) throws IOException { new H264TrackImpl(new FileDataSourceImpl("C:\\dev\\mp4parser\\tos.264")); }
FileDataSourceImpl file = new FileDataSourceImpl(src); Movie movie = MovieCreator.build(file); fc.close(); fos.close(); file.close(); file.close();
public static void main(String[] args) throws IOException { File dir = new File("C:\\dev\\ASAN\\record"); File[] h264s = dir.listFiles(); Arrays.sort(h264s); int i = 0; for (File h264 : h264s) { AbstractH26XTrack.LookAhead lookAhead = new AbstractH26XTrack.LookAhead(new FileDataSourceImpl(h264)); ByteBuffer nal = null; while ((nal = findNextNal(lookAhead))!=null) { int type = nal.get(0); int nal_ref_idc = (type >> 5) & 3; int nal_unit_type = type & 0x1f; //System.err.println(nal_unit_type); if (nal_unit_type == 7) { byte[] nalArray = new byte[nal.remaining()]; nal.get(nalArray); //SeqParameterSet sps = SeqParameterSet.read(new CleanInputStream(new ByteArrayInputStream(nalArray))); System.err.println(i++); } else { i++; } } //System.err.println("--------------"); } } }
public static void main(String[] args) throws IOException { Movie movie = new Movie(); Track track = new DTSTrackImpl(new FileDataSourceImpl("C:\\Users\\sannies\\Downloads\\Big_Dom_Thl_ENG_5.1_HD_Lossless_1510.dtshd")); movie.addTrack(track); DefaultMp4Builder builder = new DefaultMp4Builder(); Container container = builder.build(movie); FileOutputStream fos = new FileOutputStream("c:\\dev\\isoparser-dtshd-test.mp4"); FileChannel fc = fos.getChannel(); container.writeContainer(fc); fos.close(); } }
public static void main(String[] args) throws IOException { AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl("C:\\content\\Cosmos Laundromat small.aac")); H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl("C:\\content\\Cosmos Laundromat small.264")); Movie m = new Movie(); m.addTrack(aacTrack); m.addTrack(h264Track); DefaultMp4Builder mp4Builder = new DefaultMp4Builder(); Container out = mp4Builder.build(m); FileOutputStream fos = new FileOutputStream("output.mp4"); FileChannel fc = fos.getChannel(); out.writeContainer(fc); fos.close(); } }
public static void main(String[] args) throws IOException { EC3TrackImpl track = new EC3TrackImpl(new FileDataSourceImpl("C:\\Users\\sannies\\Downloads\\audio.ac3")); Movie m = new Movie(); m.addTrack(track); DefaultMp4Builder mp4Builder = new DefaultMp4Builder(); Container isoFile = mp4Builder.build(m); FileOutputStream fos = new FileOutputStream("output.mp4"); FileChannel fc = fos.getChannel(); isoFile.writeContainer(fc); fos.close(); } }
public static void main(String[] args) throws IOException { H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl("/Users/sannies/dev/mp4parser/1532667754113.h264")); Movie m = new Movie(); m.addTrack(h264Track); Mp4Builder builder = new DefaultMp4Builder(); Container c = builder.build(m); c.writeContainer(new FileOutputStream("/Users/sannies/dev/mp4parser/1532667754113-meins.mp4").getChannel()); } }
public static void main(String[] args) throws IOException { Track ac3Track = new AC3TrackImpl(new FileDataSourceImpl("C:\\dev\\mp4parser\\examples\\src\\main\\resources\\count-english.ac3")); //Track ac3Track = new AC3TrackImplOld(new BufferedInputStream(new FileInputStream("C:\\dev\\mp4parser\\examples\\src\\main\\resources\\count-english.ac3"))); Movie m = new Movie(); m.addTrack(ac3Track); DefaultMp4Builder mp4Builder = new DefaultMp4Builder(); Container out = mp4Builder.build(m); FileOutputStream fos = new FileOutputStream("output.mp4"); FileChannel fc = fos.getChannel(); out.writeContainer(fc); fos.close(); } }
public static void main(String[] args) throws IOException { H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl("C:\\dev\\mp4parser\\isoparser\\src\\test\\resources\\count.h264")); //AACTrackImpl aacTrack = new AACTrackImpl(new FileInputStream("/home/sannies2/Downloads/lv.aac").getChannel()); Movie m = new Movie(); m.addTrack(h264Track); //m.addTrack(aacTrack); { Container out = new DefaultMp4Builder().build(m); FileOutputStream fos = new FileOutputStream(new File("h264_output.mp4")); FileChannel fc = fos.getChannel(); out.writeContainer(fc); fos.close(); } } }
public static void main(String[] args) throws IOException { DataSource video_file = new FileDataSourceImpl("c:/dev/mp4parser2/source_video.h264"); DataSource audio_file = new FileDataSourceImpl("c:/dev/mp4parser2/source_audio.aac"); int duration = 30472; H264TrackImpl h264Track = new H264TrackImpl(video_file, "eng", 15000, 1001); //supplied duration for the attached file was AACTrackImpl aacTrack = new AACTrackImpl(audio_file); Movie movie = new Movie(); movie.addTrack(h264Track); //movie.addTrack(aacTrack); Container out = new DefaultMp4Builder().build(movie); FileOutputStream fos = new FileOutputStream(new File("c:/dev/mp4parser2/checkme.mp4")); out.writeContainer(fos.getChannel()); fos.close(); } }
public static void main(String[] args) throws IOException { Track track = new H265TrackImpl(new FileDataSourceImpl("c:\\content\\test-UHD-HEVC_01_FMV_Med_track1.hvc")); Movie movie = new Movie(); movie.addTrack(track); DefaultMp4Builder mp4Builder = new DefaultMp4Builder(); Container c = mp4Builder.build(movie); c.writeContainer(new FileOutputStream("output.mp4").getChannel()); }
public static void main(String[] args) throws IOException, XPathExpressionException, SAXException, ParserConfigurationException, URISyntaxException { Movie v = new Movie(); // = MovieCreator.build("C:\\dev\\DRMTODAY-872\\31245689abb7c52a3d0721447bddd6cd_Tears_Of_Steel_600000.mp4"); Track audio = new H264TrackImpl(new FileDataSourceImpl("C:\\Users\\sannies\\Downloads\\test.h264")); v.addTrack(audio); Mp4Builder defaultMp4Builder = new DefaultMp4Builder(); Container c = defaultMp4Builder.build(v); c.writeContainer(new FileOutputStream("output.mp4").getChannel()); } }
public static void main(String[] args) throws IOException { new H264TrackImpl(new FileDataSourceImpl("C:\\dev\\mp4parser\\tos.264")); }
Movie m = MovieCreator.build("Path/to/your/video-mp4"); AACTrackImpl audio = new AACTrackImpl(new FileDataSourceImpl("Path/to/your/aac")); m.addTrack(audio); Container c = new DefaultMp4Builder().build(m); c.writeContainer(new FileOutputStream("/path/to/your/destination.mp4").getChannel());
try { String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath(); H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl(baseDir + "/video.h264")); AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl( baseDir + "/aac_sample.aac" )); Movie movie = new Movie(); movie.addTrack(h264Track); movie.addTrack(aacTrack); Container mp4file = new DefaultMp4Builder().build(movie); FileChannel fc = new FileOutputStream(new File(baseDir +"/output.mp4")).getChannel(); mp4file.writeContainer(fc); fc.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
public static void main(String[] args) throws IOException { Track track = new H265TrackImpl(new FileDataSourceImpl("c:\\content\\test-UHD-HEVC_01_FMV_Med_track1.hvc")); Movie movie = new Movie(); movie.addTrack(track); DefaultMp4Builder mp4Builder = new DefaultMp4Builder(); Container c = mp4Builder.build(movie); c.writeContainer(new FileOutputStream("output.mp4").getChannel()); }
try { String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath(); H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl(baseDir + "/video.h264")); AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl( baseDir + "/aac_sample.aac" )); Movie movie = new Movie(); movie.addTrack(h264Track); movie.addTrack(aacTrack); Container mp4file = new DefaultMp4Builder().build(movie); FileChannel fc = new FileOutputStream(new File(baseDir +"/output.mp4")).getChannel(); mp4file.writeContainer(fc); fc.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
for (File inputFile : inputFiles) { if (inputFile.getName().endsWith(".aac")) { Track track = new AACTrackImpl(new FileDataSourceImpl(inputFile)); track.getTrackMetaData().setLanguage(getFilesLanguage(inputFile).getISO3Language()); tracks.add(track); } else if (inputFile.getName().endsWith(".ac3")) { Track track = new AC3TrackImpl(new FileDataSourceImpl(inputFile)); track.getTrackMetaData().setLanguage(getFilesLanguage(inputFile).getISO3Language()); tracks.add(track); } else if (inputFile.getName().endsWith(".h264")) { Track track = new H264TrackImpl(new FileDataSourceImpl(inputFile)); tracks.add(track); } else if (inputFile.getName().endsWith(".ec3")) { Track track = new EC3TrackImpl(new FileDataSourceImpl(inputFile)); track.getTrackMetaData().setLanguage(getFilesLanguage(inputFile).getISO3Language()); tracks.add(track); } else if (inputFile.getName().endsWith(".dtshd")) { Track track = new DTSTrackImpl(new FileDataSourceImpl(inputFile)); track.getTrackMetaData().setLanguage(getFilesLanguage(inputFile).getISO3Language()); tracks.add(track);
tracks.add(new H264TrackImpl(new FileDataSourceImpl(f))); } else if (H265_FILE_EXTS.contains(fileExt)) { tracks.add(new H265TrackImpl(new FileDataSourceImpl(f))); } else if (AAC_FILE_EXTS.contains(fileExt)) { AACTrackImpl a = new AACTrackImpl(new FileDataSourceImpl(f)); String lang = "eng"; if (!outputOptions.containsKey("lang")) {
final Movie movie = MovieCreator.build(new FileDataSourceImpl(srcFileDir));