-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CROW to implement a MJPEG video streaming server #302
Comments
Could you show requests and responses, both from Flask and Crow? Maybe there are some differences in handling these requests? |
I have tried to use wireshark to capture the packets and I have noticed a strange thing, filtering the pakets with "http.request or http.response" using crow I can se both the request and the response, using flask I can see only the request and I need to filter with "http" to see also the packets transmitted by flask. --REQUEST (it's the same for flask and crow, I'm using chrome)-- --CROW RESPONSE-- << Image data >> --FLASK RESPONSE (captured filtering with http)-- << Image data >> When I'm using flask, I'm passing the "multipart/x-mixed-replace; boundary=frame" to the response class as mime-type and not as a Content-Type but I don't know how to achive this with CROW. |
Did you try try to return crow:response object, with custom headers? I see there is 'add_header(std::string key, std::string value)' method in this class. |
Yes, I'm already using the method add_header, and I'm passing the mime-type as: Anyway I think I will drop CROW to use a more tailored frame for my needed, because I have to stream only a mjpg from a webcam. Thank you any way for your help |
I looks like mimetype from Flask's Response class only set 'Content-Type' header. Maybe CROW doesn't stream due to double Content-Type entry as it is in your responses? |
I have already tried, but I get the same result, and without setting the mime-type on flask it doesn't work as well. Pheraps I'm missing a loop in frame generator. Anyway, also using flask, I don't understand who is triggering the request for the new frame. |
Can you maybe make wireshark dump with Flask streaming session, as well as Crow? Or maybe there is some method to dump response object in Flask? |
Sorry for posting in an old topic but I'm having the same problem I can't seem to get MJPEG streaming to work on Crow cpp webserver, here's an issue I opened : CrowCpp/Crow#890 |
Using flask and sending a response like:
---Response start here----
Content-Type: multipart/x-mixed-replace; boundary=frame
--frame
Content-Type: image/jpeg
Content-Length: #image_size#
##image_data##
--frame--
---Response end here----
I was able to build a very simple MJPEG video streaming server.
Is it possible achieve the same result with CROW?
I have tried with a similar approach but I'm able to show only the first frame, I have to manually refresh the browser to send another request and receive the new frame.
The text was updated successfully, but these errors were encountered: