[英]video stream issue with multipart/x-mixed-replace content-type
Good day, I use an esp8266 module as server, with a camera module to stream jpeg images continuously through wifi. 美好的一天,我使用esp8266模块作为服务器,并使用相机模块通过wifi连续流jpeg图像。 I want to have streaming video , text, and buttons all in the same browser window simultaneously . 我想同时在同一浏览器窗口中同时播放视频流,文本和按钮。 So I created the webpage in HTML and I used the "multipart/x-mixed-replace" content-type for the streaming window, text and buttons since I read that this type accepts various sub types like html and images. 因此,我创建了HTML网页,并且将“ multipart / x-mixed-replace”内容类型用于流式传输窗口,文本和按钮,因为我读到该类型接受html和image等各种子类型。 Streaming window works but... 流窗口工作,但...
To sum-up what I want to do is to have streaming video window, text, and buttons all in the same browser window simultaneously. 总结一下,我想做的是将流视频窗口,文本和按钮同时放在同一浏览器窗口中。
Below is the HTML code I wrote and the images for the streaming window I believe that I do something wrong with the content-type or I don't use it the right way. 下面是我编写的HTML代码和流窗口的图像,我认为我对内容类型做错了,或者我没有正确使用它。
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace; boundary=frame
--frame //this part shows the jpeg image captured
Content-Type: image/jpeg
..
fetch jpeg image part
..
--frame //this part hopefully adds text and buttons
Content-Type: text/html // along with the streaming video window
<!DOCTYPE HTML> //This is the idea at least...
<html>
<body>
<h1 style="position:relative; left:25px;"> ⚓ Observation Panel ⚓</h1>
<a href="/ ">
<button type="button" style="position:absolute; top:320px;
left:95px; color:blue; height:70px; width:90px; font-weight: bold;
border-style:riddge; border-width:2px; border-color:black;" >
Stop Stream
</button>
</a>
<body>
</html>
And then the above procedure is repeated continuously so as to create video stream with a button and text around it. 然后连续重复上述过程,以创建带有按钮和其周围的文本的视频流。 At least that was the idea... 至少那是个主意...
Thank you for your time. 感谢您的时间。
[1][HTML code for stream + text + button] [1] [用于流+文本+按钮的HTML代码]
[2][HTML code my laptop receives from the server] [2] [我的笔记本电脑从服务器接收的HTML代码]
[1]: https://i.stack.imgur.com/l4GSa.jpg [2]: https://i.stack.imgur.com/S8fTO.jpg [1]: https : //i.stack.imgur.com/l4GSa.jpg [2]: https : //i.stack.imgur.com/S8fTO.jpg
Not shure if this would help but I think you should create the HTML with the appearance you want for a given url (ex: http://yourserver/controlCamera ). 不知道这是否有帮助,但是我认为您应该使用给定URL的外观创建HTML(例如: http:// yourserver / controlCamera )。
In that HTML you can have an image element (the element I present was automatically generated by Chrome when accessing an axis ip camera): 在该HTML中,您可以有一个image元素(我显示的元素是访问轴IP摄像机时Chrome自动生成的):
<img style="-webkit-user-select: none;" src="http://yourserver/videoStream" width="1037" height="583">
When accessing the "/videoStream" path at yourserver, you should then provide your "multipart/x-mixed-replace" with only the "image/jpeg" parts. 在服务器上访问“ / videoStream”路径时,应仅在“ multipart / x-mixed-replace”中提供“ image / jpeg”部分。
Hope it helps ;) 希望能帮助到你 ;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.