public static Movie build(String file) throws IOException { File f = new File(file); FileInputStream fis = new FileInputStream(f); Movie m = build(fis.getChannel(), new FileRandomAccessSourceImpl(new RandomAccessFile(f, "r")), file); fis.close(); return m; }
public static void main(String[] args) throws IOException { IsoFile isoFile = new IsoFile("C:\\Users\\sannies\\Downloads\\gesamt.mp4"); FragmentedMp4SampleList f = new FragmentedMp4SampleList(1, isoFile, new FileRandomAccessSourceImpl(new RandomAccessFile("C:\\Users\\sannies\\Downloads\\gesamt.mp4", "r"))); System.err.println(f.get(0)); } }
public static void main(String[] args) throws IOException { String basePath = GetDuration.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/dash/"; Movie m = new Movie(); IsoFile baseIsoFile = new IsoFile(basePath + "redbull_100kbit_dash.mp4"); List<IsoFile> fragments = new LinkedList<IsoFile>(); for (int i = 1; i < 9; i++) { fragments.add(new IsoFile(basePath + "redbull_10sec" + i + ".m4s")); } m.addTrack(new Mp4TrackImpl(1, new IsoFile("redbull_100kbit_dash.mp4"), new FileRandomAccessSourceImpl(new RandomAccessFile("redbull_100kbit_dash.mp4", "r")), "test")); DefaultMp4Builder builder = new DefaultMp4Builder(); Container stdMp4 = builder.build(m); FileOutputStream fos = new FileOutputStream("out.mp4"); stdMp4.writeContainer(fos.getChannel()); fos.close(); } }
Mp4SampleList sl = new Mp4SampleList(trackId, isoFile, new FileRandomAccessSourceImpl( new RandomAccessFile("/Users/sannies/dev/common_transcoding-packager-encrypter/dashencrypter/15000_dv5.mp4", "r")));
public static void main(String[] args) throws IOException { String f = Avc1ToAvc3Example.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/1365070268951.mp4"; Movie m = MovieCreator.build(new FileInputStream(f).getChannel(), new FileRandomAccessSourceImpl(new RandomAccessFile(f, "r")), "inmem"); Movie m2 = new Movie(); for (Track track : m.getTracks()) { if (track.getSampleEntries().get(0).getType().equals("avc1")) { m2.addTrack(new Avc1ToAvc3TrackImpl(track)); } else { m2.addTrack(track); } } new FragmentedMp4Builder().build(m2).writeContainer(new FileOutputStream("output.mp4").getChannel()); IsoFile i = new IsoFile("output.mp4"); for (Box box : i.getBoxes()) { System.err.println(box + "@-nooffsets"); } } }
Mp4SampleList sl = new Mp4SampleList(trackId, isoFile, new FileRandomAccessSourceImpl( new RandomAccessFile("D:\\downloads\\cracked.s01e01.hdtv.x264-2hd.mp4", "r")));
public static Movie build(String file) throws IOException { File f = new File(file); FileInputStream fis = new FileInputStream(f); Movie m = build(fis.getChannel(), new FileRandomAccessSourceImpl(new RandomAccessFile(f, "r")), file); fis.close(); return m; }
tracks.add(new Mp4TrackImpl(trackBox.getTrackHeaderBox().getTrackId(), isoFile, new FileRandomAccessSourceImpl(new RandomAccessFile(f, "r")), f.getName()));