Skip to content

How to calculate buffer region? #363

Answered by roleoroleo
mdkumargce asked this question in Q&A
Discussion options

You must be logged in to vote

BUF_SIZE is the size of the file.

Then you have to detect a frame and check the header.

  • Search for the sequence 00 00 00 01 67 (NALU SPS).
  • After this NALU you should see a PPS 00 00 00 01 68 and probably an IDR 00 00 00 01 65.
  • Normally (with these cams) a PPS is 8 bytes long (eg. 00 00 00 01 68 EE 3C 80 E1).
  • The distance between the end of the PPS and the start of the IDR (or another NALU that follows PPS) is an header.

FRAME_HEADER_SIZE is the size of this header.
LOWRES_BYTE is the value of the byte for low res frames (normally 8).
HIGHRES_BYTE is the value of the byte for high res frames (normally 4).
DATA_OFFSET is the offset of the resolution byte inside the header from the beginni…

Replies: 2 comments 2 replies

Comment options

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

Comment options

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

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