the code below should definitely be commented out: ..... t->trec_time = htonl(t->trec_time); t->trec_size = htonl(t->trec_size); ..... Faint, it cost me several days to study my MPEG video generation code. But the bug is in ns code, after commenting it out, my simulation run ok. Perhaps I am wrong, but could anyone tell me what are these two code for?