从 IP 摄像机的 rtsp 视频流获取快照
通常,我可以通过供应商提供的 URL 从 IP 摄像机获取静态快照。然而,以这种方式提供的 jpeg 质量不够好,供应商表示没有提供用于以其他图像格式或更小/无损压缩提供快照的设施。
我注意到,当我使用 VLC 从相机打开 rtsp h264 流然后手动截取屏幕截图时,生成的图像没有之前观察到的 jpeg 伪影。
问题是,如何使用 C++ 程序从 h264 流中获取这些高级快照?我需要对图像执行多种操作(注释、裁剪、面部识别),但这些操作必须在获得尽可能高质量的初始图像之后进行。
(请注意,这与我的上一个问题有关。我使用 CURL 获得了 jpeg 图像,但现在想替换快照 getter如果可能的话,我将再次在 Linux(Fedora 11)上运行。
Normally, I can get a still snapshot from an IP camera with a vendor provided url. However, the jpegs served this way are not of good enough quality and the vendor says there is no facility provided for serving snapshots in other image formats or smaller/lossless compression.
I noticed when I open an rtsp h264 stream from the camera with VLC then manually take a screenshot, the resulting image has none of the jpeg artifacts observed previously.
The question is, how would I obtain these superior snapshots from an h264 stream with a c++ program? I need to perform multiple operations on the image (annotations, cropping, face recognition) but those have to come after getting as high quality as possible initial image.
(note that this is related to my previous question. I obtained jpeg images with CURL but would now like to replace the snapshot getter with this new one if possible. I am again running on linux, Fedora 11)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要一个 RTSP 客户端实现来连接到摄像机、开始接收视频源、对视频帧进行碎片整理/解包,然后您将获得它并根据需要保存/处理/呈现。
您可能希望将 live555 库视为众所周知的 RTSP 库/实现。
You need an RTSP client implementation to connect to the camera, start receiving video feed, defragment/depacketize the video frame and then you will get it and save/process/present as needed.
You might want to look towards live555 library as a well known RTSP library/implemetnation.