If you are streaming over RTSP, the MPEG4 header will not be transmitted - instead the "SDP" (session description protocol) information is exchanged via a DESCRIBE request from the client. This sdp file contains an encoded version of the frame rate etc. that is actually taken from the MDAT atom in the mpeg4 header.
If you specifically need to access the gov atom to determine the p-frame i-frame differential, you could try parsing the MPEG4 header on the server and transmitting it via a separate channel.
The way an MPEG4 header looks is basically a plaintext atom name, and then a length that is usually 4 bytes (you'll need to byte swap depending on your platform), and then data.
Here is some debugging code I have in my mpeg4 header parser:
public boolean valid_atom(byte[] word, int offset) {
for (int i = 0; i < 4; i++)
if (!(word[i + offset] >= 'a' && word[i + offset] <= 'z') && !(word[i + offset] >= 'A' && word[i + offset] <= 'Z'))
return false;
return true;
}
...
public int parse_atom(byte[] b, int offset, int depth) {
int len;
len = ifba(b, offset);
Log.d(TAG, String.format("atom: %c%c%c%c depth %d @ %d len %d", b[offset + 4], b[offset + 5], b[offset + 6], b[offset + 7], depth, offset, len));
return len;
}
...
private int ifba(byte[] buffer, int offset) {
int retval = (buffer[offset] & 0xFF) << 24;
retval += (buffer[offset + 1] & 0xFF) << 16;
retval += (buffer[offset + 2] & 0XFF) << 8;
retval += (buffer[offset + 3] & 0XFF);
return retval;
}