I am using MPGTX to split a MPEG file I recordedfrom a AverMedia card on a Linux system.
The command is
mpgtx -2 junk.mpg -b junkout
I am using 1.3.1 complied on puppy linux 2.17
two problems:
1) MPGTX does not recognise the system header. I can get round that by using -P or I can fix it by chnaging b8 (audio stream ID)to C0 ( all audio streams)
I do not care about this, but if there is a simple patch I can apply to the file for my header it would be nice.
2) MPGTX seems to drop the first two bytes (bytes 4 and 5 including 00 00 01 e0) of the video stream header 07 d4 ( 00 00 01 e0 07 d4 .... becomes 00 00 01 e0 ...). It only does this in the first instance of the header. I can fix it by overwriting the prior bytes to make bf e0 02 00 00 01 e0 07 d4 into bf 00 00 01 e0 01 e0 07 d4 . I know that does not make much sense I am shooting in the dark. Likewise I can fix it by playing with pack lenght in mpeg.cxx and recompiling. I can probably patch the code myself for my purposes ( ie this odd ball header) but I cannot see how you split off the system header and then video stream header. I assume the problem is that the system header is too long or misinterpreted.
See the file attached for details, you cand see that the two bytes bytes 4 and 5 PES packet length are getting dropped. It stil plays but has artifacts in the first few frames, and it is possible to fix.
Any hints anyone?
Binary view of beginning of MPEG file