Comments (5)
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.
from mjpeg-proxy.
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.
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.
from mjpeg-proxy.
Related Issues (12)
- Pubsub writes HTTP 200 status code even if something is wrong with the stream.
- Some DLINK camera fail the content type check
- streams kept open unexpectedly HOT 12
- 401 Unauthorized (digest?) HOT 5
- Boundary changes with every request HOT 17
- Add option to allow -rate to be defined by query string HOT 2
- Panic -> crash on i/o timeout
- No data returned, response 'pending' HOT 1
- Add info endpoint HOT 1
- Is this append needed? HOT 1
- Chunkers not ending when HTTP HEAD requests are made HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mjpeg-proxy.