You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
626 B

package com.inspect.tcpserver.sip.media;
import java.io.ByteArrayOutputStream;
public class PsMuxer {
public byte[] pack(byte[] h264) throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
// PS header (简化版)
out.write(new byte[]{
0x00,0x00,0x01,(byte)0xBA,
0x44,0x00,0x04,0x00,0x04,0x01,(byte)0x89,(byte)0xC3,(byte)0xF8
});
// PES header
out.write(new byte[]{
0x00,0x00,0x01,(byte)0xE0,
0x00,0x00
});
out.write(h264);
return out.toByteArray();
}
}