Closed kaisawind closed 3 years ago
h264 raw stream to rtmp, so i need SetExtradata to set sps and pps, alse need SetData to set h264 raw data to packet.
We must have extradata to generate AVCDecoderConfigurationRecord.
//sps_pps = []byte{ 0x00, 0x00, 0x01, 0x67, 0x4d, 0x00, 0x1f, 0x9d, 0xa8, 0x14, 0x01, 0x6e, 0x9b, 0x80, 0x80, 0x80, 0x81, 0x00, 0x00, 0x00, 0x01, 0x68, 0xee, 0x3c, 0x80 } extradata := pkt.PacketBuffer[:index] cc.SetHeight(int(pkt.Height)). SetWidth(int(pkt.Width)). SetFrameRate(gmf.AVR{ Num: int(pkt.FrameRate), Den: 1, }). SetPixFmt(gmf.AV_PIX_FMT_YUV420P). SetExtradata(extradata)
close it for more fixed
h264 raw stream to rtmp, so i need SetExtradata to set sps and pps, alse need SetData to set h264 raw data to packet.
We must have extradata to generate AVCDecoderConfigurationRecord.