Git Product home page Git Product logo

Comments (5)

kescherCode avatar kescherCode commented on July 17, 2024

One possibility at the top of my head would be to recognize whether a client has downloaded the last frame it was sent yet, and if not, put the next fully available frame into the stream. This could be a pointer to a chunked frame.

from mjpeg-proxy.

vvidic avatar vvidic commented on July 17, 2024

from mjpeg-proxy.

BigNerd95 avatar BigNerd95 commented on July 17, 2024

You can reproduce this by changing "Online" to "Slow 3G" in Chrome Developer Tools > Network.
Then add a print in these places:
https://github.com/vvidic/mjpeg-proxy/blob/master/mjpeg-proxy.go#L412
https://github.com/vvidic/mjpeg-proxy/blob/master/mjpeg-proxy.go#L419

The server block during part.Write (which is correct)

But how you can see by this log, it block after a lot of frame were sent.

chunker[/source3]: started
Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds (on part.Write)


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# here stop a few seconds


Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send Send 


# ...

Each Send is about 36452 bytes

Note: the first group of Send is much longer than the following ones

  • First group: 216 send of 36452 bytes is about 7.5 MB (maybe 8 MB considering boundary and content-length of the frame)
  • Following groups: 26 send of 36452 is about 1 MB

So it seems to be filling up an underlying buffer of 8 MB and then block until a 1 MB is free

from mjpeg-proxy.

BigNerd95 avatar BigNerd95 commented on July 17, 2024

I just tried with another computer instead of localhost.
Now it sends only 6 frame and then block.
So maybe there is a buffer only when using localhost?

Anyway, I set 1kb/s on the receiving host, but it would be better if it only sends 1 or max 2 frame.

from mjpeg-proxy.

vvidic avatar vvidic commented on July 17, 2024

from mjpeg-proxy.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.