开发者

How to find keyframe in MPEG-2 stream, packed in MPEG-TS

开发者 https://www.devze.com 2023-03-10 01:30 出处:网络
I\'ve written MPEG-TS demuxer. It unpacks transport stream to PES packets. Now I want to drop all frames till I meet keyframe.

I've written MPEG-TS demuxer. It unpacks transport stream to PES packets. Now I want to drop all frames till I meet keyframe.

How can I do it? Should I find fo开发者_运维百科r Sequence block in each PES frame?


You should be able to look for a set Random Access Indicator bit in the MPEG-TS adaptation field. If you are dealing with a transport stream that does not use RAI bits, you'll need to rely on information in the contained elementary stream. For example, if you are processing an H.264 stream, you'll need to look for IDR slice NAL units (type 5).


iframes works with h262,h264, and h265

0

精彩评论

暂无评论...
验证码 换一张
取 消