OSDN Git Service

add chlist output option.
[rec10/rec10-git.git] / jTsSplitter / trunk / src / jtssplitter / Main.java
1 /*
2  * jTsSplitter - java based mpeg2ts splitter.
3  * Copyright (C) 2009-2010 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         for (int i = 0; i < args.length; i++) {
28             System.out.println(((Integer)i).toString()+":"+args[i]);
29         }
30         if (args.length > 1) {
31             inf = args[0];
32             outf = args[1];
33             if (args.length > 2) {
34                 ch = Integer.parseInt(args[2].trim(), 10);
35             }
36             if (args[0].trim().toUpperCase().equals("-ch".toUpperCase())){
37                 Chlist chl=new Chlist();
38                 chl.writeCHList(args[1], args[2]);
39                 System.exit(0);
40             }
41         }
42         Tsfile t1 = new Tsfile();
43         File f=new File(inf);
44         if (f.length()>1000*1000){
45             t1.splitTS_byte(inf, outf, ch);
46         }
47         System.exit(0);
48     }
49 }