FileDocCategorySizeDatePackage
ChangeInplaceExample.javaAPI Docmp4parser 1.0-RC-171241Wed Dec 19 20:10:38 GMT 2012com.googlecode.mp4parser.stuff

ChangeInplaceExample

public class ChangeInplaceExample extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        long start = System.currentTimeMillis();
        FileChannel rChannel = new RandomAccessFile("/media/scratch/CSI.S12E21.HDTV.x264-LOL.mp4", "r").getChannel();
        FileChannel wChannel = new RandomAccessFile("/media/scratch/ThreeHundredFourtyThreeMB_2.mp4", "rw").getChannel();
        IsoFile isoFile = new IsoFile(rChannel);
        HandlerBox hdlr = (HandlerBox) Path.getPath(isoFile, "/moov[0]/trak[0]/mdia[0]/hdlr[0]");
        hdlr.setName(RandomStringUtils.random(hdlr.getName().length()));
        isoFile.getBox(wChannel);
        rChannel.close();
        wChannel.close();
        System.err.println((System.currentTimeMillis() - start) + "ms");
        new File("/media/scratch/ThreeHundredFourtyThreeMB_2.mp4").delete();