I am trying to create mpeg header using c++: Header hex value : 0X4700311d so the sync byte is :0x47 tei : 0 pusi : 0 priority : 0 pid : 0x0031 tsc : 0x0 afc : 0x1 cc : 13
How should the structure of the mpeg header should look like?
Is there a way to create a char array of 4 bytes and then assign values according to the header and later on modify the pid if i want to ?
I have tried to use this header:
unsigned char _syncByte;
unsigned char _tei : 1;
unsigned char _payloadStart : 1;
unsigned char _priority : 1;
int16_t _pid;
unsigned char _scramblingCtl : 2;
unsigned char _adaptationField : 2;
unsigned char _counter;
but in visual studio 2015 memory panel the values are different.