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,36 @@
|
|||
package org.jcodec.movtool;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.jcodec.containers.mp4.MP4Util;
|
||||
|
||||
public class WebOptimize {
|
||||
public static void main1(String[] args) throws IOException {
|
||||
if (args.length < 1) {
|
||||
System.out.println("Syntax: optimize <movie>");
|
||||
System.exit(-1);
|
||||
}
|
||||
File tgt = new File(args[0]);
|
||||
File src = hidFile(tgt);
|
||||
tgt.renameTo(src);
|
||||
try {
|
||||
MP4Util.Movie movie = MP4Util.createRefFullMovieFromFile(src);
|
||||
new Flatten().flatten(movie, tgt);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
tgt.renameTo(new File(tgt.getParentFile(), tgt.getName() + ".error"));
|
||||
src.renameTo(tgt);
|
||||
}
|
||||
}
|
||||
|
||||
public static File hidFile(File tgt) {
|
||||
File src = new File(tgt.getParentFile(), "." + tgt.getName());
|
||||
if (src.exists()) {
|
||||
int i = 1;
|
||||
do {
|
||||
src = new File(tgt.getParentFile(), "." + tgt.getName() + "." + i++);
|
||||
} while (src.exists());
|
||||
}
|
||||
return src;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue