【rtmp】1: FLV videotag to annexb

  • [FLV] AVC+AAC FLV analysis process and pts, dts calculation

  • Only by repeating it many times can you memorize the details.

  • Clarify the details and solve problems when they arise.

  • When rtmp pushes flv, it first parses flv and converts flv videotag to annexb format.

  • Then input it to rtmp according to annexb and let rtmp push it.

  • And rtmp push needs to convert annexb to avcc.

annexb format file

  • Recorded h.264 naked stream file: http://winlinvip.github.io/srs.release/3rdparty/720p.h264.raw, or: http://ossrs.net/srs.release/3rdparty/720p. h264.raw, the format inside is annexb format:

FLV reading order

  • Read flvheader + prevtagsize for the first time
  • Solve it and read tagN + prevtagsize in sequence.

Insert image description here

Remove the tagdata after five bytes for processing

  • Read nalu_length
  • Read sps_num

рекомендация

отblog.csdn.net/commshare/article/details/131933370