func WriteAnnexBPacket(w *bytes.Buffer, pkt av.Packet, cd h264parser.CodecData) {
	nalus, _ := h264parser.SplitNALUs(pkt.Data)
	if pkt.IsKeyFrame {
		nalus = append([][]byte{cd.SPS(), cd.PPS()}, nalus...)
	}
	WriteAnnexB(w, nalus)
}
WriteAnnexBPacket writes a H264 packet in Annex B format.
If the packet is a keyframe, prepend codec information (SPS and PPS) as well.
package h264util
import (
	"bytes"
	"encoding/binary"
	"github.com/nareix/joy4/av"
	"github.com/nareix/joy4/codec/h264parser"
)
func WriteAnnexB(w *bytes.Buffer, nalus [][]byte) {
	for _, nalu := range nalus {
		w.Write([]byte{0, 0, 1})
		w.Write(nalu)
	}
}