[MPlayer-dev-eng] Multicast video streams.
Reimar Döffinger
uvhe at rz.uni-karlsruhe.de
Thu Jan 27 21:15:54 CET 2005
Hi,
On Thu, Jan 27, 2005 at 07:20:27PM +0000, James Courtier-Dutton wrote:
> Does anyone know how to decode the .nsc files?
Why? I think MPlayer can't play multicast anyway...
Attached is a code snippet that can do the decoding, but you have to do
the "parsing" part by hand (I just hacked it for testing so don't expect
much comfort ;-) ).
It is one of Microsoft's many special, hand-made base64 encodings.
The encoded strings start with <attribute>=02, you must remove that part. The decoded string will consist of 8 bytes length (at least it seems that's what it is) and then the string in unicode.
Greetings,
Reimar Döffinger
-------------- next part --------------
#include <stdio.h>
int main (int argc, char *argv[]) {
FILE *in = fopen("in.txt", "r");
FILE *out = fopen("out.txt", "w");
char c[4];
char v[3];
char tmp;
while (fread(c, 1, 4, in)) {
int i;
for (i = 0; i < 4; i++) {
// printf("%i %c ", c[i]);
if (c[i] >= '0' && c[i] <= '9') c[i] += 0 - '0';
else if (c[i] >= 'a' && c[i] <= 'z') c[i] += 36 - 'a';
else if (c[i] >= 'A' && c[i] <= 'Z') c[i] += 10 - 'A';
else if (c[i] == '{') c[i] = 62;
else if (c[i] == '}') c[i] = 63;
// printf("%i ", c[i]);
}
v[0] = (c[0] << 2) | (c[1] >> 4);
v[1] = (c[1] << 4) | (c[2] >> 2);
v[2] = (c[2] << 6) | c[3];
// printf("\n%i %i %i\n", v[0], v[1], v[2]);
fwrite(v, 1, 3, out);
}
fclose(in);
fclose(out);
return 0;
}
More information about the MPlayer-dev-eng
mailing list