在linux上使用c ++访问USB网络摄像头(asus eee) [英] Access USB Webcam using c++ on linux (asus eee)

查看:200
本文介绍了在linux上使用c ++访问USB网络摄像头(asus eee)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我试图从我的asus eee上的网络摄像头访问数据流,我不知道从哪里开始。我试图访问流,以便我可以通过本地无线网络分发它。我对套接字编程位很好,它只是到了我很难找到的流。我可以在网上找到很少的信息,所以任何帮助都会受到赞赏。


我想我可能想要在加密块之前将流存储在临时缓冲区中它通过udp套接字发送?

解决方案

最好的起点是确定正在使用的驱动程序。从那里,搜索驱动程序具有哪些功能以及支持哪些调用。然后您需要做的就是在您的程序中进行这些调用。


与网络摄像头连接,即使存在驱动程序也很困难。我会查找与相同/或类似驱动程序连接的代码示例,并将其用作模板。


爱德华


好的我会调查一下,即使我有电话怎么连接相机发送它们?我是否正确地说它是以与打开文件相同的方式完成但是使用usb设备安装名称作为文件名?


干杯


< blockquote>看起来你需要处理video4linux。内核黑客攻击是最好的方法,因为你正在处理加密和流媒体(Linux有两件事)。


使用video4linux,它可以非常简单地访问任何和所有相机支持'的框架缓冲区非常简单(一旦你完成所有设置)。


我不记得链接(并且如果我记得链接到那里是禁止的正确),但我知道那里有很好的文档。请确保使用v4l2文档而不是v4l1,因为api有几个主要区别。


至于你是否需要在用户模式或内核模式下...


希望这可以帮助您流式传输网络摄像头:)


Hi

I am attempting to get access to the data stream from the webcam on my asus eee, I have no clue as to where to start. I am trying to get to the stream so that I can distribute it over a local wireless network. I am OK with the socket programming bit, it is just getting to the stream which I am finding hard. There is little info that I can find on the web so any help would be appreciated.

I am thinking that I may want to store the stream in a temporary buffer, before encrypting a chunk of it and sending it via a udp socket?

解决方案

The best place to start is by determining what driver is being used. From there, search for what functionality that driver has and what calls are supported. Then all you need to do is make those calls in your program.

Interfacing with a webcam, even if a driver exists can be difficult. I would look for examples of code which are interfacing with the same/or a similar driver and use those as a template.

Edward


OK I will look into that, even when I have the calls how do you connect to the camera to send them? Am I right in saying that it is done in the same way as opening a file but with the usb devices mounted name as the filename?

Cheers


It seems like you are needing to deal with video4linux. Kernel hacking is about the best way, since you are dealing with encryption and streaming (two things linux excells at).

With video4linux, it makes it pretty simple to access any and all cameras supported''s frame-buffer pretty easy (once you get through setting everything up).

I don''t remember the link (and linking to there is forbidden, if I remember correctly), but I know there is excellent documentation out there. Just make sure you use v4l2 documentation instead of v4l1 because of several major differences in the api.

As for whether you need it in user mode or kernel mode...

Hopefully this helps you stream your webcam : )


这篇关于在linux上使用c ++访问USB网络摄像头(asus eee)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆