OSDN Git Service

d97eb6c3fa5a0d3ebd78a75eaba55ed91dbce397
[rec10/rec10-git.git] / jTsSplitter / trunk / src / jtssplitter / Main.java
1 /*
2  * jTsSplitter - java based mpeg2ts splitter.
3  * Copyright (C) 2009-2012 Yukikaze
4  */
5 package jtssplitter;
6
7 import java.io.File;
8
9
10 /**
11  *
12  * @author Administrator
13  */
14 public class Main {
15
16     /**
17      * @param args the command line arguments
18      *
19      */
20     public static void main(String[] args) {
21         // TODO code application logic here
22         String inf;
23         String outf;
24         int ch = 0;
25         inf = "";
26         outf = "";
27          System.out.println("USAGE : \njava -jar jTsSplitter.jar <Input file> <Output file> [Option ch number]");
28          System.out.println("Option ch number is used in CS splitting.\n");
29         for (int i = 0; i < args.length; i++) {
30             System.out.println(((Integer)i).toString()+":"+args[i]);
31         }
32         if (args.length > 1) {
33             if (args[0].trim().toUpperCase().equals("-ch".toUpperCase())){
34                 Chlist chl=new Chlist();
35                 chl.writeCHList(args[1], args[2],-1,-1);
36                 System.exit(0);
37             }else if (args[0].trim().toUpperCase().equals("-bs".toUpperCase())){
38                 Chlist chl=new Chlist();
39                 chl.writeCHList(args[1], args[2],-1,290);
40                 System.exit(0);
41             }else if (args[0].trim().toUpperCase().equals("-cs".toUpperCase())){
42                 Chlist chl=new Chlist();
43                 chl.writeCHList(args[1], args[2],-1,-1);
44                 System.exit(0);
45             }
46
47             inf = args[0];
48             outf = args[1];
49             if (args.length > 2) {
50                 ch = Integer.parseInt(args[2].trim(), 10);
51             }
52         }
53         Tsfile t1 = new Tsfile();
54         File f=new File(inf);
55         if (f.length()>1000*1000){
56             t1.splitTS_byte(inf, outf, ch);
57         }
58         System.exit(0);
59     }
60 }