• A sample html oputput result: index.html

  • The command line scenario:

    bash-2.05b$ ./tstool --help
    Usage: tstool [options] ... ts_file
    
    Analyzes and manipulates the ts_file, such as:
      - print brief analysis result (by default)
      - change packe size from 204 to 188 bytes
      - change packe size from 188 to 204 bytes
      - change pid(s) in the ts_file
      - delete pid(s) from the ts_file
      - extract pid(s) from the ts_file
      - defrag the ts_file and save it
      - save the analysis result in html format
    
    Options:
      -h, --help       print this help, then exit
      -V, --version    print version info, then exit
      -v, --verbose    verbosely report processing
      -1, --204to188   change packet size from 204 to 188 bytes, save new ts
                       as specified by -o option, then exit
      -2, --188to204   change packet size from 188 to 204 bytes, save new ts
                       as specified by -o option, then exit
      -c, --change     change pid(s) according to the option argument, save new
                       ts as specified by -o option, then exit. the argument
                       format is 'old_pid:new_pid[,old_pid:new_pid]', the pid
                       number can be either in hex (prefixed by '0x') or decimal;
                       multiple pid pairs are delimited by ','; space is not
                       allowed.
                       e.g., -c 100:200,0x100:0x200,200:0x300
      -d, --delete     delete pid(s) according to the option argument, save new
                       ts as specified by -o option, then exit. the argument
                       format is 'pid[,pid]', the pid number can be either in
                       hex (prefixed by '0x') or decimal; multiple pids are
                       delimited by ','; space is not allowed.
                       e.g., -d 100,200,0x100
      -e, --extract    extract pid(s) according to the option argument, save new
                       ts as specified by -o option, then exit. the argument
                       format is 'pid[,pid]', the pid number can be either in
                       hex (prefixed by '0x') or decimal; multiple pids are
                       delimited by ','; space is not allowed.
                       e.g., -e 100,200,0x100
      -f, --defrag     remove opentv header and/or broken packets at head/tail,
                       save new ts as specified by -o option, then exit
      -o, --output     specify output file in the option argument
      -s, --save       save html analysis result under a directory specified by
                       the option argument
    
    Report bugs to 
    bash-2.05b$ ./tstool -v -s ~/sample_output ~/tmp/ts/otvsi.ts
    checking opentv header...
    	has otv header
    checking packet size...
    	packet size is 188
    	totally 3990 packets
    building pid list...
    	pid 0x0010 (  16)...done
    	pid 0x0011 (  17)...done
    	pid 0x0000 (   0)...done
    	pid 0x0020 (  32)...done
    	pid 0x1fff (8191)...done
    building tables...
    	pat table (pid 0x0000)...done
    	cat table (pid 0x0001)...done
    	nit actual table (pid 0x0010)...done
    	nit other table (pid 0x0010)...done
    	bat table (pid 0x0011)...done
    	sdt actual table (pid 0x0011)...done
    	sdt other table (pid 0x0011)...done
    	eit actual table (pid 0x0012)...done
    	eit other table (pid 0x0012)...done
    	eit actual schedule table (pid 0x0012)...done
    	eit other schedule table (pid 0x0012)...done
    	tdt table (pid 0x0014)...done
    	tot table (pid 0x0014)...done
    	rst table (pid 0x0013)...done
    	pmt table (pid 0x0020)...done
    building result tree by parsing tables/sections...
    	attaching opentv header info...done
    	parsing & attaching PAT...done
    	parsing & attaching CAT...done
    	parsing & attaching PMT for program 0x0001 (1) => pmt pid: 0x020 (32)...done
    	parsing & attaching NIT ACTUAL...done
    	parsing & attaching NIT OTHER...done
    	parsing & attaching BAT...done
    	parsing & attaching SDT ACTUAL...done
    	parsing & attaching SDT OTHER...done
    	parsing & attaching EIT ACTUAL...done
    	parsing & attaching EIT ACTUAL SCHEDULE...done
    	parsing & attaching EIT OTHER...done
    	parsing & attaching EIT OTHER SCHEDULE...done
    	parsing & attaching TDT...done
    	parsing & attaching TOT...done
    	parsing & attaching RST...done
    	attaching pid 0x0000 PAT...done
    	attaching pid 0x0010 NIT...done
    	attaching pid 0x0011 SDT/BAT...done
    	attaching pid 0x0020 PMT...done
    	attaching pid 0x1fff NULL...done
    	attaching 64 sample packets' raw content...done
    
    
    brief report of the anaysis result
    ================================================
    
    file basic info
    ------------------
      file path: /home/bruin/tmp/ts/otvsi.ts
      file size: 752188
      opentv header exists, size: 2068
      ts data size: 750120
      packet size: 188
      packet number: 3990
    
    pid info
    --------
      pid 0x0000 (   0),     20 packets,  0.50% => PAT
      pid 0x0010 (  16),     20 packets,  0.50% => NIT
      pid 0x0011 (  17),     20 packets,  0.50% => SDT/BAT
      pid 0x0020 (  32),     20 packets,  0.50% => PMT
      pid 0x1fff (8191),   3910 packets, 97.99% => NULL
    
    psi/si info
    -----------
      PAT exists
      1 PMT exist
      NIT ACTUAL exists
      SDT ACTUAL exists
    ================================================
    for details, view the html format result (-s option).
    /home/bruin/sample_output does not exist, create it or not (y/n)?y