random video interrupts
See original GitHub issueHi jlaine! Sometimes, when we are video streaming, the frames stops. we track the problem to the rtcrtpreceiver.py file and it seems some frames are None and so they don’t inserted in the queue. Do you have any ideas why this happens and what should we do to solve the problem? Is it a bug or an expected behavior? Here is the related section in rtcrtpreceiver.py module for convenience:
async def _handle_rtp_packet(self, packet):
self.__log_debug('< %s', packet)
if packet.payload_type in self._decoders:
decoder = self._decoders[packet.payload_type]
loop = asyncio.get_event_loop()
# RTCP
if self.__remote_ssrc is None:
self.__remote_ssrc = packet.ssrc
self.__remote_counter = LossCounter(packet.sequence_number)
else:
self.__remote_counter.add(packet.sequence_number)
if self._kind == 'audio':
# FIXME: audio should use the jitter buffer!
audio_frame = await loop.run_in_executor(None, decoder.decode, packet.payload)
await self._track._queue.put(audio_frame)
else:
# check if we have a complete video frame
self._jitter_buffer.add(packet.payload, packet.sequence_number, packet.timestamp)
payloads = []
got_frame = False
last_timestamp = None
for count in range(self._jitter_buffer.capacity):
frame = self._jitter_buffer.peek(count)
if frame is None:
break
if last_timestamp is None:
last_timestamp = frame.timestamp
elif frame.timestamp != last_timestamp:
got_frame = True
break
payloads.append(frame.payload)
if got_frame:
self._jitter_buffer.remove(count)
video_frames = await loop.run_in_executor(None, decoder.decode, payloads)
for video_frame in video_frames:
await self._track._queue.put(video_frame)
I think the important section is the last else block, where you are putting the video_frames to the queue. It creates the video frames only when got_frame is True and other frames get discarded. Our clients are android smart phones and we are testing in a local network.
Based on another issue we changed the buffer capacity from 32 to 64 and we got slightly better results. Do you think the buffer capacity is an important factor here?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Yes, sure! After testing with the latest version, the video quality has increased significantly and it is more stable. Sometimes the video get pixelated and stopped for a short time but it resumed to the normal state after that. Thanks a lot for your efforts. during testing the video call we get two new errors that may be informative.
and
After these errors, video playback completely stops and the ice connection become disconnected and then failed.
Ok can we please open separate tickets to track the new issues?