From 414ed1ca38370f0f0d1576c0d122cd4fe75fa546 Mon Sep 17 00:00:00 2001 From: soyer Date: Sat, 19 Mar 2022 14:16:16 +0100 Subject: [PATCH] H264Parser: don't send frames with 0 NALU --- h264.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/h264.py b/h264.py index dba3680..a76a699 100644 --- a/h264.py +++ b/h264.py @@ -72,6 +72,10 @@ def write_buf(self, buf): if not self.sps or not self.pps: logging.error('H264Parser: Invalid H264 first frame. Unable to read SPS and PPS.') + if len(nalus) == 0: + logging.warning('H264Parser: 0 NALU found') + return + with self.condition: self.nalus = nalus self.frame_secs = buf.timestamp.secs