dvrmerge
========

dvrmerge is a transport stream merge utility for the Comag SL100HD.
It is required as the split files don't contain a consecutive TS
packet sequence.

dvrmerge uses info.dvr to get the list of dvr files to be processed.
In each dvr file then processed dvrmerge extracts the actual amount
of ts packets required from the file from the 64k table at the
beginning of the file.

dvrmerge is released under the GPL v2 and is (c) 2009 Andreas Steinmetz,
ast@domdv.de

Usage is: dvrmerge <path to info.dvr> <output file>

If the output file is "-", output is written to standard out.

dvrmerge has only been tested with the files written by the Comag
SL100HD with firmware version 178, your mileage may vary.



Versions
========
v1.0 Initial Release
v1.1 Fix Windows Text/Binary file handling



Partial info.dvr dissection
===========================

00000150  a8 6f 51 00  bb d6 00 00  d9 07 05 14  03 10 37 3a
                                    ^^^^^ Year

00000150  a8 6f 51 00  bb d6 00 00  d9 07 05 14  03 10 37 3a
                                          ^^ Month

00000150  a8 6f 51 00  bb d6 00 00  d9 07 05 14  03 10 37 3a
                                             ^^ Day

00000150  a8 6f 51 00  bb d6 00 00  d9 07 05 14  03 10 37 3a
                                                    ^^^^^^^^ H:M:S Start Time

00000160  bb d6 00 00  d9 07 05 14  03 14 0d 24  52 2e 00 00
                                                 ^^^^^^^^^^^ Runtime in Sec

00000160  bb d6 00 00  d9 07 05 14  03 14 0d 24  52 2e 00 00
                             ^^^^^  20.05. (Date)

00000160  bb d6 00 00  d9 07 05 14  03 14 0d 24  52 2e 00 00
                       ^^^^^ 2009 (Year)

00000170  e3 ee b4 00  00 00 05 00  5d 44 01 00  00 00 00 00
          ^^^^^^^^^^^ could be runtime in mSec?

00000170  e3 ee b4 00  00 00 05 00  5d 44 01 00  00 00 00 00
                             ^^^^^ Amount of files

00000180  33 38 02 00  67 60 00 00  01 01 00 00  00 00 00 00

00000190  00 00 00 00  92 77 08 00  75 66 bd 00  52 7a 08 00
                       ^^^^^^^^^^^ from 000.dvr

000001a0  73 8c 00 00  

Starting @ 000001a4:

               Only seconds  256 TS
File           in 100usec?   packet
                             amount

00 00 | bd 5d | 92 77 08 00 | f0 79 | 87 13
01 00 | de 5d | 94 15 2d 00 | 49 73 | 87 13
02 00 | df 5d | 50 c0 51 00 | 6d 68 | 87 13
03 00 | cb 5d | 92 6b 76 00 | c6 6f | 87 13
04 00 | f3 57 | e7 0e 9b 00 | c7 72 | 4b 12



Partial nnn.dvr dissection
==========================

00000400  e0 68 a8 59  00 00 bd 5d  92 77 08 00  f0 79 87 13
                                    ^^^^^^^^^^^ also in info.dvr

000004e0  07 ea 04 00  73 02 00 00  06 33 0a 00  e3 01 00 00
000004f0  06 26 0f 00  d3 01 00 00  06 0b 14 00  cb 01 00 00
...
0000xxx0  01 11 ef 79  00 00 00 00  00 00 00 00  00 00 00 00
                ^^^^^ 256 TS packet number^^^^^

