Skip to content

How to encode h265 without aggregation? #166

Answered by aler9
fayfive asked this question in Questions
Discussion options

You must be logged in to vote

Hello, aggregation depends entirely on how you use the library.

If you send VPS, SPS and PPS to the RTP encoder in the same access unit, they're aggregated into a single RTP packet:

rtpenc := myh265Format.CreateEncoder()
pkts, err := rtpenc.Encode([][]byte{
    vps,
    sps,
    pps,
})

Otherwise, if you send them separately, they're not aggregated but they're put in different packets:

rtpenc := myh265Format.CreateEncoder()
pkts, err := rtpenc.Encode([][]byte{
    vps,
})
pkts, err := rtpenc.Encode([][]byte{
    sps,
})
pkts, err := rtpenc.Encode([][]byte{
    pps,
})

If you don't have VPS, SPS and PPS separately but they're encoded in the same unit with AVCC or Annex-B, decode the unit i…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fayfive
Comment options

Answer selected by fayfive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants