简体   繁体   English

使用C ++从MJPEG流捕获视频

[英]Capturing video from a MJPEG stream using C++

I would like to capture a MJPEG stream using C++. 我想用C ++捕获一个MJPEG流。 Which options do I have? 我有哪些选择? I have tried OpenCV with FFMPEG support but icvCreateFileCapture_FFMPEG_p is always returning null (after a few seconds of timeout). 我尝试过支持FFMPEG的OpenCV,但icvCreateFileCapture_FFMPEG_p总是返回null(超时几秒后)。 May I program a HTTP client by myself? 我可以自己编写HTTP客户端吗?

Regards, 问候,

M-JPEG is easy to capture. M-JPEG易于捕捉。 You send one HTTP request to the server and read back infinite response in multipart/x-mixed-replace format (Content-Type). 您向服务器发送一个HTTP请求,并以multipart/x-mixed-replace格式(Content-Type)读回无限响应。 Then you split it into frames, which are self-contained JPEG files... Subheaders might or moight not contain additional information such as timestamps. 然后将其拆分为帧,这些帧是自包含的JPEG文件...子标题可能或可能不包含其他信息,如时间戳。

You might find this relevant and useful as well: How to parse MJPEG HTTP Stream within C++? 您可能会发现这相关且有用: 如何在C ++中解析MJPEG HTTP Stream?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM