Make camera footage usable in normal players like VLC 1,MPlayer et.al.


(Please note that this tool just 'extracts' audio/video from the camfile, therefore whatever is produced corresponds to camera settings)

Unlike the KKmoon cam, Teswell uses what they call 'Secure Files', the security here being Timestamps and some sort of serial number within the Video file, combined with a stupid fileheader.
This makes the files not playable in a standard player.
The 'Header' is 512 bytes long an consists of the string 'Teswell ' (with space) and the rest filled with all zeros.

Following the 'Header' there's the first 'Timestamp' with a length of 48 bytes, looking like this.

00000200 0A 00 76 04 │ 1C 0B 0F 02 │ 01 01 00 00 │ 30 30 30 30 ..v.........0000
00000210 30 30 30 30 │ 30 30 30 30 │ 30 30 30 30 │ 30 30 30 30 0000000000000000
00000220 30 00 00 0F │ 30 30 30 30 │ 37 33 00 00 │ 48 00 00 00 0...000073..H...

The ASCII 73 seems to be some sort or filenumber....
This 'Timestamp' reoccurs every 32720 bytes (with some changes to the first few bytes)

Anyway let's remove this crap :-D
tar here


#include <stdio.h> #include <stdlib.h> #define HSIZ 0x200 // headersize #define CSIZ 0x30 // weird infochunk size #define CHUNKS 0x7fd0 // actual data int main(int ac, char **av) { FILE *in,*out; int bc; char buffer[CHUNKS]; if(ac != 3) { printf("Usage: %s <infile> <outfile>\n",av[0]); exit(0); } if((in = fopen(av[1], "r")) == NULL) { perror("infile: "); exit(1); } if((out = fopen(av[2], "w")) == NULL) { perror("outfile: "); exit(1); } if(fseek(in,HSIZ+CSIZ,SEEK_SET) != 0) { printf("cannot skip header on %s, short file ?\n",av[1]); exit(1); } while((bc = fread(buffer,1,CHUNKS,in))) { // printf("read %d bytes\n",bc); fwrite(buffer,1,bc,out); // printf("wrote %d bytes\n",bc); fseek(in,CSIZ,SEEK_CUR); } fclose(in); fclose(out); exit(0); }




Feel free to use the Paypal button if you find this useful and you can afford it :-).

1. [Some Installations of VLC need tweaking h/x264 settings to make it play mp4, without a container header....]*
Changelog:
05/02/18 created.