www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
|
|
@ -0,0 +1,38 @@
|
|||
package org.jcodec.movtool;
|
||||
|
||||
import java.io.File;
|
||||
import org.jcodec.containers.mp4.boxes.Box;
|
||||
import org.jcodec.containers.mp4.boxes.MediaHeaderBox;
|
||||
import org.jcodec.containers.mp4.boxes.MovieBox;
|
||||
import org.jcodec.containers.mp4.boxes.MovieFragmentBox;
|
||||
import org.jcodec.containers.mp4.boxes.NodeBox;
|
||||
import org.jcodec.containers.mp4.boxes.TrakBox;
|
||||
|
||||
public class ChangeTimescale {
|
||||
public static void main1(String[] args) throws Exception {
|
||||
if (args.length < 2) {
|
||||
System.out.println("Syntax: chts <movie> <timescale>");
|
||||
System.exit(-1);
|
||||
}
|
||||
final int ts = Integer.parseInt(args[1]);
|
||||
if (ts < 600) {
|
||||
System.out.println("Could not set timescale < 600");
|
||||
System.exit(-1);
|
||||
}
|
||||
new InplaceMP4Editor().modify(new File(args[0]), new MP4Edit() {
|
||||
public void apply(MovieBox mov) {
|
||||
TrakBox vt = mov.getVideoTrack();
|
||||
MediaHeaderBox mdhd = NodeBox.<MediaHeaderBox>findFirstPath(vt, MediaHeaderBox.class, Box.path("mdia.mdhd"));
|
||||
int oldTs = mdhd.getTimescale();
|
||||
if (oldTs > ts)
|
||||
throw new RuntimeException("Old timescale (" + oldTs + ") is greater then new timescale (" + ts + "), not touching.");
|
||||
vt.fixMediaTimescale(ts);
|
||||
mov.fixTimescale(ts);
|
||||
}
|
||||
|
||||
public void applyToFragment(MovieBox mov, MovieFragmentBox[] fragmentBox) {
|
||||
throw new RuntimeException("Unsupported");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue