question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Video stream became 'broken' randomly

See original GitHub issue

Streaming can work fine for 10 seconds or 10 minutes, but then suddenly it becomes like that: image

Eventually it can fix itself, but sometime it does not. I have tried to stream from android device and browser and got same behavior. Any idea what can be wrong?

Frame processing looks like that:

async def recv(self):
        frame = await self.track.recv()

        if (self.transform == "nothing"):
            return frame

        try:
            networkWidth = self.detectionService.width
            networkHeight = self.detectionService.height
            
            widthScale = frame.width / networkWidth
            heightScale = frame.height / networkHeight

            frame_rgb = cv2.cvtColor(frame.to_ndarray(format="bgr24"), cv2.COLOR_BGR2RGB)
            frame_resized = cv2.resize(frame_rgb, (networkWidth, networkHeight), interpolation=cv2.INTER_LINEAR)

            darknet.copy_image_from_bytes(self.darknet_image, frame_resized.tobytes())
            self.lastDetection = self.detectionService.detect(self.darknet_image)
            self.detections.put(self.lastDetection)

            image = cvDrawBoxes(self.lastDetection, frame_rgb, widthScale, heightScale)
            new_frame = VideoFrame.from_ndarray(image, format="rgb24")
            new_frame.pts = frame.pts
            new_frame.time_base = frame.time_base

            return new_frame
        except:
            info = sys.exc_info()
            return frame;            

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
jlainecommented, Feb 19, 2021

Should be fixed by 42f4e0f57b186aa15b0e731be37ca35afd780100

0reactions
jlainecommented, Sep 22, 2019

I’m going to close this issue for lack of response from the original submitter - I have nothing to go on here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New Chrome Update Breaks Streaming : r/Videostream - Reddit
63 votes, 144 comments. Sorry! This is a widespread issue caused by the newest Chrome update. We are currently working on a patch....
Read more >
Videos Not Playing on Chrome: Fix It with 10 Methods
Videos are not playing or even loading on Google Chrome? Don't worry. This article will provide 10 methods you need to fix video...
Read more >
The most common Hulu problems and how to fix them
1. Completely close the Hulu app on your streaming device and reopen it. 2. Restart your device. 3. Try resetting your router. If...
Read more >
Troubleshoot your YouTube live stream - Google Help
If you're having issues with your YouTube live stream, use the troubleshooting tips below. In addition to these tips, you can always post...
Read more >
SOLVED: Facebook Live Keeps Crashing - How to Fix
Trying to watch a Facebook Live stream and it keeps crashing? This is definitely an Internet connection issue you have to take care...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found